gpslocation.cpp: fix signed vs unsinged int comparison warning

QDateTime::toTime_t() is misleading as it does not return
a C time_t type, but a 'unsigned int' or rather the Qt
'uint' typedef.

To prevent the warning we cast it to 'time_t' and to
comply with the 'lastTime' variable.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2015-11-18 23:46:55 +02:00 committed by Dirk Hohndel
parent 418a345287
commit ebdcc7fd54

View file

@ -67,7 +67,7 @@ void GpsLocation::newPosition(QGeoPositionInfo pos)
// if we have no record stored or if at least the configured minimum
// time has passed or we moved at least the configured minimum distance
if (!nr ||
pos.timestamp().toTime_t() > lastTime + prefs.time_threshold ||
(time_t)pos.timestamp().toTime_t() > lastTime + prefs.time_threshold ||
lastCoord.distanceTo(pos.coordinate()) > prefs.distance_threshold) {
geoSettings->setValue("count", nr + 1);
geoSettings->setValue(QString("gpsFix%1_time").arg(nr), pos.timestamp().toTime_t());