summaryrefslogtreecommitdiffstats
path: root/core/subsurface-qt
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2016-11-01 11:57:28 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-11-01 09:34:47 -0700
commit92272311bfe9c60c1f77c1b47d171d885175ec3c (patch)
tree47abc9365cfcc14194caa8de6cd0f31e878ebdd4 /core/subsurface-qt
parent3966f3e7dd1421da72c8920c2fd6b246f0ee063a (diff)
downloadsubsurface-92272311bfe9c60c1f77c1b47d171d885175ec3c.tar.gz
Preferences tests: fix Update Manager date loading
Date loading was incorrect, this unittest + fix deals with that. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/subsurface-qt')
-rw-r--r--core/subsurface-qt/SettingsObjectWrapper.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/subsurface-qt/SettingsObjectWrapper.cpp b/core/subsurface-qt/SettingsObjectWrapper.cpp
index d692c4b6d..81f6237a3 100644
--- a/core/subsurface-qt/SettingsObjectWrapper.cpp
+++ b/core/subsurface-qt/SettingsObjectWrapper.cpp
@@ -102,7 +102,7 @@ QString UpdateManagerSettings::lastVersionUsed() const
QDate UpdateManagerSettings::nextCheck() const
{
- return QDate::fromString(QString(prefs.update_manager.next_check));
+ return QDate::fromString(QString(prefs.update_manager.next_check), "dd/MM/yyyy");
}
void UpdateManagerSettings::setDontCheckForUpdates(bool value)
@@ -140,7 +140,7 @@ void UpdateManagerSettings::setNextCheck(const QDate& date)
s.beginGroup(group);
s.setValue("NextCheck", date);
free (prefs.update_manager.next_check);
- prefs.update_manager.next_check = copy_string(qPrintable(date.toString()));
+ prefs.update_manager.next_check = copy_string(qPrintable(date.toString("dd/MM/yyyy")));
emit nextCheckChanged(date);
}
@@ -2283,7 +2283,7 @@ void SettingsObjectWrapper::load()
prefs.update_manager.dont_check_exists = s.contains("DontCheckForUpdates");
prefs.update_manager.dont_check_for_updates = s.value("DontCheckForUpdates").toBool();
prefs.update_manager.last_version_used = copy_string(qPrintable(s.value("LastVersionUsed").toString()));
- prefs.update_manager.next_check = copy_string(qPrintable(s.value("NextCheck").toString()));
+ prefs.update_manager.next_check = copy_string(qPrintable(s.value("NextCheck").toDate().toString("dd/MM/yyyy")));
s.endGroup();
s.beginGroup("Language");