This renames the local name for the location as town and adds the concept
of a city as the level 3 admin category. In some regions (e.g. at times in
Italy) the local hamlet name is shown as toponymName but the name of the
actual city is given as adminName3.
With this change "city" will always reflect our best guess: adminName3 if
it exists, otherwise the toponymName. Whereas "town" is always the
toponymName.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
There are a number of web servies we could use. All have their drawbacks.
This one is free with free data. It's daily limits are reasonably high.
For many coordinates I tested the results were good, for others at least
not terrible.
We can always consider supporting multiple such services. But for now this
seems like a reasonable choice.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
GeoLocation discovery would hang if on an incorrectly configured proxy -
this way we will finish as soon as it tries to get everything.
I also need to see what to do with the dive sites if it fails to find any.
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This makes Subsurface usable faster for those without a good internet
connection when they are opening an older data file.
While parsing, we are only feeding an vector of locations, after the
parsing is done, we traverse the vector searching for the information on
the web.
I need to also add a way to stop if there`s no internet connection - but
this will be another patch.
Also, fixed two small memory leaks from the old imp.
[Dirk Hohndel: cleaned up the whitespace mess]
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We had a ton of helper functions in qt-gui.cpp which really didn't make
much sense. So I moved them all into qthelper.cpp.
Also moved the UserAgent helper that didn't belong in the UpdateHandler to
begin with - that's a generic helper used in many places...
With this we can successfully build using cmake again.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>