X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/644eea0ee18cdfc110d4cb28f16842d0e2fc0b46..2b15210588ccba075627193d012a7d3ca87cb02c:/src/geonamessearch.c?ds=sidebyside diff --git a/src/geonamessearch.c b/src/geonamessearch.c index 0fd93802..adae00da 100644 --- a/src/geonamessearch.c +++ b/src/geonamessearch.c @@ -31,7 +31,6 @@ #include #include "viking.h" -#include "util.h" #include "geonamessearch.h" /* Compatibility */ @@ -48,7 +47,7 @@ // ATM decided it's not essential enough to warrant putting in the preferences #define GEONAMES_MAX_ENTRIES 20 -#define GEONAMES_WIKIPEDIA_URL_FMT "http://ws.geonames.org/wikipediaBoundingBoxJSON?formatted=true&north=%s&south=%s&east=%s&west=%s&lang=%s&maxRows=%d" +#define GEONAMES_WIKIPEDIA_URL_FMT "http://api.geonames.org/wikipediaBoundingBoxJSON?formatted=true&north=%s&south=%s&east=%s&west=%s&lang=%s&maxRows=%d&username=viking" #define GEONAMES_FEATURE_PATTERN "\"feature\": \"" #define GEONAMES_LONGITUDE_PATTERN "\"lng\": " @@ -442,7 +441,7 @@ void a_geonames_wikipedia_box ( VikWindow *vw, VikTrwLayer *vtl, struct LatLon m wiki_places = get_entries_from_file(tmpname); if (g_list_length(wiki_places) == 0) { none_found(vw); - return; + goto done; } selected = a_select_geoname_from_list(VIK_GTK_WINDOW_FROM_WIDGET(vw), wiki_places, TRUE, "Select articles", "Select the articles you want to add."); wp_runner = selected; @@ -475,8 +474,7 @@ void a_geonames_wikipedia_box ( VikWindow *vw, VikTrwLayer *vtl, struct LatLon m free_geoname_list(wiki_places); free_geoname_list(selected); g_free(uri); - if (tmpname) { - g_remove(tmpname); - g_free(tmpname); - } +done: + (void)util_remove(tmpname); + g_free(tmpname); }