summaryrefslogtreecommitdiffstats
path: root/core/divesitehelpers.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-04 07:49:56 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-10-04 08:05:09 -0700
commitb19db6afb56947ae04a2a00ab535feda541f328e (patch)
treed6e8d035f7bad8b5746036e93db57bb354259a39 /core/divesitehelpers.cpp
parent8f4a047cf08d3a8a7066b1c5960cf8ddd3773917 (diff)
downloadsubsurface-b19db6afb56947ae04a2a00ab535feda541f328e.tar.gz
White space and clarifying braces
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/divesitehelpers.cpp')
-rw-r--r--core/divesitehelpers.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/core/divesitehelpers.cpp b/core/divesitehelpers.cpp
index fb1d283a3..f9ece95e4 100644
--- a/core/divesitehelpers.cpp
+++ b/core/divesitehelpers.cpp
@@ -19,7 +19,8 @@
#include <QEventLoop>
#include <QTimer>
-ReverseGeoLookupThread* ReverseGeoLookupThread::instance() {
+ReverseGeoLookupThread* ReverseGeoLookupThread::instance()
+{
static ReverseGeoLookupThread* self = new ReverseGeoLookupThread();
return self;
}
@@ -28,8 +29,8 @@ ReverseGeoLookupThread::ReverseGeoLookupThread(QObject *obj) : QThread(obj)
{
}
-void ReverseGeoLookupThread::run() {
-
+void ReverseGeoLookupThread::run()
+{
QNetworkRequest request;
QNetworkAccessManager *rgl = new QNetworkAccessManager();
QEventLoop loop;
@@ -54,9 +55,9 @@ void ReverseGeoLookupThread::run() {
timer.start(5000); // 5 secs. timeout
loop.exec();
- if(timer.isActive()) {
+ if (timer.isActive()) {
timer.stop();
- if(reply->error() > 0) {
+ if (reply->error() > 0) {
report_error("got error accessing geonames.org: %s", qPrintable(reply->errorString()));
goto clear_reply;
}
@@ -95,7 +96,7 @@ void ReverseGeoLookupThread::run() {
if (firstData[taxonomy_api_names[j]].isValid()) {
ds->taxonomy.category[ri].category = j;
ds->taxonomy.category[ri].origin = taxonomy_origin::GEOCODED;
- free((void*)ds->taxonomy.category[ri].value);
+ free((void *)ds->taxonomy.category[ri].value);
ds->taxonomy.category[ri].value = copy_string(qPrintable(firstData[taxonomy_api_names[j]].toString()));
ri++;
}
@@ -128,9 +129,9 @@ void ReverseGeoLookupThread::run() {
connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
timer.start(5000); // 5 secs. timeout
loop.exec();
- if(timer.isActive()) {
+ if (timer.isActive()) {
timer.stop();
- if(reply->error() > 0) {
+ if (reply->error() > 0) {
report_error("got error accessing oceans API of geonames.org: %s", qPrintable(reply->errorString()));
goto clear_reply;
}