ganeswidgets/tsrc/fute/HgWidgetTest/src/hgwidgettestdatamodel.cpp
changeset 6 1cdcc61142d2
parent 5 4fa04caf0f43
equal deleted inserted replaced
5:4fa04caf0f43 6:1cdcc61142d2
    17 
    17 
    18 #include <QBrush>
    18 #include <QBrush>
    19 #include <QColor>
    19 #include <QColor>
    20 #include <QtCore>
    20 #include <QtCore>
    21 
    21 
    22 #include <hbicon.h>
    22 #include <HbIcon>
    23 #include <hbnamespace.h>
    23 #include <hbnamespace.h>
    24 #include <hgwidgets/hgwidgets.h>
    24 #include <hgwidgets/hgwidgets.h>
    25 
    25 
    26 #include "hgwidgettestdatamodel.h"
    26 #include "hgwidgettestdatamodel.h"
    27 #include "hgwidgettestalbumartmanager.h"
    27 #include "hgwidgettestalbumartmanager.h"
    55     : QAbstractListModel(parent),
    55     : QAbstractListModel(parent),
    56       mCachingInProgress(false),
    56       mCachingInProgress(false),
    57       mImageType(ImageTypeNone),
    57       mImageType(ImageTypeNone),
    58 //      mDefaultIcon((":/images/default.svg")),
    58 //      mDefaultIcon((":/images/default.svg")),
    59       mUseLowResImages(false),
    59       mUseLowResImages(false),
       
    60       mBufferManager(0),
       
    61       mSilentDataFetch(false),
    60       mWrapper( new ThumbnailManager() ),
    62       mWrapper( new ThumbnailManager() ),
    61       mThumbnailRequestPending(false),
    63       mThumbnailRequestPending(false),
    62       mThumbnailRequestIndex(-1),
    64       mThumbnailRequestIndex(-1),
    63       mThumbnailRequestID(-1),
    65       mThumbnailRequestID(-1)
    64       mBufferManager(0),
       
    65       mSilentDataFetch(false)
       
    66 {
    66 {
    67     FUNC_LOG;
    67     FUNC_LOG;
    68     mWrapper->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
    68     mWrapper->setQualityPreference( ThumbnailManager::OptimizeForPerformance );
    69 
    69 
    70     mWrapper->setProperty("qimageSupport","true");
    70     mWrapper->setProperty("qimageSupport","true");
   594     getNextThumbnail();
   594     getNextThumbnail();
   595 }
   595 }
   596 
   596 
   597 void HgWidgetTestDataModel::thumbnailReady( QPixmap pixmap, void* data, int /*id*/, int error )
   597 void HgWidgetTestDataModel::thumbnailReady( QPixmap pixmap, void* data, int /*id*/, int error )
   598 {
   598 {
       
   599     Q_UNUSED(data);
       
   600     
   599     if (!error && !pixmap.isNull() ){
   601     if (!error && !pixmap.isNull() ){
   600 //        int idx = reinterpret_cast<int>(data);
   602 //        int idx = reinterpret_cast<int>(data);
   601         if (mImageType == ImageTypeQPixmap || mImageType == ImageTypeHbIcon)
   603         if (mImageType == ImageTypeQPixmap || mImageType == ImageTypeHbIcon)
   602         {
   604         {
   603             mPixmaps.replace(mThumbnailRequestIndex, pixmap);
   605             mPixmaps.replace(mThumbnailRequestIndex, pixmap);