Drop ::ExitStatus:: and ::ProcessError::

That's superfluous. Fix comparison of QProcess::exitCode
with QProcess::ExitStatus.

Change-Id: I49d746fdbbc279e3e04c4ed57d386560e7cbe4b4
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-02-14 16:03:43 +01:00
parent 6f1285f508
commit a3ff220f5b
5 changed files with 11 additions and 11 deletions

View File

@@ -217,8 +217,8 @@ public:
QString errorString; QString errorString;
QByteArray stdOut; QByteArray stdOut;
QByteArray stdErr; QByteArray stdErr;
QProcess::ExitStatus exitStatus = QProcess::ExitStatus::NormalExit; QProcess::ExitStatus exitStatus = QProcess::NormalExit;
QProcess::ProcessError error = QProcess::ProcessError::UnknownError; QProcess::ProcessError error = QProcess::UnknownError;
int exitCode = 0; int exitCode = 0;
private: private:

View File

@@ -1243,7 +1243,7 @@ QProcess::ExitStatus QtcProcess::exitStatus() const
{ {
if (d->m_process) if (d->m_process)
return d->m_process->exitStatus(); return d->m_process->exitStatus();
return QProcess::ExitStatus::NormalExit; return QProcess::NormalExit;
} }
void QtcProcess::kill() void QtcProcess::kill()

View File

@@ -74,7 +74,7 @@ QString McuPackageExecutableVersionDetector::parseVersion(const QString &package
if (!binaryProcess.waitForStarted()) if (!binaryProcess.waitForStarted())
return QString(); return QString();
binaryProcess.waitForFinished(execTimeout); binaryProcess.waitForFinished(execTimeout);
if (binaryProcess.exitCode() == QProcess::ExitStatus::NormalExit) { if (binaryProcess.exitStatus() == QProcess::NormalExit) {
const QString processOutput = QString::fromUtf8( const QString processOutput = QString::fromUtf8(
binaryProcess.readAllStandardOutput().append( binaryProcess.readAllStandardOutput().append(
binaryProcess.readAllStandardError())); binaryProcess.readAllStandardError()));

View File

@@ -118,29 +118,29 @@ void MesonProcess::handleProcessError(QProcess::ProcessError error)
QString message; QString message;
QString commandStr = m_currentCommand.toUserOutput(); QString commandStr = m_currentCommand.toUserOutput();
switch (error) { switch (error) {
case QProcess::ProcessError::FailedToStart: case QProcess::FailedToStart:
message = tr("The process failed to start.") message = tr("The process failed to start.")
+ tr("Either the " + tr("Either the "
"invoked program \"%1\" is missing, or you may have insufficient " "invoked program \"%1\" is missing, or you may have insufficient "
"permissions to invoke the program.") "permissions to invoke the program.")
.arg(m_currentCommand.executable().toUserOutput()); .arg(m_currentCommand.executable().toUserOutput());
break; break;
case QProcess::ProcessError::Crashed: case QProcess::Crashed:
message = tr("The process was ended forcefully."); message = tr("The process was ended forcefully.");
break; break;
case QProcess::ProcessError::Timedout: case QProcess::Timedout:
message = tr("Process timed out."); message = tr("Process timed out.");
break; break;
case QProcess::ProcessError::WriteError: case QProcess::WriteError:
message = tr("An error occurred when attempting to write " message = tr("An error occurred when attempting to write "
"to the process. For example, the process may not be running, " "to the process. For example, the process may not be running, "
"or it may have closed its input channel."); "or it may have closed its input channel.");
break; break;
case QProcess::ProcessError::ReadError: case QProcess::ReadError:
message = tr("An error occurred when attempting to read from " message = tr("An error occurred when attempting to read from "
"the process. For example, the process may not be running."); "the process. For example, the process may not be running.");
break; break;
case QProcess::ProcessError::UnknownError: case QProcess::UnknownError:
message = tr("An unknown error in the process occurred."); message = tr("An unknown error in the process occurred.");
break; break;
} }

View File

@@ -108,7 +108,7 @@ void NimSuggestServer::onFinished()
{ {
clearState(); clearState();
if (m_process.exitCode() == QProcess::ExitStatus::CrashExit) if (m_process.exitStatus() == QProcess::CrashExit)
emit crashed(); emit crashed();
else else
emit finished(); emit finished();