]> cloud.milkyroute.net Git - dolphin.git/commitdiff
* Fixed execution of links in the metadata widget.
authorSebastian Trueg <sebastian@trueg.de>
Wed, 25 Nov 2009 20:53:37 +0000 (20:53 +0000)
committerSebastian Trueg <sebastian@trueg.de>
Wed, 25 Nov 2009 20:53:37 +0000 (20:53 +0000)
* Do not try to list non-listable URLs.

svn path=/trunk/KDE/kdebase/apps/; revision=1054300

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h
src/panels/information/informationpanelcontent.h

index 6e2b81390cd5e4f3b13c1dbdfd3c8925abc910a8..ebc8dc2683f5106a476328476526de730947555c 100644 (file)
@@ -1370,7 +1370,7 @@ void DolphinMainWindow::setupDockWidgets()
     infoDock->setObjectName("infoDock");
     infoDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
     Panel* infoPanel = new InformationPanel(infoDock);
     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();
     infoDock->setWidget(infoPanel);
 
     QAction* infoAction = infoDock->toggleViewAction();
@@ -1660,6 +1660,16 @@ void DolphinMainWindow::setUrlAsCaption(const KUrl& url)
     setCaption(caption);
 }
 
     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();
 QString DolphinMainWindow::squeezedText(const QString& text) const
 {
     const QFontMetrics fm = fontMetrics();
index e9332194f544cc1e1b039036f9eec1e13c5b3e1a..0b4f90d19fe806755e82cde6cb413d7d454d0277 100644 (file)
@@ -406,6 +406,12 @@ private slots:
      */
     void showSearchOptions();
 
      */
     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();
 private:
     DolphinMainWindow(int id);
     void init();
@@ -460,7 +466,7 @@ private:
     QString tabProperty(const QString& property, int tabIndex) const;
 
     /**
     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);
      * "/" if the URL is "file:///", and url.protocol() otherwise.
      */
     void setUrlAsCaption(const KUrl& url);
index 6c08e50d2e91ad1c42b68cb9ad05ced0ff3c53d8..923bb762f637ed96999ab56e49572b14576bc032 100644 (file)
@@ -67,6 +67,9 @@ public:
      */
     void configureSettings();
 
      */
     void configureSettings();
 
+signals:
+    void urlActivated( const KUrl& url );
+
 protected:
     /** @see QObject::eventFilter() */
     virtual bool eventFilter(QObject* obj, QEvent* event);
 protected:
     /** @see QObject::eventFilter() */
     virtual bool eventFilter(QObject* obj, QEvent* event);