| Summary: | recalculate checksum should not ask for every missing image | ||
|---|---|---|---|
| Product: | [Applications] kphotoalbum | Reporter: | Ferdinand Gassauer <gassauer> |
| Component: | general | Assignee: | KPhotoAlbum Bugs <kphotoalbum-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | kphotoalbum-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Ferdinand Gassauer
2006-02-05 09:40:49 UTC
This problem is still present in 3.0.2. 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();
|