hgcacheproxymodel/tsrc/fute/HgCacheProxyModelTestApp/src/mydataprovider.cpp
changeset 6 1cdcc61142d2
parent 3 c863538fcbb6
child 17 a10844a9914d
equal deleted inserted replaced
5:4fa04caf0f43 6:1cdcc61142d2
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 *  Version     : %version: 5 %
    16 *  Version     : %version: 7 %
    17 */
    17 */
    18 #include <QList>
    18 #include <QList>
    19 #include "hglogger.h"
    19 #include "hglogger.h"
    20 #include <hbicon.h>
    20 #include <HbIcon>
    21 #include "mydataprovider.h"
    21 #include "mydataprovider.h"
    22 
       
    23 //#include "x:\sf\mw\qt\src\openvg\qpixmapdata_vg_p.h"
       
    24 //typedef VGImage (*pfnVgCreateEGLImageTargetKHR)(VGeglImageKHR);
       
    25 
    22 
    26 const int KItemIdRole = Qt::UserRole+1;
    23 const int KItemIdRole = Qt::UserRole+1;
    27 
    24 
    28 const int KThumbnailsPriority = EPriorityLess; //standard priority
    25 const int KThumbnailsPriority = EPriorityLess; //standard priority
    29 
    26 
    30 
    27 
    31 MyDataProvider::MyDataProvider(QObject *parent) :
    28 MyDataProvider::MyDataProvider(QObject *parent) :
    32 HgDataProviderModel(parent),
    29 HgDataProviderModel(parent),
    33 mDefaultIcon(new HbIcon(QIcon(QPixmap(":/icons/default.png")))),
    30 mDefaultIcon(QIcon(QPixmap(":/icons/default.png"))),
    34 mScheduler(new CActiveSchedulerWait()),
    31 mScheduler(new CActiveSchedulerWait()),
    35 mWrapper( new ThumbnailManager() ),
    32 mWrapper( new ThumbnailManager() ),
    36 mThumbnailRequestPending(false),
    33 mThumbnailRequestPending(false),
    37 mThumbnailRequestIndex(-1),
    34 mThumbnailRequestIndex(-1),
    38 mThumbnailRequestID(-1),
    35 mThumbnailRequestID(-1),
    40 mMDSLoadInProgress(false),
    37 mMDSLoadInProgress(false),
    41 mMode(0)
    38 mMode(0)
    42 {
    39 {
    43 //    TX_ENTRY
    40 //    TX_ENTRY
    44     Q_UNUSED(parent);
    41     Q_UNUSED(parent);
       
    42     
    45     mWrapper->setThumbnailSize( mThumbnailsize );
    43     mWrapper->setThumbnailSize( mThumbnailsize );
    46     mWrapper->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
    44     mWrapper->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
    47 
    45 
    48     QObject::connect( mWrapper, SIGNAL(thumbnailReady( QPixmap , void* , int, int ) ),
    46     QObject::connect( mWrapper, SIGNAL(thumbnailReady( QPixmap , void* , int, int ) ),
    49                       this, SLOT( thumbnailReady( QPixmap , void* , int , int )));
    47                       this, SLOT( thumbnailReady( QPixmap , void* , int , int )));
    52 }
    50 }
    53 
    51 
    54 MyDataProvider::~MyDataProvider()
    52 MyDataProvider::~MyDataProvider()
    55 {
    53 {
    56 //    TX_ENTRY
    54 //    TX_ENTRY
    57     delete mDefaultIcon;
       
    58     delete mWrapper;
    55     delete mWrapper;
    59     delete mScheduler;
    56     delete mScheduler;
    60 //    TX_EXIT
    57 //    TX_EXIT
    61 }
    58 }
    62 
    59 
   163     TX_EXIT        
   160     TX_EXIT        
   164 }
   161 }
   165 
   162 
   166 QVariant MyDataProvider::defaultIcon() const
   163 QVariant MyDataProvider::defaultIcon() const
   167 {
   164 {
   168     return *mDefaultIcon;
   165     return mDefaultIcon;
   169 }
   166 }
   170 
   167 
   171 void MyDataProvider::HandleSessionOpened(CMdESession& aSession, TInt aError)
   168 void MyDataProvider::HandleSessionOpened(CMdESession& aSession, TInt aError)
   172 {
   169 {
   173     Q_UNUSED(aSession);
   170     Q_UNUSED(aSession);