aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/result
diff options
context:
space:
mode:
authorRenaud G <renaud@rolisteam.org>2021-05-15 06:57:22 +0200
committerRenaud G <renaud@rolisteam.org>2021-05-15 06:57:22 +0200
commit03a443cb5f4269aa9c6a9c3dc2efcfc30b913703 (patch)
treeeec10b5f0c205f5a6d56ac35fdd8657f125e1338 /result
parentf7782a8dffe60e2ee5698bc54443dcb54e8f9a42 (diff)
downloadOneRoll-03a443cb5f4269aa9c6a9c3dc2efcfc30b913703.tar.gz
OneRoll-03a443cb5f4269aa9c6a9c3dc2efcfc30b913703.zip
Add feature about no comma for list operator.
Diffstat (limited to 'result')
-rw-r--r--result/stringresult.cpp9
-rw-r--r--result/stringresult.h4
2 files changed, 11 insertions, 2 deletions
diff --git a/result/stringresult.cpp b/result/stringresult.cpp
index d36dfc7..113c22c 100644
--- a/result/stringresult.cpp
+++ b/result/stringresult.cpp
@@ -31,10 +31,17 @@ bool StringResult::hasResultOfType(Dice::RESULT_TYPE resultType) const
}
return val;
}
+
+void StringResult::setNoComma(bool b)
+{
+ m_commaSeparator= !b;
+}
+
QString StringResult::getText() const
{
- return m_value.join(",");
+ return m_commaSeparator ? m_value.join(",") : m_value.join(QString());
}
+
QVariant StringResult::getResult(Dice::RESULT_TYPE type)
{
switch(type)
diff --git a/result/stringresult.h b/result/stringresult.h
index 522dafc..b0ca539 100644
--- a/result/stringresult.h
+++ b/result/stringresult.h
@@ -33,11 +33,13 @@ public:
void setStringCount(int count);
QString getStringResult() const override;
+ void setNoComma(bool b);
private:
QStringList m_value;
- bool m_highlight;
+ bool m_highlight= true;
int m_stringCount= 0;
+ bool m_commaSeparator= true;
};
#endif // STRINGRESULT_H