Flip string comparisons in savegame example
This follows up to commit 9834e80833783357743b2a5abe3071760638effb, fixing an accidental flip to the meaning of keywords on the command-line. If the first word is "load" we should load a prior game, not start a new one; if the second is "binary" we should use CBOR, the binary format, not JSON. Task-number: QTBUG-111228 Change-Id: If29070777daf68f2f959bc1ec4ffd67ba90b28ba Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 5a3784bba363978c798cacfb7c826f7d03a35115) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
7082526d5d
commit
18c87e0953
@ -17,9 +17,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
const QStringList args = QCoreApplication::arguments();
|
||||
const bool newGame
|
||||
= args.size() <= 1 || QString::compare(args[1], "load"_L1, Qt::CaseInsensitive) == 0;
|
||||
= args.size() <= 1 || QString::compare(args[1], "load"_L1, Qt::CaseInsensitive) != 0;
|
||||
const bool json
|
||||
= args.size() <= 2 || QString::compare(args[2], "binary"_L1, Qt::CaseInsensitive) == 0;
|
||||
= args.size() <= 2 || QString::compare(args[2], "binary"_L1, Qt::CaseInsensitive) != 0;
|
||||
|
||||
Game game;
|
||||
if (newGame)
|
||||
|
Loading…
x
Reference in New Issue
Block a user