Bug 121403

Summary: recalculate checksum should not ask for every missing image
Product: [Applications] kphotoalbum Reporter: Ferdinand Gassauer <gassauer>
Component: generalAssignee: KPhotoAlbum Bugs <kpabugs>
Status: RESOLVED FIXED    
Severity: normal CC: kpabugs
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ferdinand Gassauer 2006-02-05 09:40:49 UTC
Version:           SVN (using KDE 3.5.1, compiled sources)
Compiler:          Target: i586-suse-linux
OS:                Linux (i686) release 2.6.13-15.7-smp

for every image not on the disc any more a popup askes continue/cancel.

cancel does nothing (visible)

IMHO an option 
"Ignore all missing images"
should be introduced
(I have some thousend images removed - meening 1000 clicks to continue!!!)
Comment 1 Tuomas Suutari 2007-05-17 10:48:30 UTC
This problem is still present in 3.0.2.
Comment 2 Jan Kundrát 2007-08-09 20:51:16 UTC
SVN commit 698281 by jkt:

Don't warn about every file we can't read, rather give a summary afterwards
BUG: 121403


 M  +11 -4     NewImageFinder.cpp  


--- branches/extragear/kde3/graphics/kphotoalbum/DB/NewImageFinder.cpp #698280:698281
@@ -230,6 +230,7 @@
                                  "even when you have moved them on the disk.</p>").arg( list.count() ), i18n("&Cancel"), list.count() );
 
     int count = 0;
+    QStringList cantRead;
     bool dirty = false;
 
     for( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it, ++count ) {
@@ -244,7 +245,11 @@
                 return dirty;
             }
         }
+
         MD5 md5 = MD5Sum( *it );
+        if ( md5 == MD5() )
+            cantRead << *it;
+
         if  ( info->MD5Sum() != md5 ) {
             info->setMD5Sum( md5 );
             dirty = true;
@@ -255,16 +260,18 @@
     }
     if ( wasCanceled )
         *wasCanceled = false;
+
+    if ( !cantRead.empty() )
+        KMessageBox::informationList( 0, i18n("Following files could not be read:"), cantRead );
+
     return dirty;
 }
 
 MD5 NewImageFinder::MD5Sum( const QString& fileName )
 {
     QFile file( fileName );
-    if ( !file.open( IO_ReadOnly ) ) {
-        if ( KMessageBox::warningContinueCancel( 0, i18n("Could not open %1").arg( fileName ) ) == KMessageBox::No )
-            return MD5();
-    }
+    if ( !file.open( IO_ReadOnly ) )
+        return MD5();
 
     KMD5 md5calculator( 0 /* char* */);
     md5calculator.reset();