From bca7533035f224671e0d41060dfa7de2811ca397 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 22 Jan 2022 00:11:28 +0100 Subject: Fix small code. --- cli/main.cpp | 12 ++++++------ parsingtoolbox.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/main.cpp b/cli/main.cpp index 3298eac..c506417 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -22,6 +22,7 @@ #include #include +#include #include #include #include @@ -29,7 +30,6 @@ #include #include #include -#include #ifdef PAINTER_OP #include @@ -246,11 +246,11 @@ void displayCommandResult(QString json, bool withColor) auto comment= obj["comment"].toString(); auto arrayInst= obj["instructions"].toArray(); QStringList diceResults; - for(const auto &inst : qAsConst(arrayInst)) + for(const auto& inst : qAsConst(arrayInst)) { auto obj= inst.toObject(); auto diceVals= obj["diceval"].toArray(); - for(const auto & diceval : qAsConst(diceVals)) + for(const auto& diceval : qAsConst(diceVals)) { auto objval= diceval.toObject(); auto resultStr= objval["string"].toString(); @@ -287,9 +287,9 @@ void displayCommandResult(QString json, bool withColor) if(!comment.isEmpty()) { if(withColor) - out << "\033[1m" << comment << "\033[0m\n"; + out << "\033[1m" << comment << "\033[0m\n"; else - out << comment << " "; + out << comment << " "; } out << str << "\n"; } @@ -570,7 +570,7 @@ int main(int argc, char* argv[]) } else if(optionParser.isSet(line)) { - format = TEXT; + format= TEXT; } if(optionParser.isSet(help)) diff --git a/parsingtoolbox.cpp b/parsingtoolbox.cpp index 4453f03..d2dbe79 100644 --- a/parsingtoolbox.cpp +++ b/parsingtoolbox.cpp @@ -1203,7 +1203,7 @@ QString ParsingToolBox::replacePlaceHolderFromJson(const QString& source, const auto obj= inst.toObject(); auto vals= obj["diceval"].toArray(); int lastFace= -1; - for(auto valRef : vals) + for(auto const& valRef : qAsConst(vals)) { auto diceObj= valRef.toObject(); auto face= diceObj["face"].toInt(); -- cgit v1.2.3-70-g09d2