core: connect qPref..::time_thresholdChanged to setGpsTimeThreshold

Automate calling of setGpsTimeThreshold when qPref..::time_threshold changes
and thus avoiding the need to call setGpsTimeThreshold directly.

Signed-off-by: Jan Iversen <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-12 12:45:19 +02:00 committed by Dirk Hohndel
parent baa828e900
commit 504e912512

View file

@ -3,6 +3,7 @@
#include "qt-models/gpslistmodel.h"
#include "core/pref.h"
#include "core/qthelper.h"
#include "core/settings/qPrefLocationService.h"
#include <time.h>
#include <unistd.h>
#include <QDebug>
@ -36,6 +37,9 @@ GpsLocation::GpsLocation(void (*showMsgCB)(const char *), QObject *parent) :
userAgent = getUserAgent();
(void)getGpsSource();
loadFromStorage();
// register changes in time threshold
connect(qPrefLocationService::instance(), SIGNAL(qPrefLocationService::time_thresholdChanged()), this, SLOT(setGpsTimeThreshold(int seconds)));
}
GpsLocation *GpsLocation::instance()