fix checkupdate and exit code
This commit is contained in:
@@ -26,8 +26,15 @@ void CheckUpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus
|
||||
{
|
||||
if (status == QProcess::CrashExit || (exit_code != 0 && exit_code != 2))
|
||||
{
|
||||
on_process_error(m_process.error());
|
||||
return;
|
||||
QString reason;
|
||||
if (status == QProcess::CrashExit) reason = QStringLiteral("checkupdates: crashed");
|
||||
|
||||
const QString err = QString::fromUtf8(m_process.readAllStandardError()).trimmed();
|
||||
const QString last = err.section(QLatin1Char('\n'), -1).trimmed();
|
||||
reason = QStringLiteral("checkupdates: exit code %1").arg(exit_code);
|
||||
if (!last.isEmpty()) reason += QStringLiteral(": ") + last;
|
||||
emit add_log_line(reason);
|
||||
emit finished();
|
||||
}
|
||||
|
||||
const QString output = QString::fromUtf8(m_process.readAllStandardOutput());
|
||||
|
||||
Reference in New Issue
Block a user