X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=settings.cpp;h=6831ecb2fb3758b37b4c17d60dfb8c73fe0c7aef;hb=d74b319334d55850fea12c7c7d88cefdfae47b54;hp=8d3b83c3d135a64af5452708c73b03d11c91f7ae;hpb=8c66bcb205f87c715103ef291495a4bcd107bbe0;p=yandex-traffic diff --git a/settings.cpp b/settings.cpp index 8d3b83c..6831ecb 100644 --- a/settings.cpp +++ b/settings.cpp @@ -22,6 +22,7 @@ void Settings::load () _checks[C_ShowHint] = settings.value ("checks/hint", _checks[C_ShowHint]).toBool (); _checks[C_UpdateOnWiFi] = settings.value ("checks/updateOnWifi", _checks[C_UpdateOnWiFi]).toBool (); _checks[C_UpdateOnGSM] = settings.value ("checks/updateOnGSM", _checks[C_UpdateOnGSM]).toBool (); + _checks[C_UpdateWhenLocked] = settings.value ("checks/updateWhenLocked", _checks[C_UpdateWhenLocked]).toBool (); loadCities (&settings); @@ -41,6 +42,7 @@ void Settings::save () settings.setValue ("checks/hint", _checks[C_ShowHint]); settings.setValue ("checks/updateOnWifi", _checks[C_UpdateOnWiFi]); settings.setValue ("checks/updateOnGSM", _checks[C_UpdateOnGSM]); + settings.setValue ("checks/updateWhenLocked", _checks[C_UpdateWhenLocked]); settings.setValue ("updateInterval", intervalIndex2Minutes (_updateIntervalIndex)); @@ -99,6 +101,8 @@ void Settings::makeDefault () setCheck (C_UpdateOnWiFi, true); + setCheck (C_UpdateWhenLocked, true); + _updateIntervalIndex = 3; } @@ -122,7 +126,7 @@ int Settings::intervalIndex2Minutes (int index) const { int int2min[] = { -1, 1, 2, 5, 15, 30 }; - if (index < 0 || sizeof (int2min) / sizeof (int2min[0]) <= index) + if (index < 0 || sizeof (int2min) / sizeof (int2min[0]) <= (unsigned int)index) return -1; return int2min[index];