[Digikam-devel] [Bug 111873] Modifying and then navigating in the thumbbar does not update photo thumbnail
Gilles Caulier
caulier.gilles at free.fr
Wed Sep 7 08:31:07 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=111873
------- Additional Comments From caulier.gilles free fr 2005-09-07 09:31 -------
SVN commit 458078 by cgilles:
showfoto BugFix :
- Refresh the right item to save/saveas properly in showfoto thumbbar. Using a new method in thumbbar.cpp to find item by url.
- Don't prompt user about to save image after to do SaveAs operation.
CCBUG: 111873
M +16 -0 libs/thumbbar/thumbbar.cpp
M +1 -0 libs/thumbbar/thumbbar.h
M +9 -16 showfoto/showfoto.cpp
--- trunk/extragear/graphics/digikam/libs/thumbbar/thumbbar.cpp #458077:458078
@ -170,8 +170,24 @
return 0;
}
+ThumbBarItem* ThumbBarView::findItemByURL(const KURL& url) const
+{
+ for (ThumbBarItem *item = d->firstItem; item; item = item->m_next)
+ {
+ if (item->url().equals(url))
+ {
+ return item;
+ }
+ }
+
+ return 0;
+}
+
void ThumbBarView::setSelected(ThumbBarItem* item)
{
+ if (!item)
+ return;
+
if (d->currItem == item)
return;
--- trunk/extragear/graphics/digikam/libs/thumbbar/thumbbar.h #458077:458078
@ -62,6 +62,7 @
ThumbBarItem* firstItem() const;
ThumbBarItem* lastItem() const;
ThumbBarItem* findItem(const QPoint& pos) const;
+ ThumbBarItem* findItemByURL(const KURL& url) const;
void invalidateThumb(ThumbBarItem* item);
--- trunk/extragear/graphics/digikam/showfoto/showfoto.cpp #458077:458078
@ -764,25 +764,19 @
::unlink(QFile::encodeName(tmpFile));
return;
}
+
+ m_saveAction->setEnabled(false);
// add the file to the list of images if it's not there already
- Digikam::ThumbBarItem* foundItem = 0;
- for (Digikam::ThumbBarItem *item = m_bar->firstItem(); item; item = item->next())
+ Digikam::ThumbBarItem* item = m_bar->findItemByURL(saveAsURL);
+ m_bar->invalidateThumb(item);
+
+ if (!item)
{
- if (item->url().equals(saveAsURL))
- {
- foundItem = item;
- m_bar->invalidateThumb(item);
- break;
- }
+ item = new Digikam::ThumbBarItem(m_bar, saveAsURL);
}
- if (!foundItem)
- {
- foundItem = new Digikam::ThumbBarItem(m_bar, saveAsURL);
- }
-
- m_bar->setSelected(foundItem);
+ m_bar->setSelected(item);
kapp->restoreOverrideCursor();
}
@ -871,8 +865,7 @
}
m_canvas->setModified( false );
- slotOpenURL(m_currentItem->url());
- m_bar->invalidateThumb(m_currentItem);
+ m_bar->invalidateThumb(m_bar->findItemByURL(url));
kapp->restoreOverrideCursor();
return true;
More information about the Digikam-devel
mailing list