From a0134647c3a57797ec1addf428d37d005f5f1e82 Mon Sep 17 00:00:00 2001
From: Aurindam Jana <aurindam.jana@nokai.com>
Date: Wed, 19 Oct 2011 17:49:24 +0200
Subject: [PATCH] QmlEngine: Engine State transitions

Rectify wrong state transitions for "Attach to QML Port".

Change-Id: Ife55344fb5089513743ff14f6bb5f2cabeed0adb
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
---
 src/plugins/debugger/qml/qmlengine.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index 270009e8311..94aa4dbb2ce 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -198,7 +198,8 @@ void QmlEngine::connectionEstablished()
     }
     connect(watchersModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
 
-    notifyEngineRunAndInferiorRunOk();
+    if (state() == EngineRunRequested)
+        notifyEngineRunAndInferiorRunOk();
 }
 
 void QmlEngine::beginConnection()
@@ -247,7 +248,12 @@ void QmlEngine::retryMessageBoxFinished(int result)
         // fall through
     }
     default:
+        if (state() == InferiorRunOk) {
+            notifyInferiorSpontaneousStop();
+            notifyInferiorIll();
+        } else {
         notifyEngineRunFailed();
+        }
         break;
     }
 }
-- 
GitLab