-
Notifications
You must be signed in to change notification settings - Fork 6
/
Updater_p.hpp
68 lines (66 loc) · 1.66 KB
/
Updater_p.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef UPDATER_PRIVATE_HPP_INCLUDED
#define UPDATER_PRIVATE_HPP_INCLUDED
#include <QObject>
#include <QQueue>
#include <QJsonObject>
#include <QAppImageUpdate>
#include <QSettings>
class UpdaterPrivate : public QObject {
Q_OBJECT
int n_Queued,
n_Failed,
n_Completed;
bool b_NoConfirm;
bool b_Running;
struct AppImage {
QString hash;
QString name;
QString path;
QString image_id;
bool isEmpty() {
return (path.isEmpty());
}
};
AppImage m_CurrentAppImage;
QQueue<AppImage> m_AppImages;
QAppImageUpdate *m_Updater;
QSettings m_Settings;
public:
UpdaterPrivate(QObject *parent = nullptr);
~UpdaterPrivate();
public Q_SLOTS:
void retry(const QJsonObject&);
void removeFromQueue(const QString&);
void queue(const QString&, const QString&, QVariant);
void toggleNoConfirm();
void continueCurrentUpdate();
void cancelCurrentUpdate();
void cancelAll();
private Q_SLOTS:
void onProgress(int, qint64, qint64, double, QString, short);
void onFinishAction(QJsonObject, short);
void onStartAction(short);
void onCancelAction(short);
void onErrorAction(short, short);
void onLog(const QString&, const QString&);
private:
void updateNextAppImage();
Q_SIGNALS:
void noConfirmState(bool);
void removedFromQueue(const QString&);
void queuedCountChanged(int);
void failedCountChanged(int);
void completedCountChanged(int);
void progressText(QString, int);
void torrentStatus(int, int);
void loading();
void metaInfo(QJsonObject);
void queued(QJsonObject);
void failed(QJsonObject);
void started();
void finished(QJsonObject);
void canceled(QString);
void retrySent(QString hash);
void finishedAll();
};
#endif // UPDATER_PRIVATE_HPP_INCLUDED