Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
Loading...
Searching...
No Matches
correlation::app::UpdateChecker Class Reference

Checks for new releases asynchronously on GitHub without interrupting the user. More...

#include <UpdateChecker.hpp>

Static Public Member Functions

static void checkForUpdatesAsync (AppWindow &window, const std::string &current_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 &current_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.

Detailed Description

Checks for new releases asynchronously on GitHub without interrupting the user.

Member Function Documentation

◆ 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
windowThe Slint AppWindow instance.
current_versionThe 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.
Here is the call graph for this function:

◆ 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_verRemote version string.
current_verCurrent 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
urlThe 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
jsonThe JSON response string.
Returns
ReleaseInfo if tag_name is found, std::nullopt otherwise.
Here is the caller graph for this function:

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