fix checkupdate errors
This commit is contained in:
@@ -28,13 +28,15 @@ void CheckUpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus
|
|||||||
{
|
{
|
||||||
QString reason;
|
QString reason;
|
||||||
if (status == QProcess::CrashExit) reason = QStringLiteral("checkupdates: crashed");
|
if (status == QProcess::CrashExit) reason = QStringLiteral("checkupdates: crashed");
|
||||||
|
else reason = QStringLiteral("checkupdates: exit code %1").arg(exit_code);
|
||||||
|
|
||||||
const QString err = QString::fromUtf8(m_process.readAllStandardError()).trimmed();
|
const QString err = QString::fromUtf8(m_process.readAllStandardError()).trimmed();
|
||||||
const QString last = err.section(QLatin1Char('\n'), -1).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;
|
if (!last.isEmpty()) reason += QStringLiteral(": ") + last;
|
||||||
|
|
||||||
emit add_log_line(reason);
|
emit add_log_line(reason);
|
||||||
emit finished();
|
emit finished();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString output = QString::fromUtf8(m_process.readAllStandardOutput());
|
const QString output = QString::fromUtf8(m_process.readAllStandardOutput());
|
||||||
@@ -62,15 +64,7 @@ void CheckUpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus
|
|||||||
|
|
||||||
void CheckUpdateManager::on_process_error(QProcess::ProcessError error)
|
void CheckUpdateManager::on_process_error(QProcess::ProcessError error)
|
||||||
{
|
{
|
||||||
QString reason;
|
if (error != QProcess::FailedToStart) return;
|
||||||
if (error == QProcess::FailedToStart) reason = QStringLiteral("failed to start: ") + m_process.errorString();
|
emit add_log_line(QStringLiteral("checkupdates: failed to start: ") + m_process.errorString());
|
||||||
else
|
|
||||||
{
|
|
||||||
reason = QStringLiteral("failed, exit code %1").arg(m_process.exitCode());
|
|
||||||
const QString errText = QString::fromUtf8(m_process.readAllStandardError()).trimmed();
|
|
||||||
if (!errText.isEmpty()) reason += QStringLiteral(": ") + errText;
|
|
||||||
}
|
|
||||||
|
|
||||||
emit add_log_line(reason);
|
|
||||||
emit finished();
|
emit finished();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user