From fa6817a6fa305162018db54cf7402faef3cf403d Mon Sep 17 00:00:00 2001 From: Aurindam Jana Date: Fri, 13 Apr 2012 17:14:10 +0200 Subject: QmlCppEngine: Update Views when switching between engines. Change-Id: I90958e77c4d8c845ef6e55fe65eaffe0ac24dcc5 Reviewed-by: Kai Koehne --- src/plugins/debugger/qml/qmlcppengine.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/plugins/debugger/qml/qmlcppengine.cpp') diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp index 62b7c1f3a0..051243153a 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -120,7 +120,7 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp, *errorMessage = tr("The slave debugging engine required for combined QML/C++-Debugging could not be created: %1").arg(*errorMessage); return; } - d->m_activeEngine = d->m_cppEngine; + setActiveEngine(d->m_cppEngine); } QmlCppEngine::~QmlCppEngine() @@ -425,7 +425,7 @@ bool QmlCppEngine::evaluateScriptExpression(const QString &expression) void QmlCppEngine::setupEngine() { EDEBUG("\nMASTER SETUP ENGINE"); - d->m_activeEngine = d->m_cppEngine; + setActiveEngine(d->m_cppEngine); d->m_qmlEngine->setupSlaveEngine(); d->m_cppEngine->setupSlaveEngine(); @@ -592,7 +592,7 @@ void QmlCppEngine::slaveEngineStateChanged // track qml engine again setState(InferiorStopRequested); notifyInferiorStopOk(); - d->m_activeEngine = qmlEngine(); + setActiveEngine(d->m_qmlEngine); } break; } @@ -625,7 +625,7 @@ void QmlCppEngine::slaveEngineStateChanged setState(InferiorStopRequested); } // now track cpp engine - d->m_activeEngine = cppEngine(); + setActiveEngine(d->m_cppEngine); } break; } @@ -637,7 +637,7 @@ void QmlCppEngine::slaveEngineStateChanged || state() == InferiorStopOk, qDebug() << state()); // Just to make sure, we're shutting down anyway ... - d->m_activeEngine = cppEngine(); + setActiveEngine(d->m_cppEngine); if (state() == InferiorStopRequested) setState(InferiorStopOk); @@ -645,7 +645,7 @@ void QmlCppEngine::slaveEngineStateChanged } else { if (d->m_activeEngine != cppEngine()) { showStatusMessage(tr("C++ debugger activated")); - d->m_activeEngine = cppEngine(); + setActiveEngine(d->m_cppEngine); } QTC_ASSERT(state() == InferiorStopRequested @@ -737,7 +737,7 @@ void QmlCppEngine::slaveEngineStateChanged EDEBUG("... QML ENGINE STOPPED DURING SHUTDOWN "); // Just to make sure, we're shutting down anyway ... - d->m_activeEngine = cppEngine(); + setActiveEngine(d->m_cppEngine); if (state() == InferiorStopRequested) notifyInferiorStopOk(); @@ -745,7 +745,7 @@ void QmlCppEngine::slaveEngineStateChanged } else { if (d->m_activeEngine != qmlEngine()) { showStatusMessage(tr("QML debugger activated")); - d->m_activeEngine = qmlEngine(); + setActiveEngine(d->m_qmlEngine); } QTC_ASSERT(state() == InferiorRunOk @@ -821,6 +821,12 @@ DebuggerEngine *QmlCppEngine::qmlEngine() const return d->m_qmlEngine; } +void QmlCppEngine::setActiveEngine(DebuggerEngine *engine) +{ + d->m_activeEngine = engine; + updateViews(); +} + } // namespace Internal } // namespace Debugger -- cgit v1.2.1