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
24class UpdateChecker : public QObject
25{
26 Q_OBJECT
27
28public:
29 explicit UpdateChecker(QObject *parent = nullptr);
30
37 void checkForUpdates();
38
39signals:
46 void updateAvailable(const QString &latestVersion, const QUrl &downloadUrl, const QUrl &releaseUrl);
47
48private:
49 void onReplyFinished(class QNetworkReply *reply);
50
51 QNetworkAccessManager m_network;
52};
53
61bool isMatchingReleaseAsset(const QString &name, const QString &platform, const QString &arch);
62
69bool shouldOfferUpdate(const QString &tagName, const QVersionNumber &currentVersion, const QString &skippedVersion);
70
79bool 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.
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 ...
bool isMatchingReleaseAsset(const QString &name, const QString &platform, const QString &arch)
True when a GitHub release asset filename is the binary for the given platform ("Windows"/"macOS"/"Li...
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.