Summary: | Saving a picture destroy another picture | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Laurent COOPER <laurent.cooper> |
Component: | ImageEditor-Save | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | critical | CC: | caulier.gilles, victor.trac |
Priority: | VHI | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.0 | |
Sentry Crash Report: |
Description
Laurent COOPER
2006-12-10 12:21:47 UTC
Bug is more critical than first tought... Edit picture A Click on picture B "do you want to save picture B?" CANCEL (to avoid the bug) then, having a look on editor, the picture is still named picture A. Click on the save button Normally, should be saved as A picture... => the picture is saved as B picture, B picture utterly destroyed! Gasp :( Marcel, This file must be fixed before 0.9.0-final release Gilles SVN commit 612235 by mwiesweg: Call promptUserSave _before_ changing variables, namely d->urlCurrent. BUG: 138620 M +2 -1 NEWS M +16 -4 utilities/imageeditor/editor/imagewindow.cpp --- trunk/extragear/graphics/digikam/NEWS #612234:612235 @@ -368,6 +368,7 @@ 216 ==> 137770 : digiKam doesn't keep original unix rights when modifying comments/tags/rating. 217 ==> 133091 : Changing date/time with numblock changes also the orientation. 218 ==> 137993 : Importing photos into albums results in time/date file override with current one. -219 ==> +219 ==> 138620 : Saving a picture destroy another picture +220 ==> ---------------------------------------------------------------------------------------------------- --- trunk/extragear/graphics/digikam/utilities/imageeditor/editor/imagewindow.cpp #612234:612235 @@ -380,6 +380,9 @@ void ImageWindow::loadURL(const KURL::List& urlList, const KURL& urlCurrent, const QString& caption, bool allowSaving, AlbumIconView* view) { + if (!promptUserSave(d->urlCurrent)) + return; + d->urlList = urlList; d->urlCurrent = urlCurrent; d->imageInfoList = ImageInfoList(); @@ -391,7 +394,19 @@ void ImageWindow::loadImageInfos(const ImageInfoList &imageInfoList, ImageInfo *imageInfoCurrent, const QString& caption, bool allowSaving, AlbumIconView* view) { - // the ownership of the list's objects is passed to us + // The ownership of objects of imageInfoList is passed to us. + // imageInfoCurrent is contained in imageInfoList. + + // Very first thing is to check for changes, user may choose to cancel operation + if (!promptUserSave(d->urlCurrent)) + { + // delete objects from list + for (ImageInfoList::iterator it = imageInfoList.begin(); it != imageInfoList.end(); ++it) + delete *it; + return; + } + + // take over ImageInfo list d->imageInfoList = imageInfoList; d->imageInfoCurrent = imageInfoCurrent; @@ -422,9 +437,6 @@ KWin::deIconifyWindow(winId()); } - if (!promptUserSave(d->urlCurrent)) - return; - setCaption(i18n("digiKam Image Editor - %1").arg(caption)); d->view = view; *** Bug 139075 has been marked as a duplicate of this bug. *** |