[Digikam-devel] [Bug 138620] Saving a picture destroy another picture
Marcel Wiesweg
marcel.wiesweg at gmx.de
Sun Dec 10 15:00:12 GMT 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=138620
marcel.wiesweg gmx de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From marcel.wiesweg gmx de 2006-12-10 16:00 -------
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;
More information about the Digikam-devel
mailing list