From 18c87e095336e6c67d3ece2611f844c7d2493779 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 3 May 2023 15:54:22 +0200 Subject: [PATCH] Flip string comparisons in savegame example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marc Mutz (cherry picked from commit 5a3784bba363978c798cacfb7c826f7d03a35115) Reviewed-by: Qt Cherry-pick Bot --- examples/corelib/serialization/savegame/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/corelib/serialization/savegame/main.cpp b/examples/corelib/serialization/savegame/main.cpp index f97b0d595f9..79f928cda91 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)