fix flash
This commit is contained in:
@@ -65,13 +65,15 @@ void ConsoleManager::clear()
|
||||
|
||||
void ConsoleManager::add_log_line(const QString& line)
|
||||
{
|
||||
// недописанная строка вывода должна попасть в лог раньше новой строки
|
||||
if (!m_update_log_buffer.isEmpty()) commit_line();
|
||||
|
||||
const QString clean = strip_ansi(line).trimmed();
|
||||
if (clean.isEmpty()) return;
|
||||
|
||||
qInfo().noquote() << clean;
|
||||
|
||||
if (m_update_log.size() >= kMaxLogLines) m_update_log.removeFirst();
|
||||
m_update_log.append(clean);
|
||||
|
||||
emit update_log_changed();
|
||||
}
|
||||
|
||||
@@ -79,6 +81,7 @@ void ConsoleManager::commit_line()
|
||||
{
|
||||
const QString line = m_update_log_buffer;
|
||||
m_update_log_buffer.clear();
|
||||
if (!line.trimmed().isEmpty())
|
||||
m_pending_cr = false;
|
||||
if (!line.trimmed().isEmpty())
|
||||
add_log_line(m_package_manager + QStringLiteral(": ") + line);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,8 @@ class ConsoleManager : public QObject
|
||||
QStringList update_log() const;
|
||||
void append_update_log(const QByteArray& chunk);
|
||||
void add_log_line(const QString& line);
|
||||
void clear();
|
||||
|
||||
private:
|
||||
void commit_line();
|
||||
void clear();
|
||||
|
||||
private:
|
||||
QString m_package_manager = "yay";
|
||||
|
||||
@@ -65,6 +65,7 @@ void ProcessManager::set_status(Status s)
|
||||
|
||||
void ProcessManager::finished()
|
||||
{
|
||||
m_console_manager.commit_line();
|
||||
m_password_manager.clear_askpass();
|
||||
set_status(Status::Null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user