diff options
Diffstat (limited to 'core/settings')
-rw-r--r-- | core/settings/qPrefUpdateManager.cpp | 15 | ||||
-rw-r--r-- | core/settings/qPrefUpdateManager.h | 2 |
2 files changed, 11 insertions, 6 deletions
diff --git a/core/settings/qPrefUpdateManager.cpp b/core/settings/qPrefUpdateManager.cpp index 2b2bb373d..23952f700 100644 --- a/core/settings/qPrefUpdateManager.cpp +++ b/core/settings/qPrefUpdateManager.cpp @@ -41,12 +41,17 @@ HANDLE_PREFERENCE_TXT_EXT(UpdateManager, "/LastVersionUsed", last_version_used, void qPrefUpdateManager::set_next_check(const QDate& value) { - QString valueString = value.toString("dd/MM/yyyy"); - if (valueString != prefs.update_manager.next_check) { - qPrefPrivate::copy_txt(&prefs.update_manager.next_check, valueString); + long time_value = value.toJulianDay(); + if (time_value != prefs.update_manager.next_check) { + prefs.update_manager.next_check = time_value; disk_next_check(true); emit instance()->next_check_changed(value); } } -DISK_LOADSYNC_TXT_EXT(UpdateManager, "/NextCheck", next_check, update_manager.); - +void qPrefUpdateManager::disk_next_check(bool doSync) +{ + if (doSync) + qPrefPrivate::instance()->setting.setValue(group + "/NextCheck", prefs.update_manager.next_check); + else + prefs.update_manager.next_check = qPrefPrivate::instance()->setting.value(group + "/NextCheck", 0).toInt(); +} diff --git a/core/settings/qPrefUpdateManager.h b/core/settings/qPrefUpdateManager.h index 773ca3b4b..a1ed468ba 100644 --- a/core/settings/qPrefUpdateManager.h +++ b/core/settings/qPrefUpdateManager.h @@ -26,7 +26,7 @@ public: static bool dont_check_for_updates() { return prefs.update_manager.dont_check_for_updates; } static bool dont_check_exists() { return prefs.update_manager.dont_check_exists; } static const QString last_version_used() { return prefs.update_manager.last_version_used; } - static const QDate next_check() { return QDate::fromString(QString(prefs.update_manager.next_check), "dd/MM/yyyy"); } + static const QDate next_check() { return QDate::fromJulianDay(prefs.update_manager.next_check); } public slots: static void set_dont_check_for_updates(bool value); |