From: Peter Penz Date: Sun, 6 May 2007 20:46:01 +0000 (+0000) Subject: optimization: don't try to show the meta information if the widget is invisible X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/44057746474840bdc983229ce02234ebe4f201d3?ds=sidebyside optimization: don't try to show the meta information if the widget is invisible svn path=/trunk/KDE/kdebase/apps/; revision=661864 --- diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp index 530d1fb30..d900945e8 100644 --- a/src/infosidebarpage.cpp +++ b/src/infosidebarpage.cpp @@ -130,6 +130,12 @@ void InfoSidebarPage::setSelection(const KFileItemList& selection) showItemInfo(); } +void InfoSidebarPage::showEvent(QShowEvent* event) +{ + SidebarPage::showEvent(event); + showItemInfo(); +} + void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url) { cancelRequest(); @@ -143,6 +149,10 @@ void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url) void InfoSidebarPage::showItemInfo() { + if (!isVisible()) { + return; + } + cancelRequest(); const KFileItemList& selectedItems = selection(); diff --git a/src/infosidebarpage.h b/src/infosidebarpage.h index ffa18d497..2a0f2ead7 100644 --- a/src/infosidebarpage.h +++ b/src/infosidebarpage.h @@ -63,6 +63,10 @@ public slots: virtual void setUrl(const KUrl& url); virtual void setSelection(const KFileItemList& selection); +protected: + /** @see QWidget::showEvent() */ + virtual void showEvent(QShowEvent* event); + private slots: /** * Does a delayed request of information for the item of the given Url and