[Digikam-devel] [Bug 112000] Crash when overwriting images which are displayed in the thumbnail list
Joern Ahrens
joern.ahrens at kdemail.net
Fri Sep 9 11:49:33 BST 2005
------- 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=112000
joern.ahrens kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From joern.ahrens kdemail net 2005-09-09 12:49 -------
SVN commit 458915 by jahrens:
When an image was saved with "Save As" with a filename that already existed in
the album, the new ImageInfo was first created through signalNewFilteredItems
but deleted through signalDeleteFilteredItem for the old image - because
both used the same filename.
BUG: 112000
M +19 -5 digikam/albumiconview.cpp
M +1 -0 digikam/albumlister.cpp
M +7 -1 utilities/imageeditor/imagewindow.cpp
--- trunk/extragear/graphics/digikam/digikam/albumiconview.cpp #458914:458915
@ -315,6 +315,14 @
ImageInfo* item;
for (ImageInfoListIterator it(itemList); (item = it.current()); ++it)
{
+ KURL url( item->kurl() );
+ url.cleanPath();
+
+ if (AlbumIconItem *oldItem = d->itemDict.find(url.url()))
+ {
+ slotImageListerDeleteItem(oldItem->imageInfo());
+ }
+
AlbumIconGroupItem* group = d->albumDict.find(item->albumID());
if (!group)
{
@ -332,8 +340,6 @
AlbumIconItem* iconItem = new AlbumIconItem(group, item);
item->setViewItem(iconItem);
- KURL url( item->kurl() );
- url.cleanPath();
d->itemDict.insert(url.url(), iconItem);
}
@ -347,6 +353,16 @
AlbumIconItem* iconItem = static_cast<AlbumIconItem*>(item->getViewItem());
+ KURL url(item->kurl());
+ url.cleanPath();
+
+ AlbumIconItem *oldItem = d->itemDict[url.url()];
+ if( oldItem &&
+ (oldItem->imageInfo()->id() != iconItem->imageInfo()->id()))
+ {
+ return;
+ }
+
d->pixMan->remove(item->kurl());
emit signalItemDeleted(iconItem);
@ -354,9 +370,7 @
delete iconItem;
item->setViewItem(0);
- KURL u(item->kurl());
- u.cleanPath();
- d->itemDict.remove(u.url());
+ d->itemDict.remove(url.url());
IconGroupItem* group = firstGroup();
IconGroupItem* tmp;
--- trunk/extragear/graphics/digikam/digikam/albumlister.cpp #458914:458915
@ -120,6 +120,7 @
ds << d->filter;
ds << AlbumSettings::instance()->getIconShowResolution();
+ // Protocol = digikamalbums -> kio_digikamalbums
d->job = new KIO::TransferJob(album->kurl(), KIO::CMD_SPECIAL,
ba, QByteArray(), false);
connect(d->job, SIGNAL(result(KIO::Job*)),
--- trunk/extragear/graphics/digikam/utilities/imageeditor/imagewindow.cpp #458914:458915
@ -1071,6 +1071,7 @
// Check for overwrite ----------------------------------------------------------
QFileInfo fi(newURL.path());
+ bool fileExists = false;
if ( fi.exists() )
{
int result =
@ -1086,6 +1087,8 @
if (result != KMessageBox::Yes)
return;
+
+ fileExists = true;
}
// Now do the actual saving -----------------------------------------------------
@ -1176,7 +1179,10 @
m_urlCurrent = newURL;
}
- emit signalFileAdded(newURL);
+ if(fileExists)
+ emit signalFileModified(newURL);
+ else
+ emit signalFileAdded(newURL);
m_canvas->setModified( false );
kapp->restoreOverrideCursor();
More information about the Digikam-devel
mailing list