mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-03 03:53:56 -07:00
Client update implementation
This commit is contained in:
parent
36c3536e0c
commit
66fda086c3
10 changed files with 503 additions and 4 deletions
38
cockatrice/src/update_checker.h
Normal file
38
cockatrice/src/update_checker.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// Created by miguel on 28/12/15.
|
||||
//
|
||||
|
||||
#ifndef COCKATRICE_UPDATECHECKER_H
|
||||
#define COCKATRICE_UPDATECHECKER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QUrl>
|
||||
#include <QDate>
|
||||
#include <QtNetwork>
|
||||
|
||||
class UpdateChecker : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
UpdateChecker(QObject *parent);
|
||||
~UpdateChecker();
|
||||
void check();
|
||||
signals:
|
||||
void finishedCheck(bool needToUpdate, bool isCompatible, QVariantMap *build);
|
||||
void error(QString errorString);
|
||||
private:
|
||||
static QVariantMap *findCompatibleBuild();
|
||||
static QDate findOldestBuild(QVariantList allBuilds);
|
||||
static QDate dateFromBuild(QVariant build);
|
||||
static QVariantMap *findCompatibleBuild(QVariantList allBuilds);
|
||||
static bool downloadMatchesCurrentOS(QVariant build);
|
||||
QVariantMap *build;
|
||||
QUrl latestFilesUrl;
|
||||
QDate buildDate;
|
||||
QNetworkAccessManager *netMan;
|
||||
QNetworkReply *response;
|
||||
private slots:
|
||||
void fileListFinished();
|
||||
};
|
||||
|
||||
|
||||
#endif //COCKATRICE_UPDATECHECKER_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue