summaryrefslogtreecommitdiffstats
path: root/core/qthelper.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-10-26 17:24:49 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-10-26 17:50:52 +0100
commitb02fd072e75987dc92cba80a4321050de24e7e6a (patch)
treee093a640213d3ab2982493b02734524c66281646 /core/qthelper.cpp
parent3f5f851fcb2dd87d51f1a1571c9f642ea9001ed2 (diff)
downloadsubsurface-b02fd072e75987dc92cba80a4321050de24e7e6a.tar.gz
Cleanup: remove dead code in qthelper.cpp
The reverseGeoLookup() function defined in qthelper.cpp has long ago moved to its own compilation unit. It is not even defined in the headers anymore. Remove it and the now unnecessary <QNetwork*> includes. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/qthelper.cpp')
-rw-r--r--core/qthelper.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/core/qthelper.cpp b/core/qthelper.cpp
index 23ccbfec0..7a41f2a3f 100644
--- a/core/qthelper.cpp
+++ b/core/qthelper.cpp
@@ -23,9 +23,6 @@
#include <QDebug>
#include <QStandardPaths>
#include <QJsonDocument>
-#include <QNetworkReply>
-#include <QNetworkRequest>
-#include <QNetworkAccessManager>
#include <QNetworkProxy>
#include <QDateTime>
#include <QImageReader>
@@ -987,31 +984,6 @@ QString get_trip_date_string(timestamp_t when, int nr, bool getday)
}
-extern "C" void reverseGeoLookup(degrees_t latitude, degrees_t longitude, uint32_t uuid)
-{
- QNetworkRequest request;
- QNetworkAccessManager *rgl = new QNetworkAccessManager();
- request.setUrl(QString("http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&accept-language=%1&lat=%2&lon=%3")
- .arg(uiLanguage(NULL)).arg(latitude.udeg / 1000000.0).arg(longitude.udeg / 1000000.0));
- request.setRawHeader("Accept", "text/json");
- request.setRawHeader("User-Agent", getUserAgent().toUtf8());
- QNetworkReply *reply = rgl->get(request);
- QEventLoop loop;
- QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
- loop.exec();
- QJsonParseError errorObject;
- QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll(), &errorObject);
- if (errorObject.error != QJsonParseError::NoError) {
- qDebug() << errorObject.errorString();
- } else {
- QJsonObject obj = jsonDoc.object();
- QJsonObject address = obj.value("address").toObject();
- qDebug() << "found country:" << address.value("country").toString();
- struct dive_site *ds = get_dive_site_by_uuid(uuid);
- ds->notes = add_to_string(ds->notes, "countrytag: %s", qPrintable(address.value("country").toString()));
- }
-}
-
static QMutex hashOfMutex;
static QHash<QString, QString> localFilenameOf;