]> git.street.me.uk Git - andy/viking.git/blobdiff - src/googlesearch.c
Using the new icon
[andy/viking.git] / src / googlesearch.c
index f8c58cf68d50c188d9ef1e3a9a2077c529fec982..8037663c633a6d0b5cda980ca155b07b64d4de24 100644 (file)
 #include "curl_download.h"
 
 #define GOOGLE_SEARCH_URL_FMT "http://maps.google.com/maps?q=%s&output=js"
-#define GOOGLE_SEARCH_PATTERN_1 "{center: {lat: "
-#define GOOGLE_SEARCH_PATTERN_2 ",lng: "
+#define GOOGLE_SEARCH_PATTERN_1 "{center:{lat:"
+#define GOOGLE_SEARCH_PATTERN_2 ",lng:"
 
 static gchar *last_search_str = NULL;
 static VikCoord *last_coord = NULL;
 static gchar *last_successful_search_str = NULL;
 
+static DownloadOptions googlesearch_options = { 0, "http://maps.google.com/" };
+
 gchar * a_googlesearch_get_search_string_for_this_place(VikWindow *vw)
 {
   if (!last_coord)
@@ -206,7 +208,7 @@ static int google_search_get_coord(VikWindow *vw, VikViewport *vvp, gchar *srch_
   uri = g_strdup_printf(GOOGLE_SEARCH_URL_FMT, escaped_srch_str);
 
   /* TODO: curl may not be available */
-  if (curl_download_uri(uri, tmp_file)) {  /* error */
+  if (curl_download_uri(uri, tmp_file, &googlesearch_options)) {  /* error */
     fprintf(stderr, "DEBUG: %s() download error\n", __PRETTY_FUNCTION__);
     fclose(tmp_file);
     ret = -1;