From 3c4d069501450e012c3b48512718674b80edd9fd Mon Sep 17 00:00:00 2001 From: Max Lapan Date: Wed, 17 Mar 2010 18:24:58 +0300 Subject: [PATCH 1/1] Do not cache settings. --- settings.cpp | 41 ----------------------------------------- settings.hpp | 3 --- 2 files changed, 44 deletions(-) diff --git a/settings.cpp b/settings.cpp index 53966fc..a08f07f 100644 --- a/settings.cpp +++ b/settings.cpp @@ -24,9 +24,6 @@ void Settings::load () _checks[C_UpdateOnGSM] = settings.value ("checks/updateOnGSM", _checks[C_UpdateOnGSM]).toBool (); _checks[C_UpdateWhenLocked] = settings.value ("checks/updateWhenLocked", _checks[C_UpdateWhenLocked]).toBool (); - // Do we really need to cache cities? - // loadCities (&settings); - _updateIntervalIndex = minutes2IntervalIndex (settings.value ("updateInterval", intervalIndex2Minutes (_updateIntervalIndex)).toInt ()); _langIndex = settings.value ("langIndex", _langIndex).toInt (); @@ -52,44 +49,6 @@ void Settings::save () settings.setValue ("updateInterval", intervalIndex2Minutes (_updateIntervalIndex)); settings.setValue ("langIndex", _langIndex); - -// saveCities (&settings); -} - - -void Settings::loadCities (QSettings *settings) -{ - QMap v; - QMap::const_iterator it; - - v = settings->value ("cities", v).toMap (); - - if (v.size () == 0) - return; - - it = v.begin (); - _cities.clear (); - - while (it != v.end ()) { - _cities[it.key ()] = it.value ().toString (); - it++; - } -} - - -void Settings::saveCities (QSettings *settings) -{ - QMap v; - QMap::const_iterator it; - - it = _cities.begin (); - - while (it != _cities.end ()) { - v[it.key ()] = it.value (); - it++; - } - - settings->setValue ("cities", v); } diff --git a/settings.hpp b/settings.hpp index cf8aeda..1953f76 100644 --- a/settings.hpp +++ b/settings.hpp @@ -55,9 +55,6 @@ private: void makeDefault (); - void loadCities (QSettings *settings); - void saveCities (QSettings *settings); - int intervalIndex2Minutes (int index) const; int minutes2IntervalIndex (int minutes) const; -- 1.7.9.5