Debugger: Fix JS debugging on Harmattan PR1.2

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>
This commit is contained in:
Kai Koehne
2012-01-24 13:20:42 +01:00
committed by Eike Ziller
parent 4345fc8c36
commit 8cd370e163

View File

@@ -280,13 +280,19 @@ JSDebuggerAgent::JSDebuggerAgent(QScriptEngine *engine)
: QDeclarativeDebugService("JSDebugger") : QDeclarativeDebugService("JSDebugger")
, QScriptEngineAgent(engine) , QScriptEngineAgent(engine)
, d(new JSDebuggerAgentPrivate(this)) , d(new JSDebuggerAgentPrivate(this))
{} {
if (status() == Enabled)
engine->setAgent(this);
}
JSDebuggerAgent::JSDebuggerAgent(QDeclarativeEngine *engine) JSDebuggerAgent::JSDebuggerAgent(QDeclarativeEngine *engine)
: QDeclarativeDebugService("JSDebugger") : QDeclarativeDebugService("JSDebugger")
, QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine)) , QScriptEngineAgent(QDeclarativeDebugHelper::getScriptEngine(engine))
, d(new JSDebuggerAgentPrivate(this)) , d(new JSDebuggerAgentPrivate(this))
{} {
if (status() == Enabled)
QDeclarativeDebugHelper::getScriptEngine(engine)->setAgent(this);
}
/*! /*!
Destroys this QScriptDebuggerAgent. Destroys this QScriptDebuggerAgent.