]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fixed issue that the Information Panel might show the old filename after renaming...
authorPeter Penz <peter.penz19@gmail.com>
Thu, 7 Jan 2010 20:14:43 +0000 (20:14 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Thu, 7 Jan 2010 20:14:43 +0000 (20:14 +0000)
Added implementation note, as a working code had been removed some time ago because of a performance bottleneck.

BUG: 198375

svn path=/trunk/KDE/kdebase/apps/; revision=1071287

src/panels/information/informationpanel.cpp

index 1f8e3b5413aedaafdfe45819c24a34edfb7e6eda..82b52e4f65536c96dbb26e2c56cf7a80cebb9c92 100644 (file)
@@ -205,6 +205,15 @@ void InformationPanel::slotFileRenamed(const QString& source, const QString& des
     if (m_shownUrl == KUrl(source)) {
         m_shownUrl = KUrl(dest);
         m_fileItem = KFileItem(KFileItem::Unknown, KFileItem::Unknown, m_shownUrl);
+
+        if ((m_selection.count() == 1) && (m_selection[0].url() == KUrl(source))) {
+            m_selection[0] = m_fileItem;
+            // Implementation note: Updating the selection is only required if exactly one
+            // item is selected, as the name of the item is shown. If this should change
+            // in future: Before parsing the whole selection take care to test possible
+            // performance bottlenecks when renaming several hundreds of files.
+        }
+
         showItemInfo();
     }
 }