]> git.street.me.uk Git - andy/viking.git/blobdiff - src/googlesearch.c
Allow to select between Google and Geonames for searching method
[andy/viking.git] / src / googlesearch.c
index b7c7a72970c719c4cf10261a2eea3d3ef63994d6..2e2749de2aed4243cda1a0b68561a5fe842b085c 100644 (file)
@@ -31,6 +31,7 @@
 #include <glib/gi18n.h>
 
 #include "viking.h"
+#include "util.h"
 #include "curl_download.h"
 
 #define GOOGLE_SEARCH_URL_FMT "http://maps.google.com/maps?q=%s&output=js"
@@ -179,27 +180,6 @@ done:
 
 }
 
-gchar *uri_escape(gchar *str)
-{
-  gchar *esc_str = g_malloc(3*strlen(str));
-  gchar *dst = esc_str;
-  gchar *src;
-
-  for (src = str; *src; src++) {
-    if (*src == ' ')
-     *dst++ = '+';
-    else if (g_ascii_isalnum(*src))
-     *dst++ = *src;
-    else {
-      g_sprintf(dst, "%%%02X", *src);
-      dst += 3;
-    }
-  }
-  *dst = '\0';
-
-  return(esc_str);
-}
-
 static int google_search_get_coord(VikWindow *vw, VikViewport *vvp, gchar *srch_str, VikCoord *coord)
 {
   FILE *tmp_file;