add check password
This commit is contained in:
@@ -38,15 +38,14 @@ class ProcessManager : public QObject
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void checkUpdates();
|
||||
Q_INVOKABLE void checkPassword(const QString& password);
|
||||
Q_INVOKABLE void setPackageManager(int v);
|
||||
Q_INVOKABLE void setPassword(QString password);
|
||||
Q_INVOKABLE bool passwordEmpty() const;
|
||||
Q_INVOKABLE void update();
|
||||
|
||||
public:
|
||||
int packageCount() const;
|
||||
QStringList updateLog() const;
|
||||
QString password() const;
|
||||
QVariantList packages() const;
|
||||
Status status() const;
|
||||
|
||||
@@ -59,15 +58,20 @@ class ProcessManager : public QObject
|
||||
PackageManager m_package_manager = PackageManager::Yay;
|
||||
Status m_status = Status::Null;
|
||||
QString m_password;
|
||||
QString m_password_candidate;
|
||||
QVariantList m_packages;
|
||||
int m_package_count = 0;
|
||||
std::unique_ptr<QTemporaryDir> m_askpass_dir;
|
||||
QProcess m_password_check;
|
||||
bool m_password_check_running = false;
|
||||
|
||||
private:
|
||||
void set_packages(const QVariantList& v);
|
||||
void set_status(Status s);
|
||||
QString create_ask_pass_helper();
|
||||
QString create_ask_pass_helper(const QString& password);
|
||||
std::expected<QString, QString> check_askpas();
|
||||
void on_password_check_finished(int exit_code, QProcess::ExitStatus status);
|
||||
void on_password_check_error(QProcess::ProcessError error);
|
||||
void finished();
|
||||
void set_updating_flag(bool updated, bool updating);
|
||||
|
||||
@@ -76,4 +80,6 @@ class ProcessManager : public QObject
|
||||
void package_count_changed();
|
||||
void status_changed();
|
||||
void updateLogChanged();
|
||||
void passwordAccepted();
|
||||
void passwordRejected(const QString& reason);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user