2018-08-10 05:51:27 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QNetworkAccessManager>
|
|
|
|
|
|
|
|
class AutoUpdateChecker : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit AutoUpdateChecker(QObject *parent = nullptr);
|
|
|
|
|
|
|
|
Q_INVOKABLE void start();
|
|
|
|
|
|
|
|
signals:
|
2019-01-04 02:00:54 +00:00
|
|
|
void onUpdateAvailable(QString newVersion, QString url);
|
2018-08-10 05:51:27 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void handleUpdateCheckRequestFinished(QNetworkReply* reply);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void parseStringToVersionQuad(QString& string, QVector<int>& version);
|
|
|
|
|
2021-02-28 20:27:29 +00:00
|
|
|
int compareVersion(QVector<int>& version1, QVector<int>& version2);
|
|
|
|
|
2019-12-14 04:15:52 +00:00
|
|
|
QString getPlatform();
|
|
|
|
|
2018-08-10 05:51:27 +00:00
|
|
|
QVector<int> m_CurrentVersionQuad;
|
|
|
|
QNetworkAccessManager m_Nam;
|
|
|
|
};
|