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

List:       kde-commits
Subject:    [digikam] libs: Adapt to thumbnail API changes
From:       Marcel Wiesweg <marcel.wiesweg () gmx ! de>
Date:       2014-11-16 18:04:46
Message-ID: E1Xq4Bq-0007Vt-Nr () scm ! kde ! org
[Download RAW message or body]

Git commit 85ec8e3c3c97367176bc019edd9bf0aba3ef1e77 by Marcel Wiesweg.
Committed on 16/11/2014 at 15:38.
Pushed by mwiesweg into branch 'master'.

Adapt to thumbnail API changes

M  +1    -1    libs/dialogs/deletedialog.cpp
M  +1    -1    libs/dialogs/imagedialog.cpp
M  +4    -1    libs/imageproperties/imagegpsmodelhelper.cpp
M  +0    -3    libs/kgeomaphelper/digikam2kgeomap.cpp
M  +13   -14   libs/models/imagethumbnailmodel.cpp

http://commits.kde.org/digikam/85ec8e3c3c97367176bc019edd9bf0aba3ef1e77

diff --git a/libs/dialogs/deletedialog.cpp b/libs/dialogs/deletedialog.cpp
index d3d0486..d70fc3d 100644
--- a/libs/dialogs/deletedialog.cpp
+++ b/libs/dialogs/deletedialog.cpp
@@ -216,7 +216,7 @@ void DeleteItemList::drawRow(QPainter* p, const \
QStyleOptionViewItem& opt, const  
     if (item && !item->hasValidThumbnail())
     {
-        d->thumbLoadThread->find(item->fileUrl());
+        d->thumbLoadThread->find(ThumbnailIdentifier(item->fileUrl()));
     }
 
     QTreeWidget::drawRow(p, opt, index);
diff --git a/libs/dialogs/imagedialog.cpp b/libs/dialogs/imagedialog.cpp
index 6293d23..8fed13c 100644
--- a/libs/dialogs/imagedialog.cpp
+++ b/libs/dialogs/imagedialog.cpp
@@ -134,7 +134,7 @@ void ImageDialogPreview::showPreview(const KUrl& url)
     {
         clearPreview();
         d->currentURL = url;
-        d->thumbLoadThread->find(d->currentURL.toLocalFile());
+        d->thumbLoadThread->find(ThumbnailIdentifier(d->currentURL.toLocalFile()));
 
         d->metaIface.load(d->currentURL.toLocalFile());
         PhotoInfoContainer info      = d->metaIface.getPhotographInformation();
diff --git a/libs/imageproperties/imagegpsmodelhelper.cpp \
b/libs/imageproperties/imagegpsmodelhelper.cpp index 47f00dc..0a0ccb5 100644
--- a/libs/imageproperties/imagegpsmodelhelper.cpp
+++ b/libs/imageproperties/imagegpsmodelhelper.cpp
@@ -102,7 +102,10 @@ QPixmap ImageGPSModelHelper::pixmapFromRepresentativeIndex(const \
                QPersistentMode
     const GPSImageInfo currentGPSImageInfo = \
currentIndex.data(RoleGPSImageInfo).value<GPSImageInfo>();  
     QPixmap thumbnail;
-    if (d->thumbnailLoadThread->find(currentGPSImageInfo.url.path(), thumbnail, \
qMax(size.width(), size.height()))) +    ThumbnailIdentifier thumbId;
+    thumbId.filePath = currentGPSImageInfo.url.path();
+    thumbId.id       = currentGPSImageInfo.id;
+    if (d->thumbnailLoadThread->find(thumbId, thumbnail, qMax(size.width(), \
size.height())))  {
         // digikam returns thumbnails with a border around them, but libkgeomap \
                expects them without a border
         return thumbnail.copy(1, 1, thumbnail.size().width()-2, \
                thumbnail.size().height()-2);
diff --git a/libs/kgeomaphelper/digikam2kgeomap.cpp \
b/libs/kgeomaphelper/digikam2kgeomap.cpp index 09da097..a7f0034 100644
--- a/libs/kgeomaphelper/digikam2kgeomap.cpp
+++ b/libs/kgeomaphelper/digikam2kgeomap.cpp
@@ -40,9 +40,6 @@
 
 // local includes
 
-#include "imageinfo.h"
-#include "imageposition.h"
-
 namespace Digikam
 {
 
diff --git a/libs/models/imagethumbnailmodel.cpp \
b/libs/models/imagethumbnailmodel.cpp index fa38000..660aadc 100644
--- a/libs/models/imagethumbnailmodel.cpp
+++ b/libs/models/imagethumbnailmodel.cpp
@@ -156,12 +156,12 @@ void ImageThumbnailModel::prepareThumbnails(const \
QList<QModelIndex>& indexesToP  return;
     }
 
-    QStringList filePaths;
+    QList<ThumbnailIdentifier> ids;
     foreach(const QModelIndex& index, indexesToPrepare)
     {
-        filePaths << imageInfoRef(index).filePath();
+        ids << imageInfoRef(index).thumbnailIdentifier();
     }
-    d->thread->findGroup(filePaths, thumbSize.size());
+    d->thread->findGroup(ids, thumbSize.size());
 }
 
 void ImageThumbnailModel::preloadThumbnails(const QList<ImageInfo>& infos)
@@ -171,29 +171,28 @@ void ImageThumbnailModel::preloadThumbnails(const \
QList<ImageInfo>& infos)  return;
     }
 
-    QStringList filePaths;
+    QList<ThumbnailIdentifier> ids;
     foreach(const ImageInfo& info, infos)
     {
-        filePaths << info.filePath();
+        ids << info.thumbnailIdentifier();
     }
-    d->preloadThread->stopAllTasks();
-    d->preloadThread->pregenerateGroup(filePaths, d->preloadThumbnailSize());
+    d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize());
 }
 
-void ImageThumbnailModel::preloadThumbnails(const QList<QModelIndex>& infos)
+void ImageThumbnailModel::preloadThumbnails(const QList<QModelIndex>& \
indexesToPreload)  {
     if (!d->preloadThread)
     {
         return;
     }
 
-    QStringList filePaths;
-    foreach(const QModelIndex& index, infos)
+    QList<ThumbnailIdentifier> ids;
+    foreach(const QModelIndex& index, indexesToPreload)
     {
-        filePaths << imageInfoRef(index).filePath();
+        ids << imageInfoRef(index).thumbnailIdentifier();
     }
     d->preloadThread->stopAllTasks();
-    d->preloadThread->pregenerateGroup(filePaths, d->preloadThumbnailSize());
+    d->preloadThread->pregenerateGroup(ids, d->preloadThumbnailSize());
 }
 
 void ImageThumbnailModel::preloadAllThumbnails()
@@ -224,14 +223,14 @@ QVariant ImageThumbnailModel::data(const QModelIndex& index, \
int role) const  
         if (!d->detailRect.isNull())
         {
-            if (d->thread->find(path, d->detailRect, thumbnail, \
d->thumbSize.size())) +            if (d->thread->find(info.thumbnailIdentifier(), \
d->detailRect, thumbnail, d->thumbSize.size()))  {
                 return thumbnail;
             }
         }
         else
         {
-            if (d->thread->find(path, thumbnail, d->thumbSize.size()))
+            if (d->thread->find(info.thumbnailIdentifier(), thumbnail, \
d->thumbSize.size()))  {
                 return thumbnail;
             }


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

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