diff options
author | hjk <hjk@qt.io> | 2017-03-06 15:04:25 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2017-03-08 16:12:13 +0000 |
commit | b7412814ab2389bfb1d5c8e6771310cbc6c6553e (patch) | |
tree | cf46ce17d006a795b655fc10c6cac57ddbbe4414 /src/plugins/debugger | |
parent | 9a126e37f977c2f29f52eea3d2574a8eae23d0f2 (diff) | |
download | qt-creator-b7412814ab2389bfb1d5c8e6771310cbc6c6553e.tar.gz |
ProjectExplorer: Switch responsibilities for raising applications
Instead of letting the launcher decide to raise something when
started (and only then) leave it to the RunControl to trigger
(and for now also to implement) as response to the application
launcher start (or possibly now, in other circumstances).
Change-Id: I0ac8f1e633981f7bf316c88e83c208765886d9a1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/debugger')
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.cpp | 15 | ||||
-rw-r--r-- | src/plugins/debugger/qml/qmlengine.h | 1 |
2 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp index 17b3e7ff70..06627e4da6 100644 --- a/src/plugins/debugger/qml/qmlengine.cpp +++ b/src/plugins/debugger/qml/qmlengine.cpp @@ -261,7 +261,7 @@ QmlEngine::QmlEngine(const DebuggerRunParameters &startParameters, DebuggerEngin connect(&d->applicationLauncher, &ApplicationLauncher::appendMessage, this, &QmlEngine::appendMessage); connect(&d->applicationLauncher, &ApplicationLauncher::processStarted, - &d->noDebugOutputTimer, static_cast<void(QTimer::*)()>(&QTimer::start)); + this, &QmlEngine::handleLauncherStarted); d->outputParser.setNoOutputText(ApplicationLauncher::msgWinCannotRetrieveDebuggingOutput()); connect(&d->outputParser, &QmlOutputParser::waitingForConnectionOnPort, @@ -343,6 +343,14 @@ void QmlEngine::setupInferior() beginConnection(); } +void QmlEngine::handleLauncherStarted() +{ + // FIXME: The QmlEngine never calls notifyInferiorPid() triggering the + // raising, so do it here manually for now. + runControl()->bringApplicationToForeground(); + d->noDebugOutputTimer.start(); +} + void QmlEngine::appendMessage(const QString &msg, Utils::OutputFormat /* format */) { showMessage(msg, AppOutput); // FIXME: Redirect to RunControl @@ -646,11 +654,6 @@ void QmlEngine::setupEngine() // we need to get the port first notifyEngineRequestRemoteSetup(); } else { - // We can't do this in the constructore because runControl() isn't yet defined - connect(&d->applicationLauncher, &ApplicationLauncher::bringToForegroundRequested, - runControl(), &RunControl::bringApplicationToForeground, - Qt::UniqueConnection); - notifyEngineSetupOk(); } } diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h index 1f6b9c9bbe..2c3b50a5d6 100644 --- a/src/plugins/debugger/qml/qmlengine.h +++ b/src/plugins/debugger/qml/qmlengine.h @@ -62,6 +62,7 @@ private: void tryToConnect(Utils::Port port = Utils::Port()); void beginConnection(Utils::Port port = Utils::Port()); + void handleLauncherStarted(); void connectionEstablished(); void connectionStartupFailed(); void appStartupFailed(const QString &errorMessage); |