[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [digikam/frameworks] libs/models: Provide the changed role
From:       Marcel Wiesweg <marcel.wiesweg () gmx ! de>
Date:       2015-09-11 9:55:40
Message-ID: E1ZaL3U-0004vT-Nk () scm ! kde ! org
[Download RAW message or body]

Git commit 0ffbbed9bdbc61332fc5a273067ca4bca707b9e0 by Marcel Wiesweg.
Committed on 11/09/2015 at 09:54.
Pushed by mwiesweg into branch 'frameworks'.

Provide the changed role

I dont see a place where Qt makes use of this, but it's certainly good
behavior and allows optimization

M  +3    -1    libs/models/imagethumbnailmodel.cpp

http://commits.kde.org/digikam/0ffbbed9bdbc61332fc5a273067ca4bca707b9e0

diff --git a/libs/models/imagethumbnailmodel.cpp b/libs/models/imagethumbna=
ilmodel.cpp
index fe7ea4d..8b83918 100644
--- a/libs/models/imagethumbnailmodel.cpp
+++ b/libs/models/imagethumbnailmodel.cpp
@@ -50,6 +50,7 @@ public:
         preloadThumbSize(0),
         emitDataChanged(true)
     {
+        staticListContainingThumbnailRole << ImageModel::ThumbnailRole;
     }
 =

     ThumbnailLoadThread*   thread;
@@ -58,6 +59,7 @@ public:
     ThumbnailSize          lastGlobalThumbSize;
     ThumbnailSize          preloadThumbSize;
     QRect                  detailRect;
+    QVector<int>           staticListContainingThumbnailRole;
 =

     bool                   emitDataChanged;
 =

@@ -312,7 +314,7 @@ void ImageThumbnailModel::slotThumbnailLoaded(const Loa=
dingDescription& loadingD
 =

             if (d->emitDataChanged)
             {
-                emit dataChanged(index, index);
+                emit dataChanged(index, index, d->staticListContainingThum=
bnailRole);
             }
         }
     }

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic