summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qscxml.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qscxml.cpp b/src/qscxml.cpp
index c6cf8da..daa1ec6 100644
--- a/src/qscxml.cpp
+++ b/src/qscxml.cpp
@@ -1252,7 +1252,7 @@ void QScxmlLoader::loadState (
if (stateID == "") {
topLevelState = curState = stateParam;
stateInfo[curState].initial = r.attributes().value("initial").toString();
- if (curState == stateMachine->rootState()) {
+ if (curState == stateMachine) {
stateMachine->scriptEngine()->globalObject().setProperty("_name",qScriptValueFromValue<QString>(stateMachine->scriptEngine(),r.attributes().value("name").toString()));
}
@@ -1273,7 +1273,7 @@ void QScxmlLoader::loadState (
newState->setObjectName(id);
if (!id.isEmpty() && stateInfo[curState].initial == id) {
- if (curState == stateMachine->rootState())
+ if (curState == stateMachine)
stateMachine->setInitialState(newState);
else
curState->setInitialState(newState);
@@ -1553,7 +1553,7 @@ QScxml* QScxmlLoader::load(QIODevice* device, QObject* obj, const QString & file
}
stateMachine = new QScxml(obj);
// traverse through the states
- loadState(stateMachine->rootState(),device,"",filename);
+ loadState(stateMachine,device,"",filename);
// resolve history default state
foreach (ScHistoryInfo h, historyInfo) {