From 688ec935cd7d495f8c86af84826fe75397ed4fbb Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Wed, 5 Oct 2022 11:40:45 +0200 Subject: [PATCH] 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 --- src/plugins/vcsbase/vcscommand.cpp | 10 +--------- src/plugins/vcsbase/vcscommand.h | 2 -- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index 82ae1a4d278..01351f65faf 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -363,11 +363,9 @@ void VcsCommand::cancel() // TODO: we may want to call cancel here... d->m_process->stop(); // TODO: we may want to not wait here... - // However, VcsBaseDiffEditorController::runCommand() relies on getting finished() signal d->m_process->waitForFinished(); d->m_process.reset(); } - emit terminate(); } QString VcsCommand::cleanedStdOut() const @@ -394,13 +392,7 @@ CommandResult VcsCommand::runCommand(const CommandLine &command, int timeoutS) d->setupProcess(&process, {command, timeoutS, d->m_defaultWorkingDirectory, {}}); const EventLoopMode eventLoopMode = d->eventLoopMode(); - if (eventLoopMode == EventLoopMode::On) { - connect(this, &VcsCommand::terminate, &process, [&process] { - process.stop(); - process.waitForFinished(); - }); - process.setTimeOutMessageBoxEnabled(true); - } + process.setTimeOutMessageBoxEnabled(eventLoopMode == EventLoopMode::On); process.runBlocking(eventLoopMode); d->handleDone(&process); diff --git a/src/plugins/vcsbase/vcscommand.h b/src/plugins/vcsbase/vcscommand.h index 552cd1225aa..d4e5697624d 100644 --- a/src/plugins/vcsbase/vcscommand.h +++ b/src/plugins/vcsbase/vcscommand.h @@ -125,8 +125,6 @@ signals: void stdErrText(const QString &); void done(); - void terminate(); // Internal - void append(const QString &text); void appendSilently(const QString &text); void appendError(const QString &text);