From 03a443cb5f4269aa9c6a9c3dc2efcfc30b913703 Mon Sep 17 00:00:00 2001 From: Renaud G Date: Sat, 15 May 2021 06:57:22 +0200 Subject: Add feature about no comma for list operator. --- result/stringresult.cpp | 9 ++++++++- result/stringresult.h | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'result') 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 -- cgit v1.2.3-70-g09d2