Commit 286a0d55 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Fix importing file

The filename is passed as positional arg, not as value of importOption
parent d2384796
......@@ -17,6 +17,8 @@
#include <QCommandLineParser>
#include <QCommandLineOption>
#include <iostream>
int main(int argc, char** argv)
// Fixes blurry icons with fractional scaling
......@@ -50,10 +52,16 @@ int main(int argc, char** argv)
//NOTE: Syntax errors are reported on stderr, while file errors are presented to the user.
if (parser.isSet(importOption))
if (parser.isSet(importOption)) {
//perform import request
new Palapeli::ImportHelper(parser.value(importOption));
else {
if (parser.positionalArguments().isEmpty()) {
std::cout << i18n("No file to import given").toStdString() << std::endl;
return 1;
new Palapeli::ImportHelper(parser.positionalArguments().first());
} else {
const QStringList args = parser.positionalArguments();
QString path;
if (!args.isEmpty()) {
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