From 7d9a3339d12b65efda2565cb83f8173284fb9135 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Tue, 12 Jul 2022 09:22:32 +0200 Subject: [PATCH] ShellCommand: Remove unused lastExecutionSuccess() Change-Id: Ie518e6c45db1bc509f40be45925ae32b3d5bc180 Reviewed-by: Orgad Shaneh --- src/libs/utils/shellcommand.cpp | 17 +++++------------ src/libs/utils/shellcommand.h | 1 - 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/libs/utils/shellcommand.cpp b/src/libs/utils/shellcommand.cpp index 81c293c8d99..82208fb88af 100644 --- a/src/libs/utils/shellcommand.cpp +++ b/src/libs/utils/shellcommand.cpp @@ -92,7 +92,6 @@ public: int m_defaultTimeoutS = 10; int m_lastExecExitCode = -1; - bool m_lastExecSuccess = false; bool m_progressiveOutput = false; bool m_hadOutput = false; bool m_aborted = false; @@ -196,7 +195,6 @@ void ShellCommand::addJob(const CommandLine &command, int timeoutS, void ShellCommand::execute() { - d->m_lastExecSuccess = false; d->m_lastExecExitCode = -1; if (d->m_jobs.empty()) @@ -239,11 +237,6 @@ FilePath ShellCommand::workDirectory(const FilePath &wd) const return defaultWorkingDirectory(); } -bool ShellCommand::lastExecutionSuccess() const -{ - return d->m_lastExecSuccess; -} - int ShellCommand::lastExecutionExitCode() const { return d->m_lastExecExitCode; @@ -264,7 +257,7 @@ void ShellCommand::run(QFutureInterface &future) future.setProgressRange(0, 1); const int count = d->m_jobs.size(); d->m_lastExecExitCode = -1; - d->m_lastExecSuccess = true; + bool lastExecSuccess = true; for (int j = 0; j < count; j++) { const Internal::ShellCommandPrivate::Job &job = d->m_jobs.at(j); QtcProcess proc; @@ -274,8 +267,8 @@ void ShellCommand::run(QFutureInterface &future) stdOut += proc.cleanedStdOut(); stdErr += proc.cleanedStdErr(); d->m_lastExecExitCode = proc.exitCode(); - d->m_lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess; - if (!d->m_lastExecSuccess) + lastExecSuccess = proc.result() == ProcessResult::FinishedWithSuccess; + if (!lastExecSuccess) break; } @@ -286,8 +279,8 @@ void ShellCommand::run(QFutureInterface &future) emit stdErrText(stdErr); } - emit finished(d->m_lastExecSuccess, d->m_lastExecExitCode, cookie()); - if (d->m_lastExecSuccess) { + emit finished(lastExecSuccess, d->m_lastExecExitCode, cookie()); + if (lastExecSuccess) { emit success(cookie()); future.setProgressValue(future.progressMaximum()); } else { diff --git a/src/libs/utils/shellcommand.h b/src/libs/utils/shellcommand.h index 394df03866a..17aa7d08663 100644 --- a/src/libs/utils/shellcommand.h +++ b/src/libs/utils/shellcommand.h @@ -104,7 +104,6 @@ public: const ExitCodeInterpreter &interpreter = {}); void execute(); // Execute tasks asynchronously! void abort(); - bool lastExecutionSuccess() const; int lastExecutionExitCode() const; const FilePath &defaultWorkingDirectory() const;