┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2009-03-03 20:20:44 +0000
committerPeter Penz <[email protected]>2009-03-03 20:20:44 +0000
commitd98f9c673b2f7eb31012ccef98dc8167630ccf1b (patch)
tree293843698190aa4fd502bec1dbfcbe1ed7a16dcb /src
parent0801e50cfd52720577e40c28e576fe4a9baebc4b (diff)
reset the information panel if an item is shown that got deleted
BUG: 186071 svn path=/trunk/KDE/kdebase/apps/; revision=934807
Diffstat (limited to 'src')
-rw-r--r--src/panels/information/informationpanel.cpp14
-rw-r--r--src/panels/information/informationpanel.h6
2 files changed, 16 insertions, 4 deletions
diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp
index 389fb4a52..b01524c49 100644
--- a/src/panels/information/informationpanel.cpp
+++ b/src/panels/information/informationpanel.cpp
@@ -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();
diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h
index 08eb30299..997ba69bf 100644
--- a/src/panels/information/informationpanel.h
+++ b/src/panels/information/informationpanel.h
@@ -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: