]> cloud.milkyroute.net Git - dolphin.git/commitdiff
reset the information panel if an item is shown that got deleted
authorPeter Penz <peter.penz19@gmail.com>
Tue, 3 Mar 2009 20:20:44 +0000 (20:20 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 3 Mar 2009 20:20:44 +0000 (20:20 +0000)
BUG: 186071

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

src/panels/information/informationpanel.cpp
src/panels/information/informationpanel.h

index 389fb4a52cfe88277fab1ab97a8960aacd15199a..b01524c4919dbdbbfd923d6012e4e95fdce71e42 100644 (file)
@@ -327,8 +327,7 @@ void InformationPanel::slotFilesRemoved(const QStringList& files)
         if (m_shownUrl == KUrl(fileName)) {
             // the currently shown item has been removed, show
             // the parent directory as fallback
-            m_shownUrl = url();
-            showItemInfo();
+            reset();
             break;
         }
     }
@@ -349,8 +348,7 @@ void InformationPanel::slotLeftDirectory(const QString& directory)
         // has been unmounted. In this case no directory change will be
         // done in Dolphin, but the Information Panel must be updated to
         // indicate an invalid directory.
-        m_shownUrl = url();
-        showItemInfo();
+        reset();
     }
 }
 
@@ -502,6 +500,14 @@ void InformationPanel::setNameLabelText(const QString& text)
     m_nameLabel->setText(wrappedText);
 }
 
+void InformationPanel::reset()
+{
+    m_selection.clear();
+    m_shownUrl = url();
+    m_fileItem = KFileItem();
+    showItemInfo();
+}
+
 void InformationPanel::init()
 {
     const int spacing = KDialog::spacingHint();
index 08eb302995bf5ea05cd073da6e57e3088c2ca51c..997ba69bf65ac24fa4267458f30c6b81ee675495 100644 (file)
@@ -171,6 +171,12 @@ private:
      */
     void setNameLabelText(const QString& text);
 
+    /**
+     * Resets the information panel to show the current
+     * URL (InformationPanel::url()).
+     */
+    void reset();
+
     void init();
 
 private: