[Digikam-devel] extragear/graphics/digikam

Andi Clemens andi.clemens at gmx.net
Sun Nov 14 18:11:21 GMT 2010


SVN commit 1197041 by aclemens:

Remove thumbnails in scan mode, too. We need to implement some method to update
the thumbnail database by unique-hashes, right now we are not doing this and
therefore the thumbdb gets not updated correctly.

Marcel,
if there is already a way to update the thumbdb by unique-hashes (only the
filepath will be set in this case), please show me where this is done.

Andi

CCMAIL:digikam-devel at kde.org
CCMAIL:marcel.wiesweg at gmx.de

 M  +2 -0      libs/database/thumbnaildb.cpp  
 M  +1 -2      libs/threadimageio/thumbnailcreator.cpp  
 M  +12 -0     libs/threadimageio/thumbnailloadthread.cpp  
 M  +12 -4     utilities/batch/batchthumbsgenerator.cpp  


--- trunk/extragear/graphics/digikam/libs/database/thumbnaildb.cpp #1197040:1197041
@@ -138,7 +138,9 @@
                                          .arg(DatabaseThumbnail::PNG));
 
     if (!d->db->exec(query))
+    {
         return QHash<QString, int>();
+    }
 
     QHash <QString, int> filePaths;
 
--- trunk/extragear/graphics/digikam/libs/threadimageio/thumbnailcreator.cpp #1197040:1197041
@@ -532,7 +532,7 @@
     if (dbInfo.type == DatabaseThumbnail::PGF)
     {
         // NOTE: see B.K.O #233094: using PGF compression level 4 there. Do not use a value > 4,
-        // else image is blured due to donw-sampling.
+        // else image is blurred due to down-sampling.
         if (!writePGFImageData(image.qimage, dbInfo.data, 4))
         {
             kWarning() << "Cannot save PGF thumb in DB";
@@ -578,7 +578,6 @@
     DatabaseCoreBackend::QueryState lastQueryState = DatabaseCoreBackend::ConnectionError;
     while(lastQueryState == DatabaseCoreBackend::ConnectionError)
     {
-
         lastQueryState = access.backend()->beginTransaction();
         if (DatabaseCoreBackend::NoErrors != lastQueryState)
         {
--- trunk/extragear/graphics/digikam/libs/threadimageio/thumbnailloadthread.cpp #1197040:1197041
@@ -408,8 +408,10 @@
         // If there is a result waiting for conversion to pixmap, return false - pixmap will come shortly
         QMutexLocker lock(&d->resultsMutex);
         if (d->collectedResults.contains(cacheKey))
+        {
             return;
     }
+    }
 
     load(description);
 }
@@ -422,7 +424,9 @@
 void ThumbnailLoadThread::findGroup(const QStringList& filePaths, int size)
 {
     if (!checkSize(size))
+    {
         return;
+    }
 
     QList<LoadingDescription> descriptions = d->makeDescriptions(filePaths, size);
     ManagedLoadSaveThread::prependThumbnailGroup(descriptions);
@@ -664,11 +668,15 @@
     */
 
     if (pix.isNull())
+    {
         pix = DesktopIcon("image-missing", KIconLoader::SizeEnormous);
+    }
 
     if (pix.isNull())
+    {
         // give up
         return QPixmap();
+    }
 
     // Resize icon to the right size depending of current settings.
 
@@ -692,12 +700,16 @@
 
         QStringList possibleKeys = LoadingDescription::possibleThumbnailCacheKeys(filePath);
         foreach(const QString& cacheKey, possibleKeys)
+        {
             cache->removeThumbnail(cacheKey);
     }
+    }
 
     ThumbnailCreator creator(static_d->storageMethod);
     if (static_d->provider)
+    {
         creator.setThumbnailInfoProvider(static_d->provider);
+    }
     creator.deleteThumbnailsFromDisk(filePath);
 }
 
--- trunk/extragear/graphics/digikam/utilities/batch/batchthumbsgenerator.cpp #1197040:1197041
@@ -127,11 +127,15 @@
         while (it != d->allPicturesPath.end())
         {
             if (filePaths.contains(*it))
+            {
                 it = d->allPicturesPath.erase(it);
+            }
             else
+            {
                 ++it;
         }
     }
+    }
 
 #endif
 
@@ -141,10 +145,14 @@
     {
         ImageInfo info((*it));
         if (info.category() != DatabaseItem::Image)
+        {
             it = d->allPicturesPath.erase(it);
+        }
         else
+        {
             ++it;
     }
+    }
 
     setMaximum(d->allPicturesPath.count());
 
@@ -159,13 +167,13 @@
 
 void BatchThumbsGenerator::processOne()
 {
-    if (d->cancel || d->allPicturesPath.isEmpty()) return;
+    if (d->cancel || d->allPicturesPath.isEmpty())
+    {
+        return;
+    }
 
     QString path = d->allPicturesPath.first();
-
-    if (d->rebuildAll)
         d->thumbLoadThread->deleteThumbnail(path);
-
     d->thumbLoadThread->find(path);
 }
 



More information about the Digikam-devel mailing list