From bde8d341cc095a3877e4ecc80b02c267bb651d4b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 13 Nov 2018 13:01:11 +0100 Subject: Don't suppress tags with missing or bad expr Rather, output an empty string as message in this case. Ignoring log instructions is highly confusing. Change-Id: Iebb30ffd3ade33f1277f3073f015127a99170e40 Task-number: QTBUG-71746 Reviewed-by: Jarek Kobus --- src/scxml/qscxmlexecutablecontent.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/scxml/qscxmlexecutablecontent.cpp b/src/scxml/qscxmlexecutablecontent.cpp index 206809c..45079d7 100644 --- a/src/scxml/qscxmlexecutablecontent.cpp +++ b/src/scxml/qscxmlexecutablecontent.cpp @@ -434,18 +434,20 @@ const InstructionId *QScxmlExecutionEngine::step(const InstructionId *ip, bool * qCDebug(qscxmlLog) << stateMachine << "Executing log step"; const Log *log = reinterpret_cast(instr); ip += log->size(); + QString str; if (log->expr != NoEvaluator) { - const QString str = dataModel->evaluateToString(log->expr, ok); - if (*ok) { - const QString label = tableData->string(log->label); - qCDebug(scxmlLog) << label << ":" << str; - QMetaObject::invokeMethod(stateMachine, - "log", - Qt::QueuedConnection, - Q_ARG(QString, label), - Q_ARG(QString, str)); - } + str = dataModel->evaluateToString(log->expr, ok); + if (!*ok) + qCWarning(qscxmlLog) << stateMachine << "Could not evaluate expr to string."; } + + const QString label = tableData->string(log->label); + qCDebug(scxmlLog) << label << ":" << str; + QMetaObject::invokeMethod(stateMachine, + "log", + Qt::QueuedConnection, + Q_ARG(QString, label), + Q_ARG(QString, str)); return ip; } -- cgit v1.2.3