aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2022-01-22 00:11:28 +0100
committerRenaud G <renaud@rolisteam.org>2022-01-22 00:21:19 +0100
commitbca7533035f224671e0d41060dfa7de2811ca397 (patch)
tree74e1926483e3b50cc24e5a77f0f7aef0e1f7d33e
parent187774c338c35864a2d3ad1c95ad06e9685c8427 (diff)
downloadOneRoll-bca7533035f224671e0d41060dfa7de2811ca397.tar.gz
OneRoll-bca7533035f224671e0d41060dfa7de2811ca397.zip
Fix small code.
-rw-r--r--cli/main.cpp12
-rw-r--r--parsingtoolbox.cpp2
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 <QCommandLineOption>
#include <QCommandLineParser>
+#include <QDebug>
#include <QFile>
#include <QJsonArray>
#include <QJsonDocument>
@@ -29,7 +30,6 @@
#include <QRegularExpression>
#include <QStringList>
#include <QTextStream>
-#include <QDebug>
#ifdef PAINTER_OP
#include <QGuiApplication>
@@ -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();