Commit 5ccd281c authored by Bharadwaj Raju's avatar Bharadwaj Raju Committed by Nate Graham
Browse files

Enable opening files relative to current directory from the command line

Makes things like `elisa ./music.opus` possible, by passing CWD to QUrl::fromUserInput.


(cherry picked from commit 430686c4)
parent 2b325955
Pipeline #215953 passed with stage
in 8 minutes and 25 seconds
......@@ -34,6 +34,7 @@
#include <QApplication>
#include <QCommandLineParser>
#include <QStandardPaths>
#include <QDir>
#include <QQmlApplicationEngine>
#include <QJSEngine>
......@@ -150,7 +151,7 @@ int main(int argc, char *argv[])
QList<QUrl> urls;
for (const auto &oneArgument : parser.positionalArguments()) {
urls.push_back(QUrl::fromUserInput(oneArgument));
urls.push_back(QUrl::fromUserInput(oneArgument, QDir::currentPath()));
}
engine.rootContext()->setContextProperty(QStringLiteral("elisaStartupArguments"), QVariant::fromValue(urls));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment