From: Peter Penz Date: Tue, 3 Mar 2009 20:20:44 +0000 (+0000) Subject: reset the information panel if an item is shown that got deleted X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/d98f9c673b2f7eb31012ccef98dc8167630ccf1b?ds=sidebyside reset the information panel if an item is shown that got deleted BUG: 186071 svn path=/trunk/KDE/kdebase/apps/; revision=934807 --- 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: