]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinviewcontainer.cpp
use a smaller step size when using the scroll wheel
[dolphin.git] / src / dolphinviewcontainer.cpp
index ad79d6bb1132aa4083ba82394506827d2bee3b54..6e5385f5e4dd748bd9a890c79e0fa49b87ea4c8a 100644 (file)
@@ -42,6 +42,7 @@
 #include <konq_fileitemcapabilities.h>
 #include <konq_operations.h>
 #include <kurl.h>
+#include <krun.h>
 
 #include "dolphinmodel.h"
 #include "dolphincolumnview.h"
@@ -354,10 +355,24 @@ void DolphinViewContainer::restoreView(const KUrl& url)
 {
     if (KProtocolManager::supportsListing(url)) {
         m_view->updateView(url, m_urlNavigator->savedRootUrl());
+    } else if (KProtocolManager::isSourceProtocol(url)) {
+        QString app = "konqueror";
+        if (url.protocol().startsWith(QLatin1String("http"))) {
+            showErrorMessage(i18nc("@info:status",
+                                   "Dolphin does not support web pages, the web browser has been launched"));
+            const KConfigGroup config(KSharedConfig::openConfig("kdeglobals"), "General");
+            const QString browser = config.readEntry("BrowserApplication");
+            if (!browser.isEmpty()) {
+                app = browser;
+            }
+        } else {
+            showErrorMessage(i18nc("@info:status",
+                                   "Protocol not supported by Dolphin, Konqueror has been launched"));        
+        }
+        const QString command = app + ' ' + url.pathOrUrl();
+        KRun::runCommand(command, app, app, this);
     } else {
-        // The URL navigator only checks for validity, not
-        // if the URL can be listed. 
-        showErrorMessage(i18nc("@info:status", "Protocol not supported"));        
+        showErrorMessage(i18nc("@info:status", "Invalid protocol"));
     }
 }
 
@@ -369,7 +384,7 @@ void DolphinViewContainer::saveRootUrl(const KUrl& url)
 
 void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event)
 {
-    DragAndDropHelper::dropUrls(KFileItem(), destination, event, this);
+    DragAndDropHelper::instance().dropUrls(KFileItem(), destination, event, this);
 }
 
 void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)