Commit 430686c4 authored by Bharadwaj Raju's avatar Bharadwaj Raju
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.
parent dd57c124
Pipeline #215952 passed with stage
in 5 minutes and 40 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