From f200fe99a16fa63637d17bb9c15315be2b157ba2 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Sun, 21 Jan 2024 19:22:16 +0100 Subject: [PATCH] Process: Get rid of timeoutS() The setter setTimeoutS() is going to be removed soon. It's going to be replaced by the extra arg to runBlocking(). Change-Id: I60b8c952ba5e27e36183f8652aaa92059e08746e Reviewed-by: Orgad Shaneh --- src/libs/utils/process.cpp | 11 +++-------- src/libs/utils/process.h | 5 ++--- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 8a42aa2d70d..e0f448c4bdb 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1630,7 +1630,7 @@ QString Process::readAllStandardError() } QString Process::exitMessage(const CommandLine &command, ProcessResult result, int exitCode, - int maxHangTimerCount) + int timeoutInSeconds) { const QString cmd = command.toUserOutput(); switch (result) { @@ -1644,14 +1644,14 @@ QString Process::exitMessage(const CommandLine &command, ProcessResult result, i return Tr::tr("The command \"%1\" could not be started.").arg(cmd); case ProcessResult::Hang: return Tr::tr("The command \"%1\" did not respond within the timeout limit (%2 s).") - .arg(cmd).arg(maxHangTimerCount); + .arg(cmd).arg(timeoutInSeconds); } return {}; } QString Process::exitMessage() const { - return exitMessage(commandLine(), result(), exitCode(), timeoutS()); + return exitMessage(commandLine(), result(), exitCode(), d->m_timeoutInSeconds); } QByteArray Process::allRawOutput() const @@ -1826,11 +1826,6 @@ void Process::setTimeoutS(int timeoutS) d->m_timeoutInSeconds = INT_MAX / 1000; } -int Process::timeoutS() const -{ - return d->m_timeoutInSeconds; -} - void Process::setCodec(QTextCodec *c) { QTC_ASSERT(c, return); diff --git a/src/libs/utils/process.h b/src/libs/utils/process.h index 65b69b2872c..3c1f5011978 100644 --- a/src/libs/utils/process.h +++ b/src/libs/utils/process.h @@ -149,7 +149,6 @@ public: /* Timeout for hanging processes (triggers after no more output * occurs on stderr/stdout). */ void setTimeoutS(int timeoutS); - int timeoutS() const; // TODO: We should specify the purpose of the codec, e.g. setCodecForStandardChannel() void setCodec(QTextCodec *c); @@ -182,8 +181,8 @@ public: const QStringList stdOutLines() const; // split, CR removed const QStringList stdErrLines() const; // split, CR removed - static QString exitMessage(const CommandLine &command, ProcessResult result, - int exitCode, int maxHangTimerCount); + static QString exitMessage(const CommandLine &command, ProcessResult result, int exitCode, + int timeoutInSeconds); QString exitMessage() const; QString toStandaloneCommandLine() const;