diff --git a/src/libs/utils/shellcommand.cpp b/src/libs/utils/shellcommand.cpp index 6568ed656e3..a05d1a5cdd4 100644 --- a/src/libs/utils/shellcommand.cpp +++ b/src/libs/utils/shellcommand.cpp @@ -223,11 +223,6 @@ void ShellCommand::cancel() emit terminate(); } -void ShellCommand::postRunCommand(const FilePath &workingDirectory) -{ - Q_UNUSED(workingDirectory) -} - int ShellCommand::timeoutS() const { return std::accumulate(d->m_jobs.cbegin(), d->m_jobs.cend(), 0, @@ -337,7 +332,7 @@ void ShellCommand::runCommand(QtcProcess &proc, emit appendError(proc.exitMessage()); } } - postRunCommand(dir); + emit runCommandFinished(dir); } void ShellCommand::runFullySynchronous(QtcProcess &process) diff --git a/src/libs/utils/shellcommand.h b/src/libs/utils/shellcommand.h index 11913fe272d..64c319c8142 100644 --- a/src/libs/utils/shellcommand.h +++ b/src/libs/utils/shellcommand.h @@ -149,6 +149,7 @@ signals: void appendMessage(const QString &text); void executedAsync(const QFuture &future); + void runCommandFinished(const Utils::FilePath &workingDirectory); protected: void setEnvironment(const Environment &env); @@ -156,7 +157,6 @@ protected: int timeoutS() const; private: - virtual void postRunCommand(const Utils::FilePath &workDirectory); FilePath workDirectory(const FilePath &wd) const; void run(QFutureInterface &future); diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index 00e92d89582..02f7cb1a25b 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -79,6 +79,7 @@ VcsCommand::VcsCommand(const FilePath &workingDirectory, const Environment &envi connect(this, &ShellCommand::appendMessage, outputWindow, &VcsOutputWindow::appendMessage); connect(this, &ShellCommand::executedAsync, this, &VcsCommand::addTask); + connect(this, &ShellCommand::runCommandFinished, this, &VcsCommand::postRunCommand); } void VcsCommand::addTask(const QFuture &future) diff --git a/src/plugins/vcsbase/vcscommand.h b/src/plugins/vcsbase/vcscommand.h index 86239965614..fd131089a46 100644 --- a/src/plugins/vcsbase/vcscommand.h +++ b/src/plugins/vcsbase/vcscommand.h @@ -41,7 +41,7 @@ private: const Utils::Environment &environment); void addTask(const QFuture &future); - void postRunCommand(const Utils::FilePath &workDirectory) override; + void postRunCommand(const Utils::FilePath &workDirectory); QPointer m_progress; bool m_preventRepositoryChanged;