diff options
author | jan Iversen <jani@apache.org> | 2018-08-03 20:25:02 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-09 08:45:02 -0700 |
commit | e33545afd04dc059c0df4bc47b5aacec3487c60d (patch) | |
tree | cce643642383ef23fa51abad21f9b4b9a72dbda0 /desktop-widgets | |
parent | e673a3558eaff6ebc617e6e97e5c81cd819e7985 (diff) | |
download | subsurface-e33545afd04dc059c0df4bc47b5aacec3487c60d.tar.gz |
core: activate qPrefUpdateManager
remove UpdateManager from SettingsObjectWrapper and reference qPrefUpdateManager
update files using SettingsObjectWrapper/UpdateManager to use qPrefUpdateManager
this activated qPrefUpdateManager and removed the similar class from
SettingsObjectWrapper.
Signed-off-by: Jan Iversen <jani@apache.org>
Diffstat (limited to 'desktop-widgets')
-rw-r--r-- | desktop-widgets/updatemanager.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/desktop-widgets/updatemanager.cpp b/desktop-widgets/updatemanager.cpp index db4cd5ecc..ccf70a67c 100644 --- a/desktop-widgets/updatemanager.cpp +++ b/desktop-widgets/updatemanager.cpp @@ -14,17 +14,17 @@ UpdateManager::UpdateManager(QObject *parent) : QObject(parent), isAutomaticCheck(false) { - auto update_settings = SettingsObjectWrapper::instance()->update_manager_settings; + auto update_settings = qPrefUpdateManager::instance(); - if (update_settings->dontCheckForUpdates()) + if (update_settings->dont_check_for_updates()) return; - if (update_settings->lastVersionUsed() == subsurface_git_version() && - update_settings->nextCheck() > QDate::currentDate()) + if (update_settings->last_version_used() == subsurface_git_version() && + update_settings->next_check() > QDate::currentDate()) return; - update_settings->setLastVersionUsed(subsurface_git_version()); - update_settings->setNextCheck(QDate::currentDate().addDays(14)); + update_settings->set_last_version_used(subsurface_git_version()); + update_settings->set_next_check(QDate::currentDate().addDays(14)); checkForUpdates(true); } @@ -108,8 +108,8 @@ void UpdateManager::requestReceived() msgbox.exec(); } if (isAutomaticCheck) { - auto update_settings = SettingsObjectWrapper::instance()->update_manager_settings; - if (!update_settings->dontCheckExists()) { + auto update_settings = qPrefUpdateManager::instance(); + if (!update_settings->dont_check_exists()) { // we allow an opt out of future checks QMessageBox response(MainWindow::instance()); @@ -121,7 +121,7 @@ void UpdateManager::requestReceived() response.setWindowTitle(tr("Automatic check for updates")); response.setIcon(QMessageBox::Question); response.setWindowModality(Qt::WindowModal); - update_settings->setDontCheckForUpdates(response.exec() != QMessageBox::Accepted); + update_settings->set_dont_check_for_updates(response.exec() != QMessageBox::Accepted); } } } |