From 431da0482caa72f90a6a04785383eb1d133f678e Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Thu, 7 Oct 2010 14:09:30 +0000 Subject: Internal cleanup for panels: Let the panel-implementations decide whether they accept an URL or not. svn path=/trunk/KDE/kdebase/apps/; revision=1183480 --- src/panels/information/informationpanel.cpp | 37 +++++++++++++++-------------- 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'src/panels/information/informationpanel.cpp') diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index c18cc7fdb..d45974a48 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -52,24 +52,6 @@ QSize InformationPanel::sizeHint() const return size; } -void InformationPanel::setUrl(const KUrl& url) -{ - Panel::setUrl(url); - if (!url.isValid() || isEqualToShownUrl(url)) { - return; - } - - m_shownUrl = url; - if (isVisible()) { - cancelRequest(); - // Update the content with a delay. This gives - // the directory lister the chance to show the content - // before expensive operations are done to show - // meta information. - m_urlChangedTimer->start(); - } -} - void InformationPanel::setSelection(const KFileItemList& selection) { if (!isVisible()) { @@ -126,6 +108,25 @@ void InformationPanel::requestDelayedItemInfo(const KFileItem& item) } } +bool InformationPanel::urlChanged() +{ + if (!url().isValid() || isEqualToShownUrl(url())) { + return false; + } + + m_shownUrl = url(); + if (isVisible()) { + cancelRequest(); + // Update the content with a delay. This gives + // the directory lister the chance to show the content + // before expensive operations are done to show + // meta information. + m_urlChangedTimer->start(); + } + + return true; +} + void InformationPanel::showEvent(QShowEvent* event) { Panel::showEvent(event); -- cgit v1.3