videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp
changeset 50 21fe8338c6bf
parent 44 518105d52e45
child 58 d2b028fd1f7d
equal deleted inserted replaced
49:824471cb468a 50:21fe8338c6bf
    13 *
    13 *
    14 * Description:  VideoThumbnailDataPrivate class implementation
    14 * Description:  VideoThumbnailDataPrivate class implementation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 24.1.1 %
    18 // Version : %version: 24.1.3 %
    19 
    19 
    20 // INCLUDE FILES
    20 // INCLUDE FILES
    21 #include <qapplication.h>
    21 #include <qapplication.h>
    22 #include <qpixmap.h>
    22 #include <qpixmap.h>
    23 #include <qtimer.h>
    23 #include <qtimer.h>
   209 
   209 
   210 // -----------------------------------------------------------------------------
   210 // -----------------------------------------------------------------------------
   211 // VideoThumbnailDataPrivate::getThumbnail()
   211 // VideoThumbnailDataPrivate::getThumbnail()
   212 // -----------------------------------------------------------------------------
   212 // -----------------------------------------------------------------------------
   213 //
   213 //
   214 const QIcon* VideoThumbnailDataPrivate::getThumbnail(TMPXItemId mediaId)
   214 const QIcon* VideoThumbnailDataPrivate::getThumbnail( const TMPXItemId &mediaId)
   215 {
   215 {
   216     const QIcon *thumbnail = mThumbnailData[mediaId];
   216     const QIcon *thumbnail = mThumbnailData[mediaId];
   217     if(!thumbnail)
   217     if(!thumbnail)
   218     {
   218     {
   219         return defaultThumbnail(mediaId);
   219         return defaultThumbnail(mediaId);
   257 
   257 
   258 // -----------------------------------------------------------------------------
   258 // -----------------------------------------------------------------------------
   259 // VideoThumbnailDataPrivate::startFetchingThumbnail()
   259 // VideoThumbnailDataPrivate::startFetchingThumbnail()
   260 // -----------------------------------------------------------------------------
   260 // -----------------------------------------------------------------------------
   261 //
   261 //
   262 int VideoThumbnailDataPrivate::startFetchingThumbnail(TMPXItemId mediaId, int priority)
   262 int VideoThumbnailDataPrivate::startFetchingThumbnail(const TMPXItemId &mediaId, int priority)
   263 {
   263 {
   264     if(!mCurrentModel || !mThumbnailFetcher)
   264     if(!mCurrentModel || !mThumbnailFetcher)
   265     {
   265     {
   266         return -1;
   266         return -1;
   267     }
   267     }
   339 
   339 
   340 // -----------------------------------------------------------------------------
   340 // -----------------------------------------------------------------------------
   341 // VideoThumbnailDataPrivate::getModelIndexes()
   341 // VideoThumbnailDataPrivate::getModelIndexes()
   342 // -----------------------------------------------------------------------------
   342 // -----------------------------------------------------------------------------
   343 //
   343 //
   344 void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
   344 void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int &startIndex, int &endIndex)
   345 {
   345 {
   346 	FUNC_LOG;
   346 	FUNC_LOG;
   347     INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
   347     INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
   348 	
   348 	
   349     QModelIndex index;
   349     QModelIndex index;
   406 
   406 
   407 // -----------------------------------------------------------------------------
   407 // -----------------------------------------------------------------------------
   408 // VideoThumbnailDataPrivate::defaultThumbnail()
   408 // VideoThumbnailDataPrivate::defaultThumbnail()
   409 // -----------------------------------------------------------------------------
   409 // -----------------------------------------------------------------------------
   410 //
   410 //
   411 const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(TMPXItemId mediaId)
   411 const QIcon* VideoThumbnailDataPrivate::defaultThumbnail(const TMPXItemId &mediaId)
   412 {
   412 {
   413     const TMPXItemId defaultIdVideo(KMaxTUint32-1, KVcxMvcMediaTypeVideo);
   413     const TMPXItemId defaultIdVideo(KMaxTUint32-1, KVcxMvcMediaTypeVideo);
   414     const TMPXItemId defaultIdAlbum(KMaxTUint32-1, KVcxMvcMediaTypeAlbum);
   414     const TMPXItemId defaultIdAlbum(KMaxTUint32-1, KVcxMvcMediaTypeAlbum);
   415     const TMPXItemId defaultIdDownloads(KVcxMvcCategoryIdDownloads, KVcxMvcMediaTypeCategory);
   415     const TMPXItemId defaultIdDownloads(KVcxMvcCategoryIdDownloads, KVcxMvcMediaTypeCategory);
   416     const TMPXItemId defaultIdCaptured(KVcxMvcCategoryIdCaptured, KVcxMvcMediaTypeCategory);
   416     const TMPXItemId defaultIdCaptured(KVcxMvcCategoryIdCaptured, KVcxMvcMediaTypeCategory);
   521 
   521 
   522 // -----------------------------------------------------------------------------
   522 // -----------------------------------------------------------------------------
   523 // VideoThumbnailDataPrivate::removeThumbnail()
   523 // VideoThumbnailDataPrivate::removeThumbnail()
   524 // -----------------------------------------------------------------------------
   524 // -----------------------------------------------------------------------------
   525 //
   525 //
   526 bool VideoThumbnailDataPrivate::removeThumbnail(TMPXItemId mediaId)
   526 bool VideoThumbnailDataPrivate::removeThumbnail(const TMPXItemId &mediaId)
   527 {
   527 {
   528 	FUNC_LOG;
   528 	FUNC_LOG;
   529     return mThumbnailData.remove(mediaId);
   529     return mThumbnailData.remove(mediaId);
   530 }
   530 }
   531 
   531 
   551 	INFO_1("VideoThumbnailDataPrivate::enableThumbnailCreation() enable: %d", enable);
   551 	INFO_1("VideoThumbnailDataPrivate::enableThumbnailCreation() enable: %d", enable);
   552     if(mThumbnailFetcher)
   552     if(mThumbnailFetcher)
   553     {
   553     {
   554         mThumbnailFetcher->enableThumbnailCreation(enable);
   554         mThumbnailFetcher->enableThumbnailCreation(enable);
   555     }
   555     }
       
   556 }
       
   557 
       
   558 // -----------------------------------------------------------------------------
       
   559 // VideoThumbnailDataPrivate::backgroundFetchingEnabled()
       
   560 // -----------------------------------------------------------------------------
       
   561 //
       
   562 bool VideoThumbnailDataPrivate::backgroundFetchingEnabled()
       
   563 {
       
   564     return mBackgroundFetchingEnabled;
   556 }
   565 }
   557 
   566 
   558 // -----------------------------------------------------------------------------
   567 // -----------------------------------------------------------------------------
   559 // VideoThumbnailDataPrivate::freeThumbnailData()
   568 // VideoThumbnailDataPrivate::freeThumbnailData()
   560 // -----------------------------------------------------------------------------
   569 // -----------------------------------------------------------------------------