summaryrefslogtreecommitdiffstats
path: root/src/scxml/qscxmlexecutablecontent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scxml/qscxmlexecutablecontent.cpp')
-rw-r--r--src/scxml/qscxmlexecutablecontent.cpp22
1 files changed, 12 insertions, 10 deletions
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<const Log *>(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 <log> 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;
}