Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Games
Palapeli
Commits
286a0d55
Commit
286a0d55
authored
Aug 08, 2022
by
Nicolas Fella
Browse files
Fix importing file
The filename is passed as positional arg, not as value of importOption
parent
d2384796
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main.cpp
View file @
286a0d55
...
...
@@ -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
())
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment