mobile: remove getCurrentPosition interface

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2021-09-11 16:36:54 -07:00
parent bea552bf0d
commit ea751928aa
2 changed files with 0 additions and 30 deletions

View file

@ -999,17 +999,6 @@ bool QMLManager::checkLocation(DiveSiteChange &res, struct dive *d, QString loca
qDebug() << "parsed GPS, using it"; qDebug() << "parsed GPS, using it";
// there are valid GPS coordinates - just use them // there are valid GPS coordinates - just use them
setupDivesite(res, d, ds, lat, lon, qPrintable(location)); setupDivesite(res, d, ds, lat, lon, qPrintable(location));
} else if (gps == GPS_CURRENT_POS) {
qDebug() << "gps was our default text for no GPS";
// user asked to use current pos
QString gpsString = getCurrentPosition();
if (gpsString != GPS_CURRENT_POS) {
qDebug() << "but now I got a valid location" << gpsString;
if (parseGpsText(qPrintable(gpsString), &lat, &lon))
setupDivesite(res, d, ds, lat, lon, qPrintable(location));
} else {
appendTextToLog("couldn't get GPS location in time");
}
} else { } else {
// just something we can't parse, so tell the user // just something we can't parse, so tell the user
appendTextToLog(QString("wasn't able to parse gps string '%1'").arg(gps)); appendTextToLog(QString("wasn't able to parse gps string '%1'").arg(gps));
@ -1655,24 +1644,6 @@ int QMLManager::addDive()
return diveId; return diveId;
} }
QString QMLManager::getCurrentPosition()
{
static bool hasLocationSource = false;
if (GpsLocation::instance()->hasLocationsSource() != hasLocationSource) {
hasLocationSource = !hasLocationSource;
setLocationServiceAvailable(hasLocationSource);
}
if (!hasLocationSource)
return tr("Unknown GPS location");
QString positionResponse = GpsLocation::instance()->currentPosition();
if (positionResponse == GPS_CURRENT_POS)
connect(GpsLocation::instance(), &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged, Qt::UniqueConnection);
else
disconnect(GpsLocation::instance(), &GpsLocation::acquiredPosition, this, &QMLManager::waitingForPositionChanged);
return positionResponse;
}
void QMLManager::applyGpsData() void QMLManager::applyGpsData()
{ {
appendTextToLog("Applying GPS fiexs"); appendTextToLog("Applying GPS fiexs");

View file

@ -223,7 +223,6 @@ public slots:
void finishSetup(); void finishSetup();
QString getNumber(const QString& diveId); QString getNumber(const QString& diveId);
QString getDate(const QString& diveId); QString getDate(const QString& diveId);
QString getCurrentPosition();
QString getGpsFromSiteName(const QString& siteName); QString getGpsFromSiteName(const QString& siteName);
QString getVersion() const; QString getVersion() const;
void deleteGpsFix(quint64 when); void deleteGpsFix(quint64 when);