Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > media > main-updates-src > by-pkgid > b489161e8179a429b4f3255503fcb3d7 > files > 2

gwenview-1.4.1-5.1mdv2007.1.src.rpm

Index: document.cpp
===================================================================
--- document.cpp	(revisione 617282)
+++ document.cpp	(copia locale)
@@ -480,6 +480,8 @@
 	QString msg=saveInternal(url(), d->mImageFormat);
 	if (!msg.isNull()) {
 		KMessageBox::error(dialogParentWidget(), msg);
+		// If it can't be saved we leave it as modified, because user
+		// could choose to save it to another path with saveAs
 	}
 }
 
@@ -493,6 +495,8 @@
 
 	QString msg=saveInternal(saveURL, dialog.imageFormat() );
 	if (!msg.isNull()) {
+		// If it can't be saved we leave it as modified, because user
+		// could choose a wrong readonly path from dialog and retry to
 		KMessageBox::error(dialogParentWidget(), msg);
 	}
 }
@@ -508,6 +512,10 @@
 
 	if (result == KMessageBox::Yes) {
 		saveInternal(url(), d->mImageFormat);	
+		// If it can't be saved it's useless to leave it as modified
+		// since user is closing this image and changing to another one
+		d->mModified=false;
+		//FIXME it should be nice to tell the user it failed
 	} else {
 		d->mModified=false;
 	}