]> cloud.milkyroute.net Git - dolphin.git/commitdiff
optimization: don't try to show the meta information if the widget is invisible
authorPeter Penz <peter.penz19@gmail.com>
Sun, 6 May 2007 20:46:01 +0000 (20:46 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sun, 6 May 2007 20:46:01 +0000 (20:46 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=661864

src/infosidebarpage.cpp
src/infosidebarpage.h

index 530d1fb307c4210616466fc7d854b390d75861f5..d900945e870eb4e085368f166155a7a0f053cb58 100644 (file)
@@ -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();
index ffa18d497164455aa1f1242e736f7d9281f0ade2..2a0f2ead73e426ae77497eaa28758997d7144a7b 100644 (file)
@@ -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