diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-03-22 16:43:21 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-03-22 12:01:09 -0700 |
commit | eb55ffde16f0f3c1df4c97c5229165acfda5637d (patch) | |
tree | ab19de3aaadbb1a8b14d80519eb3b894a1f384eb /core/divesitehelpers.cpp | |
parent | 2dca7d0ce5ba4045732f3fcd6c8a1170b4ad902f (diff) | |
download | subsurface-eb55ffde16f0f3c1df4c97c5229165acfda5637d.tar.gz |
cleanup: split uiLanguage() in two functions
The uiLanguage() function was used for two purposes: to initialize
the language related preferences and to read the current language.
To make things more easy to follow, split this function in two:
one for initializing, one for getting the current language.
Moreover, don't return the current locale in an out-parameter
as there is already a function to do that [getLocale()].
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/divesitehelpers.cpp')
-rw-r--r-- | core/divesitehelpers.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/divesitehelpers.cpp b/core/divesitehelpers.cpp index 6dc6b012a..b2bb400a7 100644 --- a/core/divesitehelpers.cpp +++ b/core/divesitehelpers.cpp @@ -39,7 +39,7 @@ void reverseGeoLookup(degrees_t latitude, degrees_t longitude, taxonomy_data *ta QObject::connect(&timer, SIGNAL(timeout()), &loop, SLOT(quit())); // first check the findNearbyPlaces API from geonames - that should give us country, state, city - request.setUrl(geonamesURL.arg(uiLanguage(NULL).section(QRegExp("[-_ ]"), 0, 0)).arg(latitude.udeg / 1000000.0).arg(longitude.udeg / 1000000.0)); + request.setUrl(geonamesURL.arg(getUiLanguage().section(QRegExp("[-_ ]"), 0, 0)).arg(latitude.udeg / 1000000.0).arg(longitude.udeg / 1000000.0)); // By using a std::unique_ptr<>, we can exit from the function at any point // and the reply will be freed. Likewise, when overwriting the pointer with @@ -119,7 +119,7 @@ void reverseGeoLookup(degrees_t latitude, degrees_t longitude, taxonomy_data *ta reply->abort(); } // next check the oceans API to figure out the body of water - request.setUrl(geonamesOceanURL.arg(uiLanguage(NULL).section(QRegExp("[-_ ]"), 0, 0)).arg(latitude.udeg / 1000000.0).arg(longitude.udeg / 1000000.0)); + request.setUrl(geonamesOceanURL.arg(getUiLanguage().section(QRegExp("[-_ ]"), 0, 0)).arg(latitude.udeg / 1000000.0).arg(longitude.udeg / 1000000.0)); reply.reset(rgl.get(request)); // Note: frees old reply. QObject::connect(&*reply, SIGNAL(finished()), &loop, SLOT(quit())); timer.start(5000); // 5 secs. timeout |