optimization: don't try to show the meta information if the widget is invisible

svn path=/trunk/KDE/kdebase/apps/; revision=661864
This commit is contained in:
Peter Penz 2007-05-06 20:46:01 +00:00
parent cdcb4b0166
commit 4405774647
2 changed files with 14 additions and 0 deletions

View file

@ -130,6 +130,12 @@ void InfoSidebarPage::setSelection(const KFileItemList& selection)
showItemInfo(); showItemInfo();
} }
void InfoSidebarPage::showEvent(QShowEvent* event)
{
SidebarPage::showEvent(event);
showItemInfo();
}
void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url) void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url)
{ {
cancelRequest(); cancelRequest();
@ -143,6 +149,10 @@ void InfoSidebarPage::requestDelayedItemInfo(const KUrl& url)
void InfoSidebarPage::showItemInfo() void InfoSidebarPage::showItemInfo()
{ {
if (!isVisible()) {
return;
}
cancelRequest(); cancelRequest();
const KFileItemList& selectedItems = selection(); const KFileItemList& selectedItems = selection();

View file

@ -63,6 +63,10 @@ public slots:
virtual void setUrl(const KUrl& url); virtual void setUrl(const KUrl& url);
virtual void setSelection(const KFileItemList& selection); virtual void setSelection(const KFileItemList& selection);
protected:
/** @see QWidget::showEvent() */
virtual void showEvent(QShowEvent* event);
private slots: private slots:
/** /**
* Does a delayed request of information for the item of the given Url and * Does a delayed request of information for the item of the given Url and