feature: added issued configs info parsing
This commit is contained in:
parent
eda24765e7
commit
c2b17c128d
6 changed files with 87 additions and 28 deletions
|
@ -2,6 +2,7 @@
|
|||
#define APICOUNTRYMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QHash>
|
||||
#include <QJsonArray>
|
||||
|
||||
class ApiCountryModel : public QAbstractListModel
|
||||
|
@ -12,7 +13,8 @@ public:
|
|||
enum Roles {
|
||||
CountryNameRole = Qt::UserRole + 1,
|
||||
CountryCodeRole,
|
||||
CountryImageCodeRole
|
||||
CountryImageCodeRole,
|
||||
IsIssuedRole
|
||||
};
|
||||
|
||||
explicit ApiCountryModel(QObject *parent = nullptr);
|
||||
|
@ -25,6 +27,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void updateModel(const QJsonArray &countries, const QString ¤tCountryCode);
|
||||
void updateIssuedConfigsInfo(const QJsonArray &issuedConfigs);
|
||||
|
||||
int getCurrentIndex();
|
||||
void setCurrentIndex(const int i);
|
||||
|
@ -36,7 +39,23 @@ protected:
|
|||
QHash<int, QByteArray> roleNames() const override;
|
||||
|
||||
private:
|
||||
QJsonArray m_countries;
|
||||
struct IssuedConfigInfo
|
||||
{
|
||||
QString installationUuid;
|
||||
QString workerLastUpdated;
|
||||
QString lastDownloaded;
|
||||
QString sourceType;
|
||||
QString osVersion;
|
||||
};
|
||||
|
||||
struct CountryInfo
|
||||
{
|
||||
QString countryName;
|
||||
QString countryCode;
|
||||
};
|
||||
|
||||
QVector<CountryInfo> m_countries;
|
||||
QHash<QString, IssuedConfigInfo> m_issuedConfigs;
|
||||
int m_currentIndex;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue