完成了OTA功能,为游戏增加了图标
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
#ifndef UPDATECHECKER_H
|
||||
#define UPDATECHECKER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QJsonObject>
|
||||
|
||||
class QNetworkAccessManager;
|
||||
class QNetworkReply;
|
||||
|
||||
#define APP_VERSION "1.0.2"
|
||||
|
||||
class UpdateChecker : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
static UpdateChecker& instance();
|
||||
void checkForUpdate(const QString& serverBaseUrl, bool silent = false);
|
||||
|
||||
private:
|
||||
explicit UpdateChecker(QObject* parent = nullptr);
|
||||
void onCheckFinished(QNetworkReply* reply, bool silent);
|
||||
void showUpdateDialog(const QJsonObject& info);
|
||||
void downloadAndInstall(const QString& urlPath);
|
||||
|
||||
QNetworkAccessManager* _nam = nullptr;
|
||||
QString _baseUrl;
|
||||
QString _httpBase;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user