[PATCH] Fix typo, loockup -> lookup and Loockup -> Lookup

"Paul-Erik Törrönen" poltsi at 777-team.org
Fri May 15 14:27:08 PDT 2015


I hope I don't botch this up...

I pulled the latest master from git, and tried to compile the source on a
Fedora 22(beta).

There seems to currently be missing some definitions of functions, as the
compilation fails at the linking stage with the following messages.

compiling .moc/moc_mainwindow.cpp
linking subsurface
.obj/parse-xml.o: In function `gps_in_dive':
/home/poltsi/Work/Other/subsurface/parse-xml.c:1209: undefined reference
to `add_geo_information_for_loockup'
.obj/mainwindow.o: In function `MainWindow::MainWindow()':
/home/poltsi/Work/Other/subsurface/qt-ui/mainwindow.cpp:204: undefined
reference to `ReverseGeoLoockupThread::instance()'
.obj/mainwindow.o: In function `MainWindow::loadFiles(QStringList)':
/home/poltsi/Work/Other/subsurface/qt-ui/mainwindow.cpp:1462: undefined
reference to `ReverseGeoLoockupThread::instance()'
collect2: error: ld returned 1 exit status
Makefile:647: recipe for target 'subsurface' failed
make: *** [subsurface] Error 1

If I understood the changes correctly, this was introduced by Tomaz on the
10. of May.

Besides the obvious typo (consistent loockup -> lookup), the functions
seems to be undefined, and I can find nothing besides declarations of
them.

At the end should be a patch for fixing the typos, however since this does
not fix (for me at least) the errors, I have no way to certify that the
patch works...

Poltsi

Signed-off-by: Paul-Erik Törrönen <poltsi at 777-team.org>
---
 divesitehelpers.cpp  | 22 +++++++++++-----------
 divesitehelpers.h    |  6 +++---
 parse-xml.c          |  4 ++--
 qt-ui/mainwindow.cpp |  8 ++++----
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/divesitehelpers.cpp b/divesitehelpers.cpp
index cc45851..8564ce2 100644
--- a/divesitehelpers.cpp
+++ b/divesitehelpers.cpp
@@ -17,25 +17,25 @@
 #include <QUrlQuery>
 #include <QEventLoop>

-struct GeoLoockupInfo {
+struct GeoLookupInfo {
 	degrees_t lat;
 	degrees_t lon;
 	uint32_t uuid;
 };

-QVector<GeoLoockupInfo> geo_loockup_data;
+QVector<GeoLookupInfo> geo_lookup_data;

-ReverseGeoLoockupThread* ReverseGeoLoockupThread::instance() {
-	static ReverseGeoLoockupThread* self = new ReverseGeoLoockupThread();
+ReverseGeoLookupThread* ReverseGeoLookupThread::instance() {
+	static ReverseGeoLookupThread* self = new ReverseGeoLookupThread();
 	return self;
 }

-ReverseGeoLoockupThread::ReverseGeoLoockupThread(QObject *obj) :
QThread(obj)
+ReverseGeoLookupThread::ReverseGeoLookupThread(QObject *obj) : QThread(obj)
 {
 }

-void ReverseGeoLoockupThread::run() {
-	if (geo_loockup_data.isEmpty())
+void ReverseGeoLookupThread::run() {
+	if (geo_lookup_data.isEmpty())
 		return;

 	QNetworkRequest request;
@@ -44,7 +44,7 @@ void ReverseGeoLoockupThread::run() {
 	request.setRawHeader("User-Agent", getUserAgent().toUtf8());
 	QEventLoop loop;
 	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));
 		QNetworkReply *reply = rgl->get(request);
 		QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
@@ -66,11 +66,11 @@ void ReverseGeoLoockupThread::run() {
 	rgl->deleteLater();
 }

-extern "C" void add_geo_information_for_loockup(degrees_t latitude,
degrees_t longitude, uint32_t uuid) {
-	GeoLoockupInfo info;
+extern "C" void add_geo_information_for_lookup(degrees_t latitude,
degrees_t longitude, uint32_t uuid) {
+	GeoLookupInfo info;
 	info.lat = latitude;
 	info.lon = longitude;
 	info.uuid = uuid;

-	geo_loockup_data.append(info);
+	geo_lookup_data.append(info);
 }
diff --git a/divesitehelpers.h b/divesitehelpers.h
index 68c1956..dad60be 100644
--- a/divesitehelpers.h
+++ b/divesitehelpers.h
@@ -4,14 +4,14 @@
 #include "units.h"
 #include <QThread>

-class ReverseGeoLoockupThread : public QThread {
+class ReverseGeoLookupThread : public QThread {
 Q_OBJECT
 public:
-	static ReverseGeoLoockupThread *instance();
+	static ReverseGeoLookupThread *instance();
 	void run() Q_DECL_OVERRIDE;

 private:
-	ReverseGeoLoockupThread(QObject *parent = 0);
+	ReverseGeoLookupThread(QObject *parent = 0);
 };

 #endif // DIVESITEHELPERS_H
diff --git a/parse-xml.c b/parse-xml.c
index 9f748cd..fdb1b39 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -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 */
 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)
 {
@@ -1206,7 +1206,7 @@ static void gps_in_dive(char *buffer, struct dive
*dive)
 		}
 	}
 	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)
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 97c68af..302fde9 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -201,9 +201,9 @@ MainWindow::MainWindow() : QMainWindow(),
 	undoRedoActions.append(redoAction);
 	ui.menu_Edit->addActions(undoRedoActions);

-	ReverseGeoLoockupThread *geoLoockup = ReverseGeoLoockupThread::instance();
-	connect(geoLoockup, SIGNAL(start()),information(), SLOT(setDisabled()));
-	connect(geoLoockup, SIGNAL(finished()), information(), SLOT(setEnabled()));
+	ReverseGeoLookupThread *geoLookup = ReverseGeoLookupThread::instance();
+	connect(geoLookup, SIGNAL(start()),information(), SLOT(setDisabled()));
+	connect(geoLookup, SIGNAL(finished()), information(), SLOT(setEnabled()));
 }

 MainWindow::~MainWindow()
@@ -1459,7 +1459,7 @@ void MainWindow::loadFiles(const QStringList fileNames)

 	// searches for geo lookup information in a thread so it doesn`t
 	// freezes the ui.
-	ReverseGeoLoockupThread::instance()->start();
+	ReverseGeoLookupThread::instance()->start();

 	refreshDisplay();
 	ui.actionAutoGroup->setChecked(autogroup);
-- 
2.4.0




More information about the subsurface mailing list