From 1f6764a54e4d508826f72a090bcb68fcd16a568d Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 5 May 2017 14:45:36 +0200 Subject: Debugger: Move run parameters from engine to tool runner The parameters belong to the run control, they should not be triplicated in case of a combined engine. Change-Id: I4dd84220edbd7a44b902cc52627fe01d0568db75 Reviewed-by: Christian Stenger --- src/plugins/debugger/qml/qmlcppengine.cpp | 35 ++++++++++++++----------------- 1 file changed, 16 insertions(+), 19 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 95241ee9b5..11d04e219b 100644 --- a/src/plugins/debugger/qml/qmlcppengine.cpp +++ b/src/plugins/debugger/qml/qmlcppengine.cpp @@ -26,6 +26,7 @@ #include "qmlcppengine.h" #include "qmlengine.h" +#include #include #include #include @@ -48,13 +49,9 @@ enum { debug = 0 }; #define CHECK_STATE(s) do { checkState(s, __FILE__, __LINE__); } while (0) -DebuggerEngine *createQmlCppEngine(const DebuggerRunParameters &sp, QStringList *errors) +DebuggerEngine *createQmlCppEngine(DebuggerEngine *cppEngine, bool useTerminal) { - QmlCppEngine *newEngine = new QmlCppEngine(sp, errors); - if (newEngine->cppEngine()) - return newEngine; - delete newEngine; - return 0; + return new QmlCppEngine(cppEngine, useTerminal); } @@ -64,19 +61,12 @@ DebuggerEngine *createQmlCppEngine(const DebuggerRunParameters &sp, QStringList // //////////////////////////////////////////////////////////////////////// -QmlCppEngine::QmlCppEngine(const DebuggerRunParameters &rp, QStringList *errors) - : DebuggerEngine(rp) -{ - setObjectName(QLatin1String("QmlCppEngine")); - m_qmlEngine = new QmlEngine(rp, this); - QStringList innerErrors; - m_cppEngine = createEngine(rp.cppEngineType, rp, &innerErrors); - if (!m_cppEngine) { - errors->append(tr("The slave debugging engine required for combined " - "QML/C++-Debugging could not be created: %1") - .arg(innerErrors.join(QLatin1Char('\n')))); - return; - } +QmlCppEngine::QmlCppEngine(DebuggerEngine *cppEngine, bool useTerminal) +{ + setObjectName("QmlCppEngine"); + m_qmlEngine = new QmlEngine(useTerminal); + m_qmlEngine->setMasterEngine(this); + m_cppEngine = cppEngine; m_cppEngine->setMasterEngine(this); setActiveEngine(m_cppEngine); } @@ -770,6 +760,13 @@ DebuggerEngine *QmlCppEngine::qmlEngine() const return m_qmlEngine; } +void QmlCppEngine::setRunTool(DebuggerRunTool *runTool) +{ + DebuggerEngine::setRunTool(runTool); + m_qmlEngine->setRunTool(runTool); + m_cppEngine->setRunTool(runTool); +} + void QmlCppEngine::setActiveEngine(DebuggerEngine *engine) { m_activeEngine = engine; -- cgit v1.2.1