[cli] Always take working dir into account when parsing url

Summary:
Bug: 399115

When using kdeconnect-cli --share the first argument was not recognised as a file when a relative path was specified.

Test Plan:
kdeconnect-cli --share File1.txt File2.txt : Check that both files are sent
kdeconnect-cli --sahre phabricator.kde.org : Check that web page is opend

Reviewers: #kde_connect, apol

Reviewed By: #kde_connect, apol

Subscribers: apol, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D15787
This commit is contained in:
Nicolas Fella 2018-09-28 15:12:17 +02:00
parent e9323452ca
commit 518251342c

View file

@ -148,7 +148,7 @@ int main(int argc, char** argv)
if (parser.isSet(QStringLiteral("share"))) { if (parser.isSet(QStringLiteral("share"))) {
QList<QUrl> urls; QList<QUrl> urls;
QUrl url = QUrl::fromUserInput(parser.value(QStringLiteral("share"))); QUrl url = QUrl::fromUserInput(parser.value(QStringLiteral("share")), QDir::currentPath());
urls.append(url); urls.append(url);
//In case there are more arguments, check if they are files and then send them //In case there are more arguments, check if they are files and then send them