mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix typo
Loockup -> Lookup Signed-off-by: Paul-Erik Törrönen <poltsi@777-team.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
00b1469658
commit
cfa5403192
6 changed files with 24 additions and 24 deletions
|
@ -17,25 +17,25 @@
|
||||||
#include <QUrlQuery>
|
#include <QUrlQuery>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
|
||||||
struct GeoLoockupInfo {
|
struct GeoLookupInfo {
|
||||||
degrees_t lat;
|
degrees_t lat;
|
||||||
degrees_t lon;
|
degrees_t lon;
|
||||||
uint32_t uuid;
|
uint32_t uuid;
|
||||||
};
|
};
|
||||||
|
|
||||||
QVector<GeoLoockupInfo> geo_loockup_data;
|
QVector<GeoLookupInfo> geo_lookup_data;
|
||||||
|
|
||||||
ReverseGeoLoockupThread* ReverseGeoLoockupThread::instance() {
|
ReverseGeoLookupThread* ReverseGeoLookupThread::instance() {
|
||||||
static ReverseGeoLoockupThread* self = new ReverseGeoLoockupThread();
|
static ReverseGeoLookupThread* self = new ReverseGeoLookupThread();
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReverseGeoLoockupThread::ReverseGeoLoockupThread(QObject *obj) : QThread(obj)
|
ReverseGeoLookupThread::ReverseGeoLookupThread(QObject *obj) : QThread(obj)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReverseGeoLoockupThread::run() {
|
void ReverseGeoLookupThread::run() {
|
||||||
if (geo_loockup_data.isEmpty())
|
if (geo_lookup_data.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QNetworkRequest request;
|
QNetworkRequest request;
|
||||||
|
@ -44,7 +44,7 @@ void ReverseGeoLoockupThread::run() {
|
||||||
request.setRawHeader("User-Agent", getUserAgent().toUtf8());
|
request.setRawHeader("User-Agent", getUserAgent().toUtf8());
|
||||||
QEventLoop loop;
|
QEventLoop loop;
|
||||||
QString apiCall("http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&accept-language=%1&lat=%2&lon=%3");
|
QString apiCall("http://open.mapquestapi.com/nominatim/v1/reverse.php?format=json&accept-language=%1&lat=%2&lon=%3");
|
||||||
Q_FOREACH (const GeoLoockupInfo& info, geo_loockup_data ) {
|
Q_FOREACH (const GeoLookupInfo& info, geo_lookup_data ) {
|
||||||
request.setUrl(apiCall.arg(uiLanguage(NULL)).arg(info.lat.udeg / 1000000.0).arg(info.lon.udeg / 1000000.0));
|
request.setUrl(apiCall.arg(uiLanguage(NULL)).arg(info.lat.udeg / 1000000.0).arg(info.lon.udeg / 1000000.0));
|
||||||
QNetworkReply *reply = rgl->get(request);
|
QNetworkReply *reply = rgl->get(request);
|
||||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||||
|
@ -66,11 +66,11 @@ void ReverseGeoLoockupThread::run() {
|
||||||
rgl->deleteLater();
|
rgl->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void add_geo_information_for_loockup(degrees_t latitude, degrees_t longitude, uint32_t uuid) {
|
extern "C" void add_geo_information_for_lookup(degrees_t latitude, degrees_t longitude, uint32_t uuid) {
|
||||||
GeoLoockupInfo info;
|
GeoLookupInfo info;
|
||||||
info.lat = latitude;
|
info.lat = latitude;
|
||||||
info.lon = longitude;
|
info.lon = longitude;
|
||||||
info.uuid = uuid;
|
info.uuid = uuid;
|
||||||
|
|
||||||
geo_loockup_data.append(info);
|
geo_lookup_data.append(info);
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
#include "units.h"
|
#include "units.h"
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
class ReverseGeoLoockupThread : public QThread {
|
class ReverseGeoLookupThread : public QThread {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static ReverseGeoLoockupThread *instance();
|
static ReverseGeoLookupThread *instance();
|
||||||
void run() Q_DECL_OVERRIDE;
|
void run() Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ReverseGeoLoockupThread(QObject *parent = 0);
|
ReverseGeoLookupThread(QObject *parent = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DIVESITEHELPERS_H
|
#endif // DIVESITEHELPERS_H
|
||||||
|
|
|
@ -1167,7 +1167,7 @@ static void gps_location(char *buffer, struct dive_site *ds)
|
||||||
|
|
||||||
/* this is in qthelper.cpp, so including the .h file is a pain */
|
/* this is in qthelper.cpp, so including the .h file is a pain */
|
||||||
extern const char *printGPSCoords(int lat, int lon);
|
extern const char *printGPSCoords(int lat, int lon);
|
||||||
extern void add_geo_information_for_loockup(degrees_t latitude, degrees_t longitude, uint32_t uuid);
|
extern void add_geo_information_for_lookup(degrees_t latitude, degrees_t longitude, uint32_t uuid);
|
||||||
|
|
||||||
static void gps_in_dive(char *buffer, struct dive *dive)
|
static void gps_in_dive(char *buffer, struct dive *dive)
|
||||||
{
|
{
|
||||||
|
@ -1206,7 +1206,7 @@ static void gps_in_dive(char *buffer, struct dive *dive)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ds && (!ds->notes || strstr(ds->notes, "countrytag:") == NULL))
|
if (ds && (!ds->notes || strstr(ds->notes, "countrytag:") == NULL))
|
||||||
add_geo_information_for_loockup(latitude, longitude, dive->dive_site_uuid);
|
add_geo_information_for_lookup(latitude, longitude, dive->dive_site_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_dive_site(char *buffer, struct dive *dive)
|
static void add_dive_site(char *buffer, struct dive *dive)
|
||||||
|
|
|
@ -209,13 +209,13 @@ MainTab::~MainTab()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::enableGeoLoockupEdition()
|
void MainTab::enableGeoLookupEdition()
|
||||||
{
|
{
|
||||||
ui.waitingSpinner->stop();
|
ui.waitingSpinner->stop();
|
||||||
ui.manageDiveSite->show();
|
ui.manageDiveSite->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainTab::disableGeoLoockupEdition()
|
void MainTab::disableGeoLookupEdition()
|
||||||
{
|
{
|
||||||
ui.waitingSpinner->start();
|
ui.waitingSpinner->start();
|
||||||
ui.manageDiveSite->hide();
|
ui.manageDiveSite->hide();
|
||||||
|
|
|
@ -94,8 +94,8 @@ slots:
|
||||||
void removeSelectedPhotos();
|
void removeSelectedPhotos();
|
||||||
void prepareDiveSiteEdit();
|
void prepareDiveSiteEdit();
|
||||||
void showLocation();
|
void showLocation();
|
||||||
void enableGeoLoockupEdition();
|
void enableGeoLookupEdition();
|
||||||
void disableGeoLoockupEdition();
|
void disableGeoLookupEdition();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::MainTab ui;
|
Ui::MainTab ui;
|
||||||
|
|
|
@ -202,9 +202,9 @@ MainWindow::MainWindow() : QMainWindow(),
|
||||||
undoRedoActions.append(redoAction);
|
undoRedoActions.append(redoAction);
|
||||||
ui.menu_Edit->addActions(undoRedoActions);
|
ui.menu_Edit->addActions(undoRedoActions);
|
||||||
|
|
||||||
ReverseGeoLoockupThread *geoLoockup = ReverseGeoLoockupThread::instance();
|
ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
|
||||||
connect(geoLoockup, SIGNAL(started()),information(), SLOT(disableGeoLoockupEdition()));
|
connect(geoLookup, SIGNAL(started()),information(), SLOT(disableGeoLookupEdition()));
|
||||||
connect(geoLoockup, SIGNAL(finished()), information(), SLOT(enableGeoLoockupEdition()));
|
connect(geoLookup, SIGNAL(finished()), information(), SLOT(enableGeoLookupEdition()));
|
||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow()
|
MainWindow::~MainWindow()
|
||||||
|
@ -1460,7 +1460,7 @@ void MainWindow::loadFiles(const QStringList fileNames)
|
||||||
|
|
||||||
// searches for geo lookup information in a thread so it doesn`t
|
// searches for geo lookup information in a thread so it doesn`t
|
||||||
// freezes the ui.
|
// freezes the ui.
|
||||||
ReverseGeoLoockupThread::instance()->start();
|
ReverseGeoLookupThread::instance()->start();
|
||||||
|
|
||||||
refreshDisplay();
|
refreshDisplay();
|
||||||
ui.actionAutoGroup->setChecked(autogroup);
|
ui.actionAutoGroup->setChecked(autogroup);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue