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
This commit is contained in:
Arjun AK 2015-02-09 18:01:56 +05:30
parent f67bdd0fb7
commit b86d0def39

View 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;
}
}