forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user