forked from qt-creator/qt-creator
Uniform ApplicationLauncher API: get rid of reportProgress()
Use existing appendMessage() for this purpose with NormalMessageFormat. In case when device process is used in ApplicationLauncher no appendMessage() was emitted so far. Change-Id: I96041ad19fe16066ea31d92f52253e0aa864f96d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -88,6 +88,11 @@ void QdbStopApplicationService::handleStdout(const QString &output)
|
|||||||
emit stdOutData(output);
|
emit stdOutData(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QdbStopApplicationService::handleAppendMessage(const QString &message)
|
||||||
|
{
|
||||||
|
emit stdOutData(message);
|
||||||
|
}
|
||||||
|
|
||||||
void QdbStopApplicationService::doDeploy()
|
void QdbStopApplicationService::doDeploy()
|
||||||
{
|
{
|
||||||
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::reportError,
|
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::reportError,
|
||||||
@@ -98,8 +103,8 @@ void QdbStopApplicationService::doDeploy()
|
|||||||
this, &QdbStopApplicationService::handleStdout);
|
this, &QdbStopApplicationService::handleStdout);
|
||||||
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::finished,
|
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::finished,
|
||||||
this, &QdbStopApplicationService::handleProcessFinished);
|
this, &QdbStopApplicationService::handleProcessFinished);
|
||||||
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::reportProgress,
|
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::appendMessage,
|
||||||
this, &QdbStopApplicationService::stdOutData);
|
this, &QdbStopApplicationService::handleAppendMessage);
|
||||||
|
|
||||||
ProjectExplorer::Runnable runnable;
|
ProjectExplorer::Runnable runnable;
|
||||||
runnable.command = {Constants::AppcontrollerFilepath, {"--stop"}};
|
runnable.command = {Constants::AppcontrollerFilepath, {"--stop"}};
|
||||||
|
@@ -43,6 +43,7 @@ private:
|
|||||||
void handleProcessFinished(bool success);
|
void handleProcessFinished(bool success);
|
||||||
void handleStderr(const QString &output);
|
void handleStderr(const QString &output);
|
||||||
void handleStdout(const QString &output);
|
void handleStdout(const QString &output);
|
||||||
|
void handleAppendMessage(const QString &message);
|
||||||
|
|
||||||
bool isDeploymentNecessary() const final { return true; }
|
bool isDeploymentNecessary() const final { return true; }
|
||||||
void doDeviceSetup() final { handleDeviceSetupDone(true); }
|
void doDeviceSetup() final { handleDeviceSetupDone(true); }
|
||||||
|
@@ -212,7 +212,8 @@ void ApplicationLauncherPrivate::stop()
|
|||||||
return;
|
return;
|
||||||
m_stopRequested = true;
|
m_stopRequested = true;
|
||||||
m_success = false;
|
m_success = false;
|
||||||
emit q->reportProgress(ApplicationLauncher::tr("User requested stop. Shutting down..."));
|
emit q->appendMessage(ApplicationLauncher::tr("User requested stop. Shutting down..."),
|
||||||
|
Utils::NormalMessageFormat);
|
||||||
switch (m_state) {
|
switch (m_state) {
|
||||||
case Run:
|
case Run:
|
||||||
m_deviceProcess->terminate();
|
m_deviceProcess->terminate();
|
||||||
@@ -480,7 +481,8 @@ void ApplicationLauncherPrivate::handleApplicationFinished()
|
|||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
doReportError(ApplicationLauncher::tr("Application finished with exit code %1.").arg(exitCode));
|
doReportError(ApplicationLauncher::tr("Application finished with exit code %1.").arg(exitCode));
|
||||||
} else {
|
} else {
|
||||||
emit q->reportProgress(ApplicationLauncher::tr("Application finished with exit code 0."));
|
emit q->appendMessage(ApplicationLauncher::tr("Application finished with exit code 0."),
|
||||||
|
Utils::NormalMessageFormat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setFinished();
|
setFinished();
|
||||||
|
@@ -76,7 +76,6 @@ signals:
|
|||||||
|
|
||||||
void remoteStdout(const QString &output);
|
void remoteStdout(const QString &output);
|
||||||
void remoteStderr(const QString &output);
|
void remoteStderr(const QString &output);
|
||||||
void reportProgress(const QString &progressOutput);
|
|
||||||
void reportError(const QString &errorOutput);
|
void reportError(const QString &errorOutput);
|
||||||
void remoteProcessStarted();
|
void remoteProcessStarted();
|
||||||
void finished(bool success);
|
void finished(bool success);
|
||||||
|
@@ -1290,9 +1290,9 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
|
|||||||
reportStarted();
|
reportStarted();
|
||||||
});
|
});
|
||||||
|
|
||||||
connect(&m_launcher, &ApplicationLauncher::reportProgress,
|
connect(&m_launcher, &ApplicationLauncher::appendMessage,
|
||||||
this, [this](const QString &progressString) {
|
this, [this](const QString &progressString, Utils::OutputFormat format) {
|
||||||
appendMessage(progressString, Utils::NormalMessageFormat);
|
appendMessage(progressString, format);
|
||||||
});
|
});
|
||||||
|
|
||||||
m_launcher.start(runnable, device);
|
m_launcher.start(runnable, device);
|
||||||
|
Reference in New Issue
Block a user