Add update checker to launcher (#478)

launcher: add release update checker

Co-authored-by: nmzik <Nmzik@mail.ru>
This commit is contained in:
Tarun
2026-09-04 06:08:02 +05:30
committed by GitHub
parent 040b2b9653
commit b9b0b87545
5 changed files with 221 additions and 5 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef UPDATE_CHECKER_H
#define UPDATE_CHECKER_H
#include <QNetworkAccessManager>
#include <QObject>
class QByteArray;
class QWidget;
class UpdateChecker final: public QObject {
Q_OBJECT
public:
explicit UpdateChecker(QWidget* parent);
[[nodiscard]] static bool IsSupported();
void Check(bool manual);
signals:
void CheckingChanged(bool checking);
private:
struct UpdateInfo;
static UpdateInfo ParseUpdateInfo(const QByteArray& data);
void FetchUpdateInfo(const char* url, bool fallback, bool manual);
void ShowUpdateResult(const UpdateInfo& info, bool manual);
QWidget* m_parent = nullptr;
QNetworkAccessManager m_network;
bool m_checking_updates = false;
};
#endif // UPDATE_CHECKER_H