From ed6d283cd4d34765b40ac57559d17405b71d8a0c Mon Sep 17 00:00:00 2001
From: Marco Bubke <marco.bubke@nokia.com>
Date: Tue, 30 Mar 2010 18:10:36 +0200
Subject: [PATCH] Fix state switch

---
 src/plugins/qmldesigner/core/model/qmlmodelview.cpp | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/plugins/qmldesigner/core/model/qmlmodelview.cpp b/src/plugins/qmldesigner/core/model/qmlmodelview.cpp
index f025819f45b..9e8fd989742 100644
--- a/src/plugins/qmldesigner/core/model/qmlmodelview.cpp
+++ b/src/plugins/qmldesigner/core/model/qmlmodelview.cpp
@@ -305,10 +305,7 @@ void QmlModelView::activateState(const QmlModelState &state)
     } else {
         nodeInstanceView()->activateState(newStateInstance);
     }
-
-    m_state = state;
-
-    stateChanged(state, oldState);}
+}
 
 void QmlModelView::changeToState(const ModelNode &node, const QString &stateName)
 {
@@ -323,7 +320,8 @@ void QmlModelView::changeToState(const ModelNode &node, const QString &stateName
     QmlModelState oldState = m_state;
 
     if (newState.isValid() && oldState != newState) {
-        activateState(newState);
+        m_state = newState;
+        stateChanged(newState, oldState);
     }
 }
 
@@ -340,7 +338,7 @@ void QmlModelView::otherPropertyChanged(const QmlObjectNode &/*qmlObjectNode*/,
 {
 }
 
-void  QmlModelView::stateChanged(const QmlModelState &/*newQmlModelState*/, const QmlModelState &/*oldQmlModelState*/)
+void  QmlModelView::stateChanged(const QmlModelState &newQmlModelState, const QmlModelState &/*oldQmlModelState*/)
 {
 }
 
-- 
GitLab