VcsCommand: Remove internal terminate() signal

This signal was emitted only from cancel() method and
used only when runCommand() was called. However, with
just 2 public usages of cancel() no-one was used
in conjunction with runCommand(). So, this signal is
no-op.

Change-Id: I2541c6498928d313faafc2fbe47ab609393486d1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2022-10-05 11:40:45 +02:00
parent f4233a1c22
commit 688ec935cd
2 changed files with 1 additions and 11 deletions

View File

@@ -363,11 +363,9 @@ void VcsCommand::cancel()
// TODO: we may want to call cancel here... // TODO: we may want to call cancel here...
d->m_process->stop(); d->m_process->stop();
// TODO: we may want to not wait here... // TODO: we may want to not wait here...
// However, VcsBaseDiffEditorController::runCommand() relies on getting finished() signal
d->m_process->waitForFinished(); d->m_process->waitForFinished();
d->m_process.reset(); d->m_process.reset();
} }
emit terminate();
} }
QString VcsCommand::cleanedStdOut() const QString VcsCommand::cleanedStdOut() const
@@ -394,13 +392,7 @@ CommandResult VcsCommand::runCommand(const CommandLine &command, int timeoutS)
d->setupProcess(&process, {command, timeoutS, d->m_defaultWorkingDirectory, {}}); d->setupProcess(&process, {command, timeoutS, d->m_defaultWorkingDirectory, {}});
const EventLoopMode eventLoopMode = d->eventLoopMode(); const EventLoopMode eventLoopMode = d->eventLoopMode();
if (eventLoopMode == EventLoopMode::On) { process.setTimeOutMessageBoxEnabled(eventLoopMode == EventLoopMode::On);
connect(this, &VcsCommand::terminate, &process, [&process] {
process.stop();
process.waitForFinished();
});
process.setTimeOutMessageBoxEnabled(true);
}
process.runBlocking(eventLoopMode); process.runBlocking(eventLoopMode);
d->handleDone(&process); d->handleDone(&process);

View File

@@ -125,8 +125,6 @@ signals:
void stdErrText(const QString &); void stdErrText(const QString &);
void done(); void done();
void terminate(); // Internal
void append(const QString &text); void append(const QString &text);
void appendSilently(const QString &text); void appendSilently(const QString &text);
void appendError(const QString &text); void appendError(const QString &text);