NDEVR
API Documentation
NDEVRUpdateChecker

Allows the application to check a given location for an update.txt file which it can then use to download and update the software. More...

Inheritance diagram for NDEVRUpdateChecker:
[legend]
Collaboration diagram for NDEVRUpdateChecker:
[legend]

Public Member Functions

 NDEVRUpdateChecker ()
 Constructs an update checker with no initial version.
 NDEVRUpdateChecker (const StringView &current_version)
 Constructs an update checker for the given application version.
void onCheckForUpdateComplete () override
 Called when the asynchronous update check completes to process the result.
void requestCheckForUpdate (const StringView &current_version=StringView()) override
 Initiates an asynchronous check for software updates.
String updateURLPage () const override
 Returns the URL of the page where the user can manually download the update.
Public Member Functions inherited from UpdateChecker
 UpdateChecker ()
 Constructs an UpdateChecker with default settings.
 UpdateChecker (StringView update_version)
 Constructs an UpdateChecker with a known current version.
void appStartupCheck ()
 Performs an update check at application startup if enough time has elapsed.
const Buffer< ApplicationResource::ReleaseType > & availableReleaseTypes () const
 Returns the list of available release types for this application.
void checkForUpdateCompletedSignal (UpdateStatus update)
 Signal emitted when an update check completes.
virtual void createUpdateFile (const String &installer_url, File output_location)
 Creates an update file from the given installer URL.
uint08 currentDownloadSize () const
 Returns the number of bytes downloaded so far.
virtual String defaultURLPathName () const
 Returns the default URL path segment used for update requests.
fltp08 downloadPercent () const
 Returns the download progress as a percentage.
virtual INIFactory getINI ()
 Returns an INI factory configured for update settings.
Time lastUpdateCheckTime () const
 Returns the time of the last update check.
void percentChangedSignal ()
 Signal emitted when download progress changes.
virtual void processUpdateString (const String &s)
 Parses an update response string to extract version and URL information.
ApplicationResource::ReleaseType recommendedReleaseType () const
 Returns the recommended release type based on user preference and availability.
void releaseTypesChangedSignal ()
 Signal emitted when the available release types change.
virtual bool requestInstallUpdate (bool wait_for_completion=false)
 Requests installation of the downloaded update.
virtual bool requstDownloadUpdate ()
 Requests download of the available update.
void setMaxNoUpdateTime (const TimeSpan &max_no_update_check_time)
 Sets the maximum time between automatic update checks.
void setReleaseTypes (const Buffer< ApplicationResource::ReleaseType > &types)
 Sets the available release types for the update checker.
void setUpdateStatus (UpdateStatus status)
 Sets the current update status and emits statusChangedSignal.
void showUpdateDialogIfNeeded ()
 Shows a dialog prompting the user to update if one is available.
void statusChangedSignal ()
 Signal emitted when the update status changes.
uint08 totalDownloadSize () const
 Returns the total size of the update download.
void updateDownloadCompletedSignal (const File &location)
 Signal emitted when an update download completes.
File updateFile () const
 Returns the local file path of the downloaded update.
virtual String updateName () const
 Returns the file name of the available update.
virtual bool updateRequiresApplicationClose () const
 Returns whether the update requires closing the application first.
UpdateStatus updateStatus () const
 Returns the current update status.
virtual bool updateSupported () const
 Returns whether software updates are supported on this platform.
virtual String updateURLDownload () const
 Returns the direct download URL for the update.
virtual String updateVersion () const
 Returns the version string of the available update.

Public Attributes

Resource< Stringmanual_update_location
 The URL for manual update downloads.
Resource< Stringupdate_address
 The network address to check for update.txt.

Protected Attributes

ItemDownloaderm_check_update
 The downloader used to fetch the update check file.
Protected Attributes inherited from UpdateChecker
String m_current_version
 The current application version string.
File m_download_location
 The local file path for downloaded updates.
QPointer< ItemDownloaderm_downloader
 The downloader managing the update file transfer.
Time m_last_application_update_check
 The time of the last update check.
TimeSpan m_max_no_update_time
 The maximum allowed time between automatic update checks.
Buffer< ApplicationResource::ReleaseTypem_release_types
 The available release types.
String m_update_file_name
 The file name of the available update.
String m_update_url
 The download URL for the available update.
String m_update_version
 The version string of the available update.

Additional Inherited Members

Public Types inherited from UpdateChecker
enum  UpdateStatus {
  e_need_to_check , e_no_new_updates , e_update_available_to_download , e_update_available_to_install ,
  e_could_not_connect , e_unsupported
}
 The possible states of the update check/download lifecycle. More...
Static Public Attributes inherited from UpdateChecker
static ApplicationOption< ApplicationResource::ReleaseTyperelease_check_type
 The user's preferred release type for update checks.
Protected Member Functions inherited from UpdateChecker
void checkForUpdateCompleteSlot ()
 Slot invoked when the update check network request completes.
void onUpdateDownloadCompleteSlot ()
 Slot invoked when the update file download completes.

Detailed Description

Allows the application to check a given location for an update.txt file which it can then use to download and update the software.


Definition at line 13 of file NDEVRUpdateChecker.h.

Constructor & Destructor Documentation

◆ NDEVRUpdateChecker()

NDEVRUpdateChecker::NDEVRUpdateChecker ( const StringView & current_version)

Constructs an update checker for the given application version.

Parameters
[in]current_versionThe current version string of the application.

Member Function Documentation

◆ requestCheckForUpdate()

void NDEVRUpdateChecker::requestCheckForUpdate ( const StringView & current_version = StringView())
overridevirtual

Initiates an asynchronous check for software updates.

Parameters
[in]current_versionThe current version to compare against. If empty, uses the stored version.

Implements UpdateChecker.

◆ updateURLPage()

String NDEVRUpdateChecker::updateURLPage ( ) const
overridevirtual

Returns the URL of the page where the user can manually download the update.

Returns
The update download page URL.

Implements UpdateChecker.


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