]> 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 3c1445fa5a07f356eaf89ebbe984dddf8f6ee5d2..6e5385f5e4dd748bd9a890c79e0fa49b87ea4c8a 100644 (file)
 #include <konq_fileitemcapabilities.h>
 #include <konq_operations.h>
 #include <kurl.h>
+#include <krun.h>
 
 #include "dolphinmodel.h"
 #include "dolphincolumnview.h"
 #include "dolphincontroller.h"
-#include "dolphindropcontroller.h"
 #include "dolphinstatusbar.h"
 #include "dolphinmainwindow.h"
 #include "dolphindirlister.h"
@@ -54,6 +54,7 @@
 #include "dolphindetailsview.h"
 #include "dolphiniconsview.h"
 #include "dolphincontextmenu.h"
+#include "draganddrophelper.h"
 #include "filterbar.h"
 #include "kurlnavigator.h"
 #include "viewproperties.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)
 {
-    DolphinDropController::dropUrls(KFileItem(), destination, event, this);
+    DragAndDropHelper::instance().dropUrls(KFileItem(), destination, event, this);
 }
 
 void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)