ApplicationLauncher: Unify API

Make the API more similar to QtcProcess API.
Rename:
  processStarted() -> started()
  error() -> errorOccurred()
  processError() -> error()

Change-Id: I86d650d55a643f5999fc91e56b985f699e2d7245
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-03-01 13:35:15 +01:00
parent 14d39b871d
commit ff0ce27c1f
9 changed files with 18 additions and 18 deletions

View File

@@ -82,7 +82,7 @@ public:
{
connect(&m_appRunner, &ApplicationLauncher::appendMessage, this,
&DeviceApplicationObserver::handleAppendMessage);
connect(&m_appRunner, &ApplicationLauncher::error, this,
connect(&m_appRunner, &ApplicationLauncher::errorOccurred, this,
[this] { m_error = m_appRunner.errorString(); });
connect(&m_appRunner, &ApplicationLauncher::finished, this,
&DeviceApplicationObserver::handleFinished);

View File

@@ -55,7 +55,7 @@ public:
{
setId("QdbDebuggeeRunner");
connect(&m_launcher, &ApplicationLauncher::processStarted,
connect(&m_launcher, &ApplicationLauncher::started,
this, &RunWorker::reportStarted);
connect(&m_launcher, &ApplicationLauncher::finished,
this, &RunWorker::reportStopped);

View File

@@ -88,7 +88,7 @@ void QdbStopApplicationService::handleAppendMessage(const QString &message, Util
void QdbStopApplicationService::doDeploy()
{
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::error,
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::errorOccurred,
this, [this] { emit stdErrData(d->applicationLauncher.errorString()); });
connect(&d->applicationLauncher, &ProjectExplorer::ApplicationLauncher::finished,
this, &QdbStopApplicationService::handleProcessFinished);

View File

@@ -273,7 +273,7 @@ QmlEngine::QmlEngine()
this, &QmlEngine::disconnected);
connect(&d->applicationLauncher, &ApplicationLauncher::appendMessage,
this, &QmlEngine::appMessage);
connect(&d->applicationLauncher, &ApplicationLauncher::processStarted,
connect(&d->applicationLauncher, &ApplicationLauncher::started,
this, &QmlEngine::handleLauncherStarted);
debuggerConsole()->populateFileFinder();

View File

@@ -237,7 +237,7 @@ QString ApplicationLauncher::errorString() const
return d->m_remoteErrorString;
}
QProcess::ProcessError ApplicationLauncher::processError() const
QProcess::ProcessError ApplicationLauncher::error() const
{
if (d->m_isLocal)
return d->m_process ? d->m_process->error() : QProcess::UnknownError;
@@ -274,7 +274,7 @@ void ApplicationLauncherPrivate::localProcessError(QProcess::ProcessError error)
emit q->finished();
}
}
emit q->error(error);
emit q->errorOccurred(error);
}
void ApplicationLauncherPrivate::handleStandardOutput()
@@ -416,7 +416,7 @@ void ApplicationLauncherPrivate::start()
// The local bit affects only WinDebugInterface.
if (m_isLocal)
m_listeningPid = applicationPID();
emit q->processStarted();
emit q->started();
});
m_process->setProcessChannelMode(m_processChannelMode);
@@ -467,7 +467,7 @@ void ApplicationLauncherPrivate::doReportError(const QString &message, QProcess:
m_remoteErrorString = message;
m_remoteError = error;
m_exitStatus = QProcess::CrashExit;
emit q->error(error);
emit q->errorOccurred(error);
}
} // namespace ProjectExplorer

View File

@@ -64,7 +64,7 @@ public:
bool isLocal() const;
QString errorString() const;
QProcess::ProcessError processError() const;
QProcess::ProcessError error() const;
static QString msgWinCannotRetrieveDebuggingOutput();
@@ -73,9 +73,9 @@ public:
signals:
void appendMessage(const QString &message, Utils::OutputFormat format, bool appendNewLine = true);
void processStarted();
void started();
void finished();
void error(QProcess::ProcessError error);
void errorOccurred(QProcess::ProcessError error);
private:
std::unique_ptr<Internal::ApplicationLauncherPrivate> d;

View File

@@ -1219,7 +1219,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable)
reportStopped();
});
connect(&m_launcher, &ApplicationLauncher::error,
connect(&m_launcher, &ApplicationLauncher::errorOccurred,
this, [this, runnable](QProcess::ProcessError error) {
if (m_stopReported)
return;
@@ -1237,7 +1237,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable)
const bool isDesktop = runnable.device.isNull()
|| runnable.device.dynamicCast<const DesktopDevice>();
if (isDesktop) {
connect(&m_launcher, &ApplicationLauncher::processStarted, this, [this] {
connect(&m_launcher, &ApplicationLauncher::started, this, [this] {
// Console processes only know their pid after being started
ProcessHandle pid = m_launcher.applicationPID();
runControl()->setApplicationProcessHandle(pid);
@@ -1250,7 +1250,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable)
return;
}
} else {
connect(&m_launcher, &ApplicationLauncher::processStarted, this, &RunWorker::reportStarted);
connect(&m_launcher, &ApplicationLauncher::started, this, &RunWorker::reportStarted);
}
m_launcher.setRunnable(runnable);
m_launcher.start();

View File

@@ -119,7 +119,7 @@ void CallgrindController::run(Option option)
#endif
connect(m_controllerProcess, &ApplicationLauncher::finished,
this, &CallgrindController::controllerProcessFinished);
connect(m_controllerProcess, &ApplicationLauncher::error,
connect(m_controllerProcess, &ApplicationLauncher::errorOccurred,
this, &CallgrindController::handleControllerProcessError);
Runnable controller = m_valgrindRunnable;

View File

@@ -116,9 +116,9 @@ bool ValgrindRunner::Private::run()
connect(&m_valgrindProcess, &ApplicationLauncher::finished,
q, &ValgrindRunner::processFinished);
connect(&m_valgrindProcess, &ApplicationLauncher::processStarted,
connect(&m_valgrindProcess, &ApplicationLauncher::started,
this, &ValgrindRunner::Private::processStarted);
connect(&m_valgrindProcess, &ApplicationLauncher::error,
connect(&m_valgrindProcess, &ApplicationLauncher::errorOccurred,
q, &ValgrindRunner::processError);
connect(&m_valgrindProcess, &ApplicationLauncher::appendMessage,
q, &ValgrindRunner::processOutputReceived);
@@ -300,7 +300,7 @@ void ValgrindRunner::processFinished()
emit finished();
if (d->m_valgrindProcess.exitCode() != 0 || d->m_valgrindProcess.exitStatus() == QProcess::CrashExit)
emit processErrorReceived(errorString(), d->m_valgrindProcess.processError());
emit processErrorReceived(errorString(), d->m_valgrindProcess.error());
}
QString ValgrindRunner::errorString() const