┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/panels/information
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2010-10-07 14:09:30 +0000
committerPeter Penz <[email protected]>2010-10-07 14:09:30 +0000
commit431da0482caa72f90a6a04785383eb1d133f678e (patch)
treef5f670aefb220aa5f735de6b3cf2c9b859f0b7aa /src/panels/information
parent06b0569613e918e5f73d762a54df041a38385195 (diff)
Internal cleanup for panels: Let the panel-implementations decide whether they accept an URL or not.
svn path=/trunk/KDE/kdebase/apps/; revision=1183480
Diffstat (limited to 'src/panels/information')
-rw-r--r--src/panels/information/informationpanel.cpp37
-rw-r--r--src/panels/information/informationpanel.h6
-rw-r--r--src/panels/information/informationpanelcontent.cpp4
-rw-r--r--src/panels/information/informationpanelcontent.h9
4 files changed, 28 insertions, 28 deletions
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);
diff --git a/src/panels/information/informationpanel.h b/src/panels/information/informationpanel.h
index e0768bc1b..abd7ed811 100644
--- a/src/panels/information/informationpanel.h
+++ b/src/panels/information/informationpanel.h
@@ -42,9 +42,6 @@ signals:
void urlActivated(const KUrl& url);
public slots:
- /** @see Panel::setUrl() */
- virtual void setUrl(const KUrl& url);
-
/**
* This is invoked to inform the panel that the user has selected a new
* set of items.
@@ -60,6 +57,9 @@ public slots:
void requestDelayedItemInfo(const KFileItem& item);
protected:
+ /** @see Panel::urlChanged() */
+ virtual bool urlChanged();
+
/** @see QWidget::showEvent() */
virtual void showEvent(QShowEvent* event);
diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp
index 3b9a17960..b6a41ca3d 100644
--- a/src/panels/information/informationpanelcontent.cpp
+++ b/src/panels/information/informationpanelcontent.cpp
@@ -55,7 +55,7 @@
#include "pixmapviewer.h"
InformationPanelContent::InformationPanelContent(QWidget* parent) :
- Panel(parent),
+ QWidget(parent),
m_item(),
m_pendingPreview(false),
m_outdatedPreviewTimer(0),
@@ -262,7 +262,7 @@ bool InformationPanelContent::eventFilter(QObject* obj, QEvent* event)
break;
}
- return Panel::eventFilter(obj, event);
+ return QWidget::eventFilter(obj, event);
}
void InformationPanelContent::configureSettings()
diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h
index cb712627d..f918b8582 100644
--- a/src/panels/information/informationpanelcontent.h
+++ b/src/panels/information/informationpanelcontent.h
@@ -1,5 +1,5 @@
/***************************************************************************
- * Copyright (C) 2009 by Peter Penz <[email protected]> *
+ * Copyright (C) 2009-2010 by Peter Penz <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
@@ -20,13 +20,12 @@
#ifndef INFORMATIONPANELCONTENT_H
#define INFORMATIONPANELCONTENT_H
-#include <panels/panel.h>
-
#include <kconfig.h>
+#include <kfileitem.h>
#include <kurl.h>
#include <kvbox.h>
-class KFileItem;
+class KFileItemList;
class KFileMetaDataWidget;
class PhononWidget;
class PixmapViewer;
@@ -39,7 +38,7 @@ class QScrollArea;
* @brief Manages the widgets that display the meta information
* for file items of the Information Panel.
*/
-class InformationPanelContent : public Panel
+class InformationPanelContent : public QWidget
{
Q_OBJECT