fix some struct and error
This commit is contained in:
@@ -17,6 +17,11 @@ ProcessManager::ProcessManager(QObject* parent) : QObject{parent}, m_console_man
|
||||
|
||||
// сигналы из ConsoleManager
|
||||
connect(&m_console_manager, &ConsoleManager::update_log_changed, this, &ProcessManager::updateLogChanged);
|
||||
|
||||
// Соединение UpdateManager и ConsoleManager
|
||||
connect(&m_update_manager, &UpdateManager::console_clear, &m_console_manager, &ConsoleManager::clear);
|
||||
connect(&m_update_manager, &UpdateManager::add_log_line, &m_console_manager, &ConsoleManager::add_log_line);
|
||||
connect(&m_update_manager, &UpdateManager::append_update_log, &m_console_manager, &ConsoleManager::append_update_log);
|
||||
}
|
||||
|
||||
void ProcessManager::checkUpdates()
|
||||
@@ -39,11 +44,10 @@ void ProcessManager::set_packages(const QVariantList& v)
|
||||
m_package_count = 0;
|
||||
m_packages = v;
|
||||
|
||||
emit packages_changed();
|
||||
|
||||
for (const QVariant &item : m_packages)
|
||||
if (!item.toMap().value(QStringLiteral("updated")).toBool()) ++m_package_count;
|
||||
|
||||
emit packages_changed();
|
||||
if (m_package_count != old_count) emit package_count_changed();
|
||||
}
|
||||
|
||||
@@ -56,6 +60,7 @@ void ProcessManager::set_status(Status s)
|
||||
|
||||
void ProcessManager::finished(bool ok, QString reason)
|
||||
{
|
||||
if (!ok) qWarning() << reason;
|
||||
m_askpass_dir.reset();
|
||||
set_status(Status::Null);
|
||||
}
|
||||
@@ -174,5 +179,5 @@ void ProcessManager::set_updating_flag(bool updated, bool updating)
|
||||
int ProcessManager::packageCount() const { return m_package_count; }
|
||||
QVariantList ProcessManager::packages() const { return m_packages; }
|
||||
ProcessManager::Status ProcessManager::status() const { return m_status; }
|
||||
bool ProcessManager::hasPassword() const { return m_password.isEmpty(); }
|
||||
bool ProcessManager::passwordEmpty() const { return m_password.isEmpty(); }
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
#include <expected>
|
||||
#include <memory>
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <QProcessEnvironment>
|
||||
#include <QQmlEngine>
|
||||
#include <QStringList>
|
||||
#include <QTemporaryDir>
|
||||
#include <QTimer>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QVariantList>
|
||||
#include "checkupdatemanager.hpp"
|
||||
#include "updatemanager.hpp"
|
||||
@@ -38,8 +40,8 @@ class ProcessManager : public QObject
|
||||
Q_INVOKABLE void checkUpdates();
|
||||
Q_INVOKABLE void setPackageManager(int v);
|
||||
Q_INVOKABLE void setPassword(QString password);
|
||||
Q_INVOKABLE bool passwordEmpty() const;
|
||||
Q_INVOKABLE void update();
|
||||
Q_INVOKABLE bool hasPassword() const;
|
||||
|
||||
public:
|
||||
int packageCount() const;
|
||||
|
||||
Reference in New Issue
Block a user