diff options
| author | 2022-04-16 01:58:40 +0200 | |
|---|---|---|
| committer | 2022-04-16 02:59:30 +0200 | |
| commit | 6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8 (patch) | |
| tree | e29af0f803de724e28eab85da2dfe6c535a8292b /diceroller.cpp | |
| parent | 0c040da59e6aa2df3bd0c22e38b2afe0512d3749 (diff) | |
| download | OneRoll-6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8.tar.gz OneRoll-6ba9324cf4864ebd2e2cdec8098b0889ceaea0a8.zip | |
Make sure Windows compilation works
Diffstat (limited to 'diceroller.cpp')
| -rw-r--r-- | diceroller.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/diceroller.cpp b/diceroller.cpp index af6921c..e1c8ded 100644 --- a/diceroller.cpp +++ b/diceroller.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "diceroller.h" +#include <diceparser_qobject/diceroller.h> #include <QJsonObject> #include <QtConcurrent> @@ -61,18 +61,21 @@ void DiceRoller::readErrorAndWarning() void DiceRoller::start() { - auto future= QtConcurrent::run([this]() { - if(m_diceparser.parseLine(m_command)) + auto future= QtConcurrent::run( + [this]() { - m_diceparser.start(); - readErrorAndWarning(); - auto jsonstr= m_diceparser.resultAsJSon([](const QString& value, const QString&, bool) { return value; }); - QJsonDocument doc= QJsonDocument::fromJson(jsonstr.toLocal8Bit()); - auto json= doc.object(); - m_result= json["scalar"].toString().toDouble(); - emit resultChanged(); - } - }); + if(m_diceparser.parseLine(m_command)) + { + m_diceparser.start(); + readErrorAndWarning(); + auto jsonstr + = m_diceparser.resultAsJSon([](const QString& value, const QString&, bool) { return value; }); + QJsonDocument doc= QJsonDocument::fromJson(jsonstr.toLocal8Bit()); + auto json= doc.object(); + m_result= json["scalar"].toString().toDouble(); + emit resultChanged(); + } + }); } QString DiceRoller::error() const |