wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
UpdateChecker.h
Go to the documentation of this file.
1// Copyright 2015 - 2026, GIBIS-UNIFESP and the wiRedPanda contributors
2// SPDX-License-Identifier: GPL-3.0-or-later
3
7
8#pragma once
9
10#include <QNetworkAccessManager>
11#include <QObject>
12#include <QString>
13#include <QUrl>
14#include <QVersionNumber>
15
28class UpdateChecker : public QObject
29{
30 Q_OBJECT
31
32public:
33 explicit UpdateChecker(QObject *parent = nullptr);
34
41 void checkForUpdates();
42
43signals:
50 void updateAvailable(const QString &latestVersion, const QUrl &downloadUrl, const QUrl &releaseUrl);
51
52private:
53 void onReplyFinished(class QNetworkReply *reply);
54
55 QNetworkAccessManager m_network;
56};
57
65QString releaseAssetKey(const QString &platform, const QString &arch);
66
73bool shouldOfferUpdate(const QString &tagName, const QVersionNumber &currentVersion, const QString &skippedVersion);
74
84bool isSafeGitHubUrl(const QUrl &url);
bool isSafeGitHubUrl(const QUrl &url)
True when url is safe to download from or hand to the OS's URL handler.
QString releaseAssetKey(const QString &platform, const QString &arch)
The key in latest-release.json holding the download URL for the given platform ("Windows"/"macOS"/"Li...
bool shouldOfferUpdate(const QString &tagName, const QVersionNumber &currentVersion, const QString &skippedVersion)
True when the release tagged tagName should be offered to a user running currentVersion who may have ...
UpdateChecker(QObject *parent=nullptr)
void updateAvailable(const QString &latestVersion, const QUrl &downloadUrl, const QUrl &releaseUrl)
Emitted when a newer release is available and has not been suppressed.
void checkForUpdates()
Initiates an asynchronous version check.