moonlight-qt/app/backend/autoupdatechecker.h

30 lines
635 B
C
Raw Normal View History

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