]> git.street.me.uk Git - andy/viking.git/blobdiff - src/geonamessearch.c
Reduce compiler warnings on Windows.
[andy/viking.git] / src / geonamessearch.c
index 1f72cd3af3b1acb7f825cbd214586b3439d74080..adae00dab43ff7a5d124f33c64498de01719ab83 100644 (file)
@@ -31,7 +31,6 @@
 #include <glib/gi18n.h>
 
 #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\": "
@@ -230,6 +229,7 @@ static GList *a_select_geoname_from_list(GtkWindow *parent, GList *geonames, gbo
             }
             geoname_runner = g_list_next(geoname_runner);
           }
+         g_free ( name );
         }
       }
       while ( gtk_tree_model_iter_next ( GTK_TREE_MODEL(store), &iter ) );
@@ -441,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;
@@ -474,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);
 }