add pacman to update manager
This commit is contained in:
40
cpp/managers/installmanager/installmanager.hpp
Normal file
40
cpp/managers/installmanager/installmanager.hpp
Normal file
@@ -0,0 +1,40 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QProcess>
|
||||
#include <QVariantList>
|
||||
#include <QTemporaryDir>
|
||||
|
||||
class InstallManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit InstallManager(QObject* parent = nullptr);
|
||||
|
||||
private:
|
||||
QProcess m_process;
|
||||
|
||||
public:
|
||||
void yay(const QString& password);
|
||||
void pacman(const QString& password);
|
||||
void set_package_manager(const QString& pm);
|
||||
|
||||
private:
|
||||
void on_update_ready_read();
|
||||
void on_process_finished(int exitCode, QProcess::ExitStatus status);
|
||||
void on_process_error(QProcess::ProcessError error);
|
||||
QProcessEnvironment update_environment(const QString& askpass) const;
|
||||
void stop_update(bool success, const QString& reason);
|
||||
|
||||
private:
|
||||
QString m_package_manager = "yay";
|
||||
|
||||
signals:
|
||||
void finished(bool ok, QString reason = "");
|
||||
void set_updating_flag(bool updated, bool updating);
|
||||
void append_update_log(const QByteArray& chunk);
|
||||
void add_log_line(const QString& line);
|
||||
void console_clear();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user