┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information/informationpanel.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-03-10 07:44:56 +0000
committerPeter Penz <[email protected]>2009-03-10 07:44:56 +0000
commit69cb2c5db60909817f720fff2c2032b96fffc9e1 (patch)
treeba3860b32632b1f70f670d0c43d81aa6fd6e1177 /src/panels/information/informationpanel.cpp
parent7697cad99fcd96be31f0fb7633f8e32cd4f37f10 (diff)
Fixed issue that when renaming an item that still the old item name will be shown in the Information Panel.
CCBUG: 181534 CCBUG: 186071 svn path=/trunk/KDE/kdebase/apps/; revision=937630
Diffstat (limited to 'src/panels/information/informationpanel.cpp')
-rw-r--r--src/panels/information/informationpanel.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp
index 2f395a4c4..adf53348f 100644
--- a/src/panels/information/informationpanel.cpp
+++ b/src/panels/information/informationpanel.cpp
@@ -313,11 +313,26 @@ void InformationPanel::showPreview(const KFileItem& item,
void InformationPanel::slotFileRenamed(const QString& source, const QString& dest)
{
- if (m_shownUrl == KUrl(source)) {
- // the currently shown file has been renamed, hence update the item information
- // for the renamed file
- KFileItem item(KFileItem::Unknown, KFileItem::Unknown, KUrl(dest));
- requestDelayedItemInfo(item);
+ const KUrl sourceUrl = KUrl(source);
+
+ // Verify whether the renamed item is selected. If this is the case, the
+ // selection must be updated with the renamed item.
+ bool isSelected = false;
+ for (int i = m_selection.size() - 1; i >= 0; --i) {
+ if (m_selection[i].url() == sourceUrl) {
+ m_selection.removeAt(i);
+ isSelected = true;
+ break;
+ }
+ }
+
+ if ((m_shownUrl == sourceUrl) || isSelected) {
+ m_shownUrl = KUrl(dest);
+ m_fileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl);
+ if (isSelected) {
+ m_selection.append(m_fileItem);
+ }
+ showItemInfo();
}
}