From b86d0def3924391e90fc582f719447e2ecdfa014 Mon Sep 17 00:00:00 2001 From: Arjun AK Date: Mon, 9 Feb 2015 18:01:56 +0530 Subject: [PATCH] Construct URLs passed via cmdline args using QUrl::fromUserInput() Otherwise user will have to type "dolphin file:///tmp" instead of "dolphin /tmp" REVIEW: 122475 BUG: 343906 --- src/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index 094402f90..321938323 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -105,9 +105,11 @@ extern "C" Q_DECL_EXPORT int kdemain(int argc, char **argv) QList 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; } }