mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Preferences tests: location updates & bug fix
Fixed loading the location preferences. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7f60951e75
commit
3966f3e7dd
3 changed files with 14 additions and 8 deletions
|
@ -2229,13 +2229,6 @@ void SettingsObjectWrapper::load()
|
|||
// Subsurface webservice id is stored outside of the groups
|
||||
GET_TXT("subsurface_webservice_uid", userid);
|
||||
|
||||
// but the related time / distance threshold (only used in the mobile app)
|
||||
// are in their own group
|
||||
s.beginGroup("locationService");
|
||||
GET_INT("distance_threshold", distance_threshold);
|
||||
GET_INT("time_threshold", time_threshold);
|
||||
s.endGroup();
|
||||
|
||||
// GeoManagement
|
||||
s.beginGroup("geocoding");
|
||||
|
||||
|
|
|
@ -668,7 +668,7 @@ signals:
|
|||
void timeThresholdChanged(int value);
|
||||
void distanceThresholdChanged(int value);
|
||||
private:
|
||||
const QString group = QStringLiteral("locationService");
|
||||
const QString group = QStringLiteral("LocationService");
|
||||
};
|
||||
|
||||
class SettingsObjectWrapper : public QObject {
|
||||
|
|
|
@ -537,6 +537,19 @@ void TestPreferences::testPreferences()
|
|||
TEST(pref->animation_settings->animationSpeed(), 20);
|
||||
pref->animation_settings->setAnimationSpeed(30);
|
||||
TEST(pref->animation_settings->animationSpeed(), 30);
|
||||
|
||||
auto location = pref->location_settings;
|
||||
location->setTimeThreshold(10);
|
||||
location->setDistanceThreshold(20);
|
||||
|
||||
TEST(location->timeThreshold(), 10);
|
||||
TEST(location->distanceThreshold(), 20);
|
||||
|
||||
location->setTimeThreshold(30);
|
||||
location->setDistanceThreshold(40);
|
||||
|
||||
TEST(location->timeThreshold(), 30);
|
||||
TEST(location->distanceThreshold(), 40);
|
||||
}
|
||||
|
||||
QTEST_MAIN(TestPreferences)
|
||||
|
|
Loading…
Add table
Reference in a new issue