Checks for new releases asynchronously on GitHub without interrupting the user.
More...
#include <UpdateChecker.hpp>
|
| static void | checkForUpdatesAsync (AppWindow &window, const std::string ¤t_version) |
| | Spawns an asynchronous background thread to check for new releases on GitHub. If a newer version is found, safely dispatches UI updates to AppWindow.
|
| static bool | isNewerVersion (const std::string &remote_ver, const std::string ¤t_ver) |
| | Compares two semantic version strings (e.g. "v3.9.1" vs "3.9.0").
|
| static void | openUrlInBrowser (const std::string &url) |
| | Opens a URL in the user's default system browser.
|
| static std::optional< ReleaseInfo > | fetchLatestRelease () |
| | Queries the GitHub API for the latest release metadata.
|
| static std::optional< ReleaseInfo > | parseReleaseJson (const std::string &json) |
| | Parses the tag_name and html_url fields from GitHub release JSON string.
|
Checks for new releases asynchronously on GitHub without interrupting the user.
◆ checkForUpdatesAsync()
| void correlation::app::UpdateChecker::checkForUpdatesAsync |
( |
AppWindow & | window, |
|
|
const std::string & | current_version ) |
|
static |
Spawns an asynchronous background thread to check for new releases on GitHub. If a newer version is found, safely dispatches UI updates to AppWindow.
- Parameters
-
| window | The Slint AppWindow instance. |
| current_version | The current application version string (e.g. "3.9.0"). |
◆ fetchLatestRelease()
| std::optional< ReleaseInfo > correlation::app::UpdateChecker::fetchLatestRelease |
( |
| ) |
|
|
static |
Queries the GitHub API for the latest release metadata.
- Returns
- ReleaseInfo with tag_name and html_url if successful, std::nullopt otherwise.
◆ isNewerVersion()
| bool correlation::app::UpdateChecker::isNewerVersion |
( |
const std::string & | remote_ver, |
|
|
const std::string & | current_ver ) |
|
static |
Compares two semantic version strings (e.g. "v3.9.1" vs "3.9.0").
- Parameters
-
| remote_ver | Remote version string. |
| current_ver | Current version string. |
- Returns
- true if remote_ver is strictly newer than current_ver.
◆ openUrlInBrowser()
| void correlation::app::UpdateChecker::openUrlInBrowser |
( |
const std::string & | url | ) |
|
|
static |
Opens a URL in the user's default system browser.
- Parameters
-
| url | The URL string to open. |
◆ parseReleaseJson()
| std::optional< ReleaseInfo > correlation::app::UpdateChecker::parseReleaseJson |
( |
const std::string & | json | ) |
|
|
static |
Parses the tag_name and html_url fields from GitHub release JSON string.
- Parameters
-
| json | The JSON response string. |
- Returns
- ReleaseInfo if tag_name is found, std::nullopt otherwise.
The documentation for this class was generated from the following files: