]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Construct URLs passed via cmdline args using QUrl::fromUserInput()
authorArjun AK <arjunak234@gmail.com>
Mon, 9 Feb 2015 12:31:56 +0000 (18:01 +0530)
committerArjun AK <arjunak234@gmail.com>
Mon, 9 Feb 2015 12:45:37 +0000 (18:15 +0530)
Otherwise user will have to type "dolphin file:///tmp" instead of
"dolphin /tmp"

REVIEW: 122475
BUG: 343906

src/main.cpp

index 094402f9044d81e6b7fcfbe9d6a91f107477dd30..3219383234c3c3e9111f0db661d0e26b0042da43 100644 (file)
@@ -105,9 +105,11 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv)
     QList<QUrl> urls;
     const QStringList args = parser.positionalArguments();
     foreach (const QString& str,  args) {
-        const QUrl url(str);
+        const QUrl url = QUrl::fromUserInput(str);
         if (url.isValid()) {
             urls.append(url);
+        } else {
+            qWarning() << "Invalid URL: " << str;
         }
     }