desktop-widget: remove SettingsObjectWrapper and update qPref calls

remove use of SettingsObjectWrapper::
remove include of SettingsObjectWrapper.h
use qPrefFoo:: for setters and getters
replace prefs.foo with qPrefXYZ::foo() where feasible
(this expands to the same code, but gives us more control
over the variable).

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-08-15 11:56:17 +02:00 committed by Dirk Hohndel
parent c6998ee926
commit 0f68e0cc2e
6 changed files with 80 additions and 91 deletions

View file

@ -8,23 +8,21 @@
#include "core/version.h"
#include "desktop-widgets/mainwindow.h"
#include "core/cloudstorage.h"
#include "core/subsurface-qt/SettingsObjectWrapper.h"
#include "core/settings/qPrefUpdateManager.h"
UpdateManager::UpdateManager(QObject *parent) :
QObject(parent),
isAutomaticCheck(false)
{
auto update_settings = qPrefUpdateManager::instance();
if (update_settings->dont_check_for_updates())
if (qPrefUpdateManager::dont_check_for_updates())
return;
if (update_settings->last_version_used() == subsurface_git_version() &&
update_settings->next_check() > QDate::currentDate())
if (qPrefUpdateManager::last_version_used() == subsurface_git_version() &&
qPrefUpdateManager::next_check() > QDate::currentDate())
return;
update_settings->set_last_version_used(subsurface_git_version());
update_settings->set_next_check(QDate::currentDate().addDays(14));
qPrefUpdateManager::set_last_version_used(subsurface_git_version());
qPrefUpdateManager::set_next_check(QDate::currentDate().addDays(14));
checkForUpdates(true);
}