diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-03 15:54:22 +0200 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2023-05-04 15:05:16 +0200 |
commit | 5a3784bba363978c798cacfb7c826f7d03a35115 (patch) | |
tree | 9163b5ffa9dadd4987f13f74d82becefbcde22c6 /examples/corelib | |
parent | b1379d34dd7252fc169ac9986148bb93f8e1a68e (diff) | |
download | qtbase-5a3784bba363978c798cacfb7c826f7d03a35115.tar.gz |
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.
Pick-to: 6.5
Task-number: QTBUG-111228
Change-Id: If29070777daf68f2f959bc1ec4ffd67ba90b28ba
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'examples/corelib')
-rw-r--r-- | examples/corelib/serialization/savegame/main.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/corelib/serialization/savegame/main.cpp b/examples/corelib/serialization/savegame/main.cpp index f97b0d595f..79f928cda9 100644 --- a/examples/corelib/serialization/savegame/main.cpp +++ b/examples/corelib/serialization/savegame/main.cpp @@ -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) |