![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
Manages the updater instances. More...
#include <QSimpleUpdater.h>


Public Slots | |
| void | checkForUpdates (const QString &url) |
| void | setModuleName (const QString &url, const QString &name) |
| void | setNotifyOnUpdate (const QString &url, const bool notify) |
| void | setNotifyOnFinish (const QString &url, const bool notify) |
| void | setPlatformKey (const QString &url, const QString &platform) |
| void | setModuleVersion (const QString &url, const QString &version) |
| void | setDownloaderEnabled (const QString &url, const bool enabled) |
| void | setUserAgentString (const QString &url, const QString &agent) |
| void | setUseCustomAppcast (const QString &url, const bool customAppcast) |
| void | setUseCustomInstallProcedures (const QString &url, const bool custom) |
| void | setMandatoryUpdate (const QString &url, const bool mandatory_update) |
Signals | |
| void | checkingFinished (const QString &url) |
| void | appcastDownloaded (const QString &url, const QByteArray &data) |
| void | downloadFinished (const QString &url, const QString &filepath) |
Public Member Functions | |
| bool | usesCustomAppcast (const QString &url) const |
| bool | getNotifyOnUpdate (const QString &url) const |
| bool | getNotifyOnFinish (const QString &url) const |
| bool | getUpdateAvailable (const QString &url) const |
| bool | getDownloaderEnabled (const QString &url) const |
| bool | usesCustomInstallProcedures (const QString &url) const |
| QString | getOpenUrl (const QString &url) const |
| QString | getChangelog (const QString &url) const |
| QString | getModuleName (const QString &url) const |
| QString | getDownloadUrl (const QString &url) const |
| QString | getPlatformKey (const QString &url) const |
| QString | getLatestVersion (const QString &url) const |
| QString | getModuleVersion (const QString &url) const |
| QString | getUserAgentString (const QString &url) const |
Static Public Member Functions | |
| static QSimpleUpdater * | getInstance () |
Protected Member Functions | |
| ~QSimpleUpdater () | |
Manages the updater instances.
The QSimpleUpdater class manages the updater system and allows for parallel application modules to check for updates and download them.
The behavior of each updater can be regulated by specifying the update definitions URL (from where we download the individual update definitions) and defining the desired options by calling the individual "setter" functions (e.g. setNotifyOnUpdate()).
The QSimpleUpdater also implements an integrated downloader. If you need to use a custom install procedure/code, just create a function that is called when the downloadFinished() signal is emitted to implement your own install procedures.
By default, the downloader will try to open the file as if you opened it from a file manager or a web browser (with the "file:*" url).
Definition at line 43 of file QSimpleUpdater.h.
|
protected |
Definition at line 14 of file QSimpleUpdater.cpp.
|
signal |
|
slot |
Instructs the Updater instance with the registered url to download and interpret the update definitions file.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 229 of file QSimpleUpdater.cpp.
References Updater::checkForUpdates().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
signal |
|
signal |
| QString QSimpleUpdater::getChangelog | ( | const QString & | url | ) | const |
Returns the changelog of the Updater instance registered with the given url.
checkForUpdates() before using this function Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 133 of file QSimpleUpdater.cpp.
References Updater::changelog().
Referenced by ecvUpdateDlg::updateChangelog(), and Window::updateChangelog().
| bool QSimpleUpdater::getDownloaderEnabled | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url has the integrated downloader enabled.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 90 of file QSimpleUpdater.cpp.
References Updater::downloaderEnabled().
| QString QSimpleUpdater::getDownloadUrl | ( | const QString & | url | ) | const |
Returns the download URL of the Updater instance registered with the given url.
checkForUpdates() before using this function Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 160 of file QSimpleUpdater.cpp.
References Updater::downloadUrl().
|
static |
Returns the only instance of the class
Definition at line 27 of file QSimpleUpdater.cpp.
Referenced by ecvUpdateDlg::ecvUpdateDlg(), and Window::Window().
| QString QSimpleUpdater::getLatestVersion | ( | const QString & | url | ) | const |
Returns the remote module version of the Updater instance registered with the given url.
checkForUpdates() before using this function Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 191 of file QSimpleUpdater.cpp.
References Updater::latestVersion().
| QString QSimpleUpdater::getModuleName | ( | const QString & | url | ) | const |
Returns the module name of the Updater instance registered with the given url.
Updater will use the application name as its module name. Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 147 of file QSimpleUpdater.cpp.
References Updater::moduleName().
| QString QSimpleUpdater::getModuleVersion | ( | const QString & | url | ) | const |
Returns the module version of the Updater instance registered with the given url.
Updater will use the application version as its module version. Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 205 of file QSimpleUpdater.cpp.
References Updater::moduleVersion().
| bool QSimpleUpdater::getNotifyOnFinish | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url shall notify the user when it finishes checking for updates.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 65 of file QSimpleUpdater.cpp.
References Updater::notifyOnFinish().
| bool QSimpleUpdater::getNotifyOnUpdate | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url shall notify the user when an update is available.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 53 of file QSimpleUpdater.cpp.
References Updater::notifyOnUpdate().
| QString QSimpleUpdater::getOpenUrl | ( | const QString & | url | ) | const |
Returns the URL to open in a web browser of the Updater instance registered with the given url.
Updater will use the application name as its module name. Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 120 of file QSimpleUpdater.cpp.
References Updater::openUrl().
| QString QSimpleUpdater::getPlatformKey | ( | const QString & | url | ) | const |
Returns the platform key of the Updater registered with the given url. If you do not define a platform key, the system will assign the following platform key:
ios osx android linux windows Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 178 of file QSimpleUpdater.cpp.
References Updater::platformKey().
| bool QSimpleUpdater::getUpdateAvailable | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url has an update available.
checkForUpdates() before using this function Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 78 of file QSimpleUpdater.cpp.
References Updater::updateAvailable().
| QString QSimpleUpdater::getUserAgentString | ( | const QString & | url | ) | const |
Returns the user-agent string used by the updater to communicate with the remote HTTP(S) server.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 217 of file QSimpleUpdater.cpp.
References Updater::userAgentString().
|
slot |
If the enabled parameter is set to true, the Updater instance registered with the given url will open the integrated downloader if the user agrees to install the update (if any).
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 313 of file QSimpleUpdater.cpp.
References Updater::setDownloaderEnabled().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
Definition at line 360 of file QSimpleUpdater.cpp.
References Updater::setMandatoryUpdate().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
Changes the module name of the Updater instance registered at the given url.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 243 of file QSimpleUpdater.cpp.
References name, and Updater::setModuleName().
|
slot |
Changes the module
Updater instance registered at the given url.Updater instance will use the application version. Definition at line 300 of file QSimpleUpdater.cpp.
References Updater::setModuleVersion(), and version.
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
If notify is set to true, then the Updater instance registered with the given url will notify the user when it has finished interpreting the update definitions file.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 268 of file QSimpleUpdater.cpp.
References Updater::setNotifyOnFinish().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
If notify is set to true, then the Updater instance registered with the given url will notify the user when an update is available.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 255 of file QSimpleUpdater.cpp.
References Updater::setNotifyOnUpdate().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
Changes the platform key of the Updater isntance registered at the given url.
If the platform key is empty, then the system will use the following keys:
ios osx android linux windows Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 287 of file QSimpleUpdater.cpp.
References Updater::setPlatformKey().
|
slot |
If the customAppcast parameter is set to true, then the Updater will not try to read the network reply from the server, instead, it will emit the appcastDownloaded() signal, which allows the application to read and interpret the appcast file by itself.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 339 of file QSimpleUpdater.cpp.
References Updater::setUseCustomAppcast().
Referenced by ecvUpdateDlg::checkForUpdates(), and Window::checkForUpdates().
|
slot |
If the custom parameter is set to true, the Updater instance registered with the given url will not try to open the downloaded file.
If you want to implement your own way to handle the downloaded file, just bind to the downloadFinished() signal and disable the integrated downloader with the setUseCustomInstallProcedures() function.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 355 of file QSimpleUpdater.cpp.
References Updater::setUseCustomInstallProcedures().
|
slot |
Changes the user-agent string used by the updater to communicate with the remote server
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 325 of file QSimpleUpdater.cpp.
References Updater::setUserAgentString().
| bool QSimpleUpdater::usesCustomAppcast | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url uses a custom appcast format and/or allows the application to read and interpret the downloaded appcast file
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 41 of file QSimpleUpdater.cpp.
References Updater::customAppcast().
| bool QSimpleUpdater::usesCustomInstallProcedures | ( | const QString & | url | ) | const |
Returns true if the Updater instance registered with the given url shall try to open the downloaded file.
If you want to implement your own way to handle the downloaded file, just bind to the downloadFinished() signal and disable the integrated downloader with the setUseCustomInstallProcedures() function.
Updater instance registered with the given url is not found, that Updater instance will be initialized automatically Definition at line 106 of file QSimpleUpdater.cpp.
References Updater::useCustomInstallProcedures().