Navigation Menu

Skip to content

Commit

Permalink
[mer][qtlocation] Let satellite infos be hardware driven. Contributes…
Browse files Browse the repository at this point in the history
… to JB#41029

Quites from docs QGeoSatelliteInfoSource::updateInterval:
"If the update interval is not set (or is set to 0) the source will provide
updates as often as necessary."

"If the requested interval is less than the minimumUpdateInterval(),
the minimum interval is used instead."
  • Loading branch information
rainemak committed Apr 10, 2018
1 parent 1114406 commit 0109d56
Showing 1 changed file with 5 additions and 8 deletions.
Expand Up @@ -74,10 +74,7 @@ int QGeoSatelliteInfoSourceGeoclueMaster::minimumUpdateInterval() const

void QGeoSatelliteInfoSourceGeoclueMaster::setUpdateInterval(int msec)
{
if (msec < 0 || (msec > 0 && msec < MINIMUM_UPDATE_INTERVAL))
msec = MINIMUM_UPDATE_INTERVAL;

QGeoSatelliteInfoSource::setUpdateInterval(msec);
QGeoSatelliteInfoSource::setUpdateInterval(qMax(MINIMUM_UPDATE_INTERVAL, msec));
}

QGeoSatelliteInfoSource::Error QGeoSatelliteInfoSourceGeoclueMaster::error() const
Expand All @@ -96,7 +93,7 @@ void QGeoSatelliteInfoSourceGeoclueMaster::startUpdates()
if (!m_master->hasMasterClient())
configureSatelliteSource();

m_requestTimer.start(updateInterval());
m_requestTimer.start(qMax(updateInterval(), minimumUpdateInterval()));
}

void QGeoSatelliteInfoSourceGeoclueMaster::stopUpdates()
Expand Down Expand Up @@ -147,6 +144,7 @@ void QGeoSatelliteInfoSourceGeoclueMaster::updateSatelliteInfo(int timestamp, in
const QList<int> &usedPrn,
const QList<QGeoSatelliteInfo> &satInfos)
{
m_requestTimer.stop();
Q_UNUSED(timestamp)

QList<QGeoSatelliteInfo> inUse;
Expand All @@ -172,8 +170,6 @@ void QGeoSatelliteInfoSourceGeoclueMaster::updateSatelliteInfo(int timestamp, in

m_inUse = inUse;
emit satellitesInUseUpdated(m_inUse);

m_requestTimer.start(updateInterval());
}

void QGeoSatelliteInfoSourceGeoclueMaster::requestUpdateTimeout()
Expand Down Expand Up @@ -201,7 +197,6 @@ void QGeoSatelliteInfoSourceGeoclueMaster::getSatelliteFinished(QDBusPendingCall
if (reply.isError())
return;

m_requestTimer.stop();
updateSatelliteInfo(reply.argumentAt<0>(), reply.argumentAt<1>(), reply.argumentAt<2>(),
reply.argumentAt<3>(), reply.argumentAt<4>());
}
Expand Down Expand Up @@ -305,6 +300,8 @@ void QGeoSatelliteInfoSourceGeoclueMaster::cleanupSatelliteSource()
m_provider = 0;
delete m_sat;
m_sat = 0;

m_requestTimer.stop();
}

QT_END_NAMESPACE

0 comments on commit 0109d56

Please sign in to comment.