summaryrefslogtreecommitdiff
path: root/src/positioning
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-05-26 03:00:44 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-05-26 03:00:44 +0200
commit1ab2112cfc68dbb3d54bebc83ffaece8a6d8e1c5 (patch)
treee065254d1814fce0eaaac43bc132c19571c3eadc /src/positioning
parentde884ff5669fb9a6c0f50e69d6eb2557ca9dea94 (diff)
parent8a7c9fa1a705f7a2fb3f066b755faaa2f4064ceb (diff)
downloadqtlocation-1ab2112cfc68dbb3d54bebc83ffaece8a6d8e1c5.tar.gz
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I62794d052a60f4078d3c6aa3912df5893f7a8585
Diffstat (limited to 'src/positioning')
-rw-r--r--src/positioning/qnmeapositioninfosource.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/positioning/qnmeapositioninfosource.cpp b/src/positioning/qnmeapositioninfosource.cpp
index 282f30b4..63410022 100644
--- a/src/positioning/qnmeapositioninfosource.cpp
+++ b/src/positioning/qnmeapositioninfosource.cpp
@@ -243,13 +243,18 @@ static int processSentence(QGeoPositionInfo &info,
// the sentences containing the full timestamp (e.g., GPRMC) *first* !
if (infoTime.isValid()) {
if (pos.timestamp().time().isValid()) {
- if (infoTime != pos.timestamp().time() || infoDate != pos.timestamp().date()) {
- // Effectively read data for different update, so copy buf into m_nextLine
+ if (infoTime < pos.timestamp().time() ||
+ (infoDate.isValid() // if time is valid but one date or both are not,
+ && pos.timestamp().date().isValid()
+ && infoDate < pos.timestamp().date())) {
+ // Effectively read data for different update, that is also newer, so copy buf into m_nextLine
m_nextLine = QByteArray(buf, size);
break;
} else {
- // timestamps match -- merge into info
- mergePositions(info, pos, QByteArray(buf, size));
+ if (infoTime == pos.timestamp().time())
+ // timestamps match -- merge into info
+ mergePositions(info, pos, QByteArray(buf, size));
+ // else discard out of order outdated info.
}
} else {
// no timestamp available -- merge into info