![]() |
QSimpleUpdater
A simple auto-updater system for Qt applications
|
#include <Updater.h>
Public Slots | |
void | checkForUpdates () |
void | setUrl (const QString &url) |
void | setNotifyOnUpdate (const bool ¬ify) |
void | setNotifyOnFinish (const bool ¬ify) |
void | setModuleName (const QString &name) |
void | setModuleVersion (const QString &version) |
void | setDownloaderEnabled (const bool &enabled) |
void | setPlatformKey (const QString &platformKey) |
void | setUseCustomInstallProcedures (const bool &custom) |
Signals | |
void | checkingFinished (const QString &url) |
void | downloadFinished (const QString &url, const QString &filepath) |
Public Member Functions | |
QString | url () const |
QString | platformKey () const |
bool | notifyOnUpdate () const |
bool | notifyOnFinish () const |
bool | updateAvailable () const |
bool | downloaderEnabled () const |
QString | changelog () const |
QString | downloadUrl () const |
QString | latestVersion () const |
QString | moduleName () const |
QString | moduleVersion () const |
bool | useCustomInstallProcedures () const |
The Updater class is in charge of downloading and analyzing the appcast and "reacting" based on the options given by the user/developer/application.
QString Updater::changelog | ( | ) | const |
Returns the latest changelog
|
slot |
Downloads the update definitions file and analyzes it to determine the latest version and the download links
References url().
|
signal |
Emitted when the download definitions have been downloaded and analyzed.
Referenced by setModuleVersion().
bool Updater::downloaderEnabled | ( | ) | const |
Returns if
the updater allows the integrated downloader to download and install the update (if aplicable).
Referenced by setModuleVersion().
|
signal |
Emitted when the download has finished. You can use this to implement your own procedures to install the downloaded updates.
QString Updater::downloadUrl | ( | ) | const |
Returns the URL from where we can download the update
Referenced by setModuleVersion().
QString Updater::latestVersion | ( | ) | const |
Returns the latest version online
Referenced by setModuleVersion().
QString Updater::moduleName | ( | ) | const |
Returns the application name, which can be set manually or automatically using the qApp->applicationName()
function.
Referenced by setModuleVersion().
QString Updater::moduleVersion | ( | ) | const |
Returns the application version, which can be set manually or automatically using the qApp->applicationVersion()
function.
Referenced by setModuleVersion().
bool Updater::notifyOnFinish | ( | ) | const |
Returns true
if the class is set to notify the user when it finishes checking for updates (even if there are no updates available). By default this value is set to false
.
Referenced by setModuleVersion().
bool Updater::notifyOnUpdate | ( | ) | const |
Returns true
if the class is set to notify the user when an update is found online. By default this value is set to true
.
Referenced by setModuleVersion().
QString Updater::platformKey | ( | ) | const |
Returns the current platform key, which is used to differentiate the different download links (and download versions) based on the current operating system.
You can modify this value with the setPlatformKey()
function
Referenced by setModuleVersion(), and setPlatformKey().
|
slot |
If enabled is set to true, then the user will be able to download and install updates directly from the application, without the need of opening the download URL from a browser and manually installing the update.
|
slot |
Changes the name of the module, this can be useful in large applications that only need to update certain components of them (e.g. plugins).
|
slot |
Changes the version of the module, this can be useful in large applications that only need to update certain components of them (e.g. plugins).
References checkingFinished(), downloaderEnabled(), downloadUrl(), latestVersion(), moduleName(), moduleVersion(), notifyOnFinish(), notifyOnUpdate(), platformKey(), Downloader::startDownload(), updateAvailable(), and url().
|
slot |
If set to true
, the updater will notify the user when it finishes checking for updates (even where there are no updates available).
If set to false
(default), the updater will only notify the user when there is an update available (if setNotifyOnUpdate() is true
).
|
slot |
If notify
is set to true, the QSimpleUpdater
will notify the user when an update is available.
If notify
is set to false, the QSimpleUpdater
will not notify the user when an update is available.
|
slot |
Changes the platform key/id. This can be useful if the update depends on more than the underlying operating system on which the application runs.
References platformKey().
|
slot |
Changes the url from where we download the update definitions
References url().
|
slot |
If custom
is set to true, then the Downloader will not attempt to open or install the downloaded updates. This can be useful if you want to implement your own install procedures using the downloadFinished()
signal.
References Downloader::setUseCustomInstallProcedures().
bool Updater::updateAvailable | ( | ) | const |
Returns true
if the updater found an updated version of the application/module online.
Referenced by setModuleVersion().
QString Updater::url | ( | ) | const |
Returns the AppCast URL (from which we extract the update definitions)
Referenced by checkForUpdates(), setModuleVersion(), and setUrl().
bool Updater::useCustomInstallProcedures | ( | ) | const |
Returns true
if the downloader will not attempt to install the downloaded file.
This can be useful if you want to use the downloadFinished()
signal to implement your own install procedures.
References Downloader::useCustomInstallProcedures().