summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2017-01-13 12:59:16 +0100
committerAleix Pol <[email protected]>2017-01-13 12:59:56 +0100
commit75852aee7a8e40a951567bf8803c08a6f273504a (patch)
tree3ea113f85e9c9290a1fb7e1236b25ae4109c12e2
parent2a864687bf5b9207aaeedbfeae79c0c0ab56b784 (diff)
Properly process Discover positional arguments
If it's a local file, assume it's a local package
-rw-r--r--discover/main.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/discover/main.cpp b/discover/main.cpp
index edd5d9d..53267cf 100644
--- a/discover/main.cpp
+++ b/discover/main.cpp
@@ -74,7 +74,11 @@ void processArgs(QCommandLineParser* parser, DiscoverMainWindow* mainWindow)
mainWindow->openLocalPackage(QUrl::fromUserInput(parser->value(QStringLiteral("local-filename")), {}, QUrl::AssumeLocalFile));
foreach(const QString &arg, parser->positionalArguments()) {
- mainWindow->openApplication(QUrl(arg));
+ const QUrl url = QUrl::fromUserInput(arg, {}, QUrl::AssumeLocalFile);
+ if (url.isLocalFile())
+ mainWindow->openLocalPackage(url);
+ else
+ mainWindow->openApplication(url);
}
}