phonebookui/pbkcommonui/src/cntgroupdeletepopupmodel.cpp
changeset 65 ae724a111993
parent 47 7cbcb2896f0e
equal deleted inserted replaced
59:a642906a277a 65:ae724a111993
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "cntgroupdeletepopupmodel.h"
    18 #include "cntgroupdeletepopupmodel.h"
       
    19 #include "cntthumbnailmanager.h"
    19 #include "cntfavourite.h"
    20 #include "cntfavourite.h"
    20 
    21 #include <cntabstractengine.h>
    21 #include <thumbnailmanager_qt.h>
    22 #include "cntglobal.h"
       
    23 
    22 #include <qtcontacts.h>
    24 #include <qtcontacts.h>
    23 #include <hbglobal.h>
    25 #include <hbglobal.h>
    24 #include <hbicon.h>
    26 #include <hbicon.h>
    25 
    27 
    26 /*!
    28 /*!
    27 Constructor
    29 Constructor
    28 */
    30 */
    29 CntGroupDeletePopupModel::CntGroupDeletePopupModel(QContactManager *manager, QObject *parent)
    31 CntGroupDeletePopupModel::CntGroupDeletePopupModel(CntAbstractEngine *aEngine, QObject *parent)
    30     : QAbstractListModel(parent),
    32     : QAbstractListModel(parent),
    31     mFavoriteGroupId(-1)
    33     mFavoriteGroupId(-1)
    32 {
    34 {
    33     d = new CntGroupPopupListData();
    35     d = new CntGroupPopupListData();
    34     d->mContactManager = manager;
    36     d->mContactManager = &aEngine->contactManager( SYMBIAN_BACKEND );
    35     
    37     
    36     mFavoriteGroupId = CntFavourite::createFavouriteGroup( d->mContactManager );
    38     mFavoriteGroupId = CntFavourite::createFavouriteGroup( d->mContactManager );
    37     
    39     
    38     d->mThumbnailManager = new ThumbnailManager(this);
    40     d->mThumbnailManager = &aEngine->thumbnailManager();
    39     d->mThumbnailManager->setMode(ThumbnailManager::Default);
       
    40     d->mThumbnailManager->setQualityPreference(ThumbnailManager::OptimizeForPerformance);
       
    41     d->mThumbnailManager->setThumbnailSize(ThumbnailManager::ThumbnailSmall);
       
    42     connect(d->mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
    41     connect(d->mThumbnailManager, SIGNAL(thumbnailReady(QPixmap, void *, int, int)),
    43              this, SLOT(onIconReady(QPixmap, void *, int, int)));
    42              this, SLOT(onIconReady(QPixmap, void *, int, int)));
    44 }
    43 }
    45 
    44 
    46 /*!
    45 /*!
   110                 QList<QContactAvatar> details = contact.details<QContactAvatar>();
   109                 QList<QContactAvatar> details = contact.details<QContactAvatar>();
   111                 for (int k = 0;k < details.count();k++)
   110                 for (int k = 0;k < details.count();k++)
   112                 {
   111                 {
   113                    if (details.at(k).imageUrl().isValid())
   112                    if (details.at(k).imageUrl().isValid())
   114                    {
   113                    {
   115                        int id = d->mThumbnailManager->getThumbnail(details.at(k).imageUrl().toString());
   114                        int id = d->mThumbnailManager->getThumbnail(ThumbnailManager::ThumbnailSmall, details.at(k).imageUrl().toString());
   116                        d->mIconRequests.insert(id, rowCount());
   115                        d->mIconRequests.insert(id, rowCount());
   117                        break;
   116                        break;
   118                    }
   117                    }
   119                 }
   118                 }
   120 
   119