wiRedPanda
Logic Circuit Simulator
Loading...
Searching...
No Matches
UpdateChecker Class Reference

Asynchronously queries the site's release data and emits a signal when a newer version is available. More...

#include <UpdateChecker.h>

Inheritance diagram for UpdateChecker:
[legend]

Public Member Functions

void checkForUpdates ()
 Initiates an asynchronous version check.
void updateAvailable (const QString &latestVersion, const QUrl &downloadUrl, const QUrl &releaseUrl)
 Emitted when a newer release is available and has not been suppressed.
 UpdateChecker (QObject *parent=nullptr)

Detailed Description

Asynchronously queries the site's release data and emits a signal when a newer version is available.

Call checkForUpdates() once after the main window is shown. The check is skipped if one was already performed today. If the fetched release version is newer than the running application and has not been suppressed by the user, updateAvailable is emitted.

Note
Polls the wiRedPanda site's published latest-release.json rather than the GitHub Releases API directly, so the per-user daily check never counts against GitHub's per-IP API rate limit; that file is itself kept fresh by a CI job that queries the API once per release, not once per user.

Definition at line 28 of file UpdateChecker.h.

Constructor & Destructor Documentation

◆ UpdateChecker()

UpdateChecker::UpdateChecker ( QObject * parent = nullptr)
explicit

Definition at line 79 of file UpdateChecker.cpp.

Member Function Documentation

◆ checkForUpdates()

void UpdateChecker::checkForUpdates ( )

Initiates an asynchronous version check.

Returns immediately. The check is skipped silently if it was already performed today or if the user previously chose to suppress notifications for the latest available version.

Definition at line 94 of file UpdateChecker.cpp.

References k_releaseDataUrl, Settings::updateCheckLastDate(), and Settings::updateChecksDisabled().

◆ updateAvailable()

void UpdateChecker::updateAvailable ( const QString & latestVersion,
const QUrl & downloadUrl,
const QUrl & releaseUrl )

Emitted when a newer release is available and has not been suppressed.

Parameters
latestVersionHuman-readable version string, e.g. "4.5.0".
downloadUrlDirect URL to the platform binary asset, or empty if none matched.
releaseUrlFallback link to the GitHub release page.

Referenced by UpdateController::checkForUpdates().


The documentation for this class was generated from the following files: