From kde-commits Sat Jun 30 22:31:54 2007 From: =?utf-8?q?Jan=20Kundr=C3=A1t?= Date: Sat, 30 Jun 2007 22:31:54 +0000 To: kde-commits Subject: branches/extragear/kde3/graphics/kphotoalbum/MainWindow Message-Id: <1183242714.357528.31351.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=118324272402324 SVN commit 681936 by jkt: make DeleteDialog's behave "sane and expected" again (fixes issue reported by Sujee Maniyam on the ML ) M +15 -6 DeleteDialog.cpp --- branches/extragear/kde3/graphics/kphotoalbum/MainWindow/DeleteDialog.cpp #681935:681936 @@ -56,6 +56,14 @@ return KDialogBase::exec(); } +/* + * Delete selected images from disk. Supports two modes: + * + * a) Deleting physical files, files that can't be removed (no permission, not + * available right now,...) are left untouched. + * b) Blocking from database -- we don't care whether the real file is + * availabel, we just punt it from the database. + */ void DeleteDialog::deleteImages() { Utilities::ShowBusyCursor dummy; @@ -64,15 +72,16 @@ QStringList listCouldNotDelete; for( QStringList::const_iterator it = _list.constBegin(); it != _list.constEnd(); ++it ) { - if ( DB::ImageInfo::imageOnDisk(*it) ) { - if ( _delete_file->isChecked() && ( !QFile( *it ).exists() || !QFile( *it ).remove() ) ) { - listCouldNotDelete.append (*it ); - } else { + if ( _delete_file->isChecked() ) + if ( DB::ImageInfo::imageOnDisk(*it) && QFile( *it ).exists() && QFile( *it ).remove() ) { listToDelete.append( *it ); Utilities::removeThumbNail( *it ); + } else { + listCouldNotDelete.append( *it ); } - } else { - listCouldNotDelete.append( *it ); + else { + listToDelete.append( *it ); + Utilities::removeThumbNail( *it ); } }