From: Arjun AK Date: Mon, 9 Feb 2015 12:31:56 +0000 (+0530) Subject: Construct URLs passed via cmdline args using QUrl::fromUserInput() X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/b86d0def3924391e90fc582f719447e2ecdfa014 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 --- 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; } }