aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2012-01-24 13:20:42 +0100
committerEike Ziller <eike.ziller@nokia.com>2012-01-24 15:37:13 +0100
commit8cd370e16370df16843b24608a4a55df478fe93d (patch)
treee447477420fd83413efbeb68c937735a1e858903
parent4345fc8c36c4df74ab05a07cf6fa073081b96d26 (diff)
Debugger: Fix JS debugging on Harmattan PR1.2v2.4.1
So far we assumend that the JSDebugAgent service switches to the Enabled state after the constructor has run. That's apparently not true for Harmattan PR1.2 (maybe the app / Qt calls process events by hand, maybe it was a race condition from the start). Fix this by checking the status already in the constructor, and register ourselves as debugger agent if status == Enabled. Change-Id: Icae189102116c8b572e05ce6c64f14b8f428ed2f Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
-rw-r--r--share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp b/share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp
index ab24e06bb4..1808dcc76f 100644
--- a/share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp
+++ b/share/qtcreator/qml/qmljsdebugger/jsdebuggeragent.cpp
@@ -280,13 +280,19 @@ JSDebuggerAgent::JSDebuggerAgent(QScriptEngine *engine)
: QDeclarativeDebugService("JSDebugger")
, QScriptEngineAgent(engine)
, d(new JSDebuggerAgentPrivate(this))
-{}
+{
+ if (status() == Enabled)
+ engine->setAgent(this);
+}
JSDebuggerAgent::JSDebuggerAgent(QDeclarativeEngine *engine)
: QDeclarativeDebugService("JSDebugger")
, QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine))
, d(new JSDebuggerAgentPrivate(this))
-{}
+{
+ if (status() == Enabled)
+ QDeclarativeDebugHelper::getScriptEngine(engine)->setAgent(this);
+}
/*!
Destroys this QScriptDebuggerAgent.