#include <glib/gi18n.h>
#include "viking.h"
-#include "util.h"
#include "geonamessearch.h"
/* Compatibility */
// 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\": "
}
geoname_runner = g_list_next(geoname_runner);
}
+ g_free ( name );
}
}
while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL(store), &iter ) );
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;
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);
}