videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp
changeset 44 518105d52e45
parent 38 ff53afa8ad05
child 50 21fe8338c6bf
--- a/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp	Fri Jul 02 17:14:33 2010 +0300
+++ b/videocollection/videocollectionwrapper/src/videothumbnaildata_p.cpp	Thu Jul 08 13:05:19 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 24 %
+// Version : %version: 24.1.1 %
 
 // INCLUDE FILES
 #include <qapplication.h>
@@ -163,13 +163,6 @@
 	FUNC_LOG;
     if(mSignalsConnected)
     {
-        VideoSortFilterProxyModel *model = 
-                VideoCollectionWrapper::instance().getModel(VideoCollectionCommon::EModelTypeAllVideos);
-        if(model)
-            {
-            disconnect(model->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelChangedSlot()));
-            disconnect(model->sourceModel(), SIGNAL(modelChanged()), this, SLOT(modelChangedSlot()));
-            }
 		disconnect(mThumbnailFetcher, SIGNAL(thumbnailReady(QPixmap , const TMPXItemId &, int )),
                     this, SLOT(thumbnailReadySlot(QPixmap , const TMPXItemId &, int )));
         disconnect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
@@ -197,8 +190,6 @@
                     this, SLOT(thumbnailReadySlot( QPixmap , const TMPXItemId &, int))) ||
             !connect(mThumbnailFetcher, SIGNAL(allThumbnailsFetched()),
                      this, SLOT(allThumbnailsFetchedSlot())) ||
-           !connect(model->sourceModel(), SIGNAL(modelReady()), this, SLOT(modelChangedSlot())) ||
-           !connect(model->sourceModel(), SIGNAL(modelChanged()), this, SLOT(modelChangedSlot())) ||
            !connect(mBgFetchTimer, SIGNAL(timeout()), this, SLOT(doBackgroundFetching())) ||
            !connect(mTbnReportTimer, SIGNAL(timeout()), this, SLOT(reportThumbnailsReadySlot())))
         {
@@ -299,11 +290,13 @@
 void VideoThumbnailDataPrivate::doBackgroundFetching()
 {
 	FUNC_LOG;
+	INFO_1("VideoThumbnailDataPrivate::doBackgroundFetching() bg fetch count: %d", mCurrentBackgroundFetchCount);
+	
     if(!mCurrentModel || !mThumbnailFetcher)
     {
         return;
     }
-
+    
     if(mCurrentBackgroundFetchCount >= THUMBNAIL_CACHE_SIZE)
     {
         return;
@@ -351,6 +344,8 @@
 void VideoThumbnailDataPrivate::getModelIndexes(QList<QModelIndex> &indexes, int startIndex, int endIndex)
 {
 	FUNC_LOG;
+    INFO_2("VideoThumbnailDataPrivate::getModelIndexes() from %d to %d", startIndex, endIndex);
+	
     QModelIndex index;
     for(int i = startIndex; i < endIndex; i++)
     {
@@ -410,16 +405,6 @@
 }
 
 // -----------------------------------------------------------------------------
-// VideoThumbnailDataPrivate::modelChangedSlot()
-// -----------------------------------------------------------------------------
-//
-void VideoThumbnailDataPrivate::modelChangedSlot()
-{
-	FUNC_LOG;
-    startBackgroundFetching(mCurrentModel, mCurrentFetchIndex);
-}
-
-// -----------------------------------------------------------------------------
 // VideoThumbnailDataPrivate::defaultThumbnail()
 // -----------------------------------------------------------------------------
 //
@@ -622,7 +607,12 @@
         INFO("VideoThumbnailDataPrivate::startBackgroundFetching() fetching is disabled.");
         return;
     }
-    
+
+    if(mBgFetchTimer)
+    {
+        mBgFetchTimer->stop();
+    }
+	
     doBackgroundFetching();
 }