The attached patch adds ftp support to the locations runner. I find it very 
annoying that I cannot run ftp connections my simply typing "ftp.kde.org" like 
I could in KDE 3.

Ok to commit to 4.2 and trunk?

Cheers,
Sebastian

Index: locationrunner.cpp
===================================================================
--- locationrunner.cpp	(revision 927493)
+++ locationrunner.cpp	(working copy)
@@ -57,7 +57,10 @@
         if (idx != -1) {
             url.setPath(term.mid(idx));
         }
-        url.setProtocol("http");
+        if (term.startsWith("ftp"))
+            url.setProtocol("ftp");
+        else
+            url.setProtocol("http");
     }
 }
 
@@ -108,7 +111,7 @@
         match.setData(url.url());
 
         if (KProtocolInfo::isHelperProtocol(url.protocol())) {
-            //kDebug() << "helper protocol" << url.protocol() <<"call external application" ; 
+            //kDebug() << "helper protocol" << url.protocol() <<"call external application" ;
             match.setText(i18n("Launch with %1", KProtocolInfo::exec(url.protocol())));
         } else {
             //kDebug() << "protocol managed by browser" << url.protocol();
@@ -145,7 +148,7 @@
     KUrl urlToRun(location);
 
     if ((type == Plasma::RunnerContext::NetworkLocation || type == Plasma::RunnerContext::UnknownType) &&
-        data.startsWith("http://";)) {
+        (data.startsWith("http://";) || data.startsWith("ftp://";))) {
         // the text may have changed while we were running, so we have to refresh
         // our content
         processUrl(urlToRun, location);
_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to