mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 05:34:17 +00:00
df0c4c8208
Apparently having this object around can lead to background network scans happening that cause WiFi perf degradation.
29 lines
636 B
C++
29 lines
636 B
C++
#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);
|
|
|
|
QString getPlatform();
|
|
|
|
QVector<int> m_CurrentVersionQuad;
|
|
QNetworkAccessManager* m_Nam;
|
|
};
|