┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Trueg <[email protected]>2009-11-25 20:53:37 +0000
committerSebastian Trueg <[email protected]>2009-11-25 20:53:37 +0000
commitd324e790d62c8a341abd06e845f8fe8d64aa8ef3 (patch)
tree6f3a675cba11e6d5543875e06ba720742a6563a3
parent482fea3ec69a7fff321281050968426c38edc3bc (diff)
* Fixed execution of links in the metadata widget.
* Do not try to list non-listable URLs. svn path=/trunk/KDE/kdebase/apps/; revision=1054300
-rw-r--r--src/dolphinmainwindow.cpp12
-rw-r--r--src/dolphinmainwindow.h8
-rw-r--r--src/panels/information/informationpanelcontent.h3
3 files changed, 21 insertions, 2 deletions
diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp
index 6e2b81390..ebc8dc268 100644
--- a/src/dolphinmainwindow.cpp
+++ b/src/dolphinmainwindow.cpp
@@ -1370,7 +1370,7 @@ void DolphinMainWindow::setupDockWidgets()
infoDock->setObjectName("infoDock");
infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
Panel* infoPanel = new InformationPanel(infoDock);
- connect(infoPanel, SIGNAL(urlActivated(KUrl)), activeViewContainer(), SLOT(setUrl(KUrl)));
+ connect(infoPanel, SIGNAL(urlActivated(KUrl)), this, SLOT(handleUrl(KUrl)));
infoDock->setWidget(infoPanel);
QAction* infoAction = infoDock->toggleViewAction();
@@ -1660,6 +1660,16 @@ void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
setCaption(caption);
}
+void DolphinMainWindow::handleUrl(const KUrl& url)
+{
+ if (KProtocolManager::supportsListing(url)) {
+ activeViewContainer()->setUrl(url);
+ }
+ else {
+ new KRun(url, this);
+ }
+}
+
QString DolphinMainWindow::squeezedText(const QString& text) const
{
const QFontMetrics fm = fontMetrics();
diff --git a/src/dolphinmainwindow.h b/src/dolphinmainwindow.h
index e9332194f..0b4f90d19 100644
--- a/src/dolphinmainwindow.h
+++ b/src/dolphinmainwindow.h
@@ -406,6 +406,12 @@ private slots:
*/
void showSearchOptions();
+ /**
+ * If the URL can be listed open it in the current view, otherwise
+ * run it through KRun.
+ */
+ void handleUrl(const KUrl& url);
+
private:
DolphinMainWindow(int id);
void init();
@@ -460,7 +466,7 @@ private:
QString tabProperty(const QString& property, int tabIndex) const;
/**
- * Sets the window caption to url.fileName() if this is non-empty,
+ * Sets the window caption to url.fileName() if this is non-empty,
* "/" if the URL is "file:///", and url.protocol() otherwise.
*/
void setUrlAsCaption(const KUrl& url);
diff --git a/src/panels/information/informationpanelcontent.h b/src/panels/information/informationpanelcontent.h
index 6c08e50d2..923bb762f 100644
--- a/src/panels/information/informationpanelcontent.h
+++ b/src/panels/information/informationpanelcontent.h
@@ -67,6 +67,9 @@ public:
*/
void configureSettings();
+signals:
+ void urlActivated( const KUrl& url );
+
protected:
/** @see QObject::eventFilter() */
virtual bool eventFilter(QObject* obj, QEvent* event);