fix some struct and error
This commit is contained in:
@@ -2,19 +2,6 @@
|
||||
#include <QStandardPaths>
|
||||
#include <QRegularExpression>
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr int kMaxLogLines = 1000;
|
||||
|
||||
QString strip_ansi(const QString &text)
|
||||
{
|
||||
static const QRegularExpression ansi(QStringLiteral("\\x1b\\[[0-9;?]*[ -/]*[@-~]"));
|
||||
QString result = text;
|
||||
result.remove(ansi);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
UpdateManager::UpdateManager(QObject* parent)
|
||||
{
|
||||
connect(&m_process, &QProcess::finished, this, &UpdateManager::on_process_finished);
|
||||
@@ -32,11 +19,6 @@ void UpdateManager::on_process_finished(int exit_code, QProcess::ExitStatus stat
|
||||
const QByteArray tail = m_process.readAllStandardOutput();
|
||||
emit append_update_log(tail);
|
||||
|
||||
if (!m_update_log_buffer.trimmed().isEmpty())
|
||||
emit add_log_line(m_package_manager + QStringLiteral(": ") + m_update_log_buffer);
|
||||
|
||||
m_update_log_buffer.clear();
|
||||
|
||||
if (status != QProcess::CrashExit && exit_code == 0)
|
||||
{
|
||||
stop_update(true, {});
|
||||
@@ -53,7 +35,6 @@ void UpdateManager::on_process_error(QProcess::ProcessError error)
|
||||
|
||||
qWarning().noquote() << "failed to start" << m_package_manager << ":" << m_process.errorString();
|
||||
emit add_log_line(m_package_manager + QStringLiteral(": failed to start: ") + m_process.errorString());
|
||||
m_update_log_buffer.clear();
|
||||
set_updating_flag(false, false);
|
||||
emit finished(false);
|
||||
}
|
||||
@@ -67,10 +48,7 @@ void UpdateManager::yay(const QString& askpass)
|
||||
return;
|
||||
}
|
||||
|
||||
m_update_output.clear();
|
||||
emit console_clear();
|
||||
|
||||
emit update_log_changed();
|
||||
emit add_log_line(m_package_manager + QStringLiteral(": update started"));
|
||||
emit set_updating_flag(false, true);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user