-
Notifications
You must be signed in to change notification settings - Fork 13
/
archivalversionlist.h
64 lines (46 loc) · 1.73 KB
/
archivalversionlist.h
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
#ifndef ARCHIVEVERSIONLIST_H
#define ARCHIVEVERSIONLIST_H
#include <QNetworkAccessManager>
class ArchivalVersionInfo : public QObject {
Q_OBJECT
Q_PROPERTY(QString versionName MEMBER versionName CONSTANT)
Q_PROPERTY(int versionCode MEMBER versionCode CONSTANT)
Q_PROPERTY(bool isBeta MEMBER isBeta CONSTANT)
Q_PROPERTY(QString abi MEMBER abi CONSTANT)
public:
QString versionName;
int versionCode;
bool isBeta;
QString abi;
ArchivalVersionInfo(QObject* parent = nullptr) : QObject(parent) {}
};
class RollforwardVersionRange : public QObject {
Q_OBJECT
Q_PROPERTY(int minVersionCode MEMBER minVersionCode CONSTANT)
Q_PROPERTY(int maxVersionCode MEMBER maxVersionCode CONSTANT)
public:
int minVersionCode;
int maxVersionCode;
RollforwardVersionRange(QObject* parent = nullptr) : QObject(parent) {}
};
class ArchivalVersionList : public QObject {
Q_OBJECT
Q_PROPERTY(QList<QObject*> versions READ versions NOTIFY versionsChanged)
Q_PROPERTY(QList<QObject*> rollforwardVersionRange READ rollforwardVersionRange NOTIFY versionsChanged)
private:
QNetworkAccessManager* m_netManager;
QList<QObject*> m_versions;
QList<QObject*> m_versionsnext;
QList<QObject*> m_rollforwardVersionRange;
QString m_baseUrl;
QString m_defBaseUrl;
void onListDownloaded(QNetworkReply* reply, QString abi, QStringList abis);
public:
ArchivalVersionList(QString baseUrl);
QList<QObject*> const& versions() const { return m_versions; }
QList<QObject*> const& rollforwardVersionRange() const { return m_rollforwardVersionRange; }
void downloadLists(QStringList abis, QString versionDBUrl);
signals:
void versionsChanged();
};
#endif // ARCHIVEVERSIONLIST_H