]> git.street.me.uk Git - andy/viking.git/blobdiff - src/dialog.c
Allow to select between Google and Geonames for searching method
[andy/viking.git] / src / dialog.c
index 071092ed6d0923fad2582b69baacf6012d4a2323..06965fd15095e230f2e963403b1e7f6f5d0b5afe 100644 (file)
 #include "garminsymbols.h"
 #include "degrees_converters.h"
 #include "authors.h"
+#ifdef VIK_CONFIG_GOOGLE
+#include "googlesearch.h"
+#endif
+#ifdef VIK_CONFIG_GEONAMES
 #include "geonamessearch.h"
+#endif
 #include "util.h"
 
 #include <glib/gi18n.h>
@@ -239,7 +244,15 @@ gboolean a_dialog_new_waypoint ( GtkWindow *parent, gchar **dest, VikWaypoint *w
 
   commentlabel = gtk_label_new (_("Comment:"));
   commententry = gtk_entry_new ();
-  gchar *cmt =  a_geonamessearch_get_search_string_for_this_place(VIK_WINDOW(parent));
+  gchar *cmt =  NULL;
+#if defined(VIK_CONFIG_GOOGLE) && VIK_CONFIG_SEARCH==VIK_CONFIG_SEARCH_GOOGLE
+  //if (strcmp(VIK_CONFIG_SEARCH,"google"))
+    cmt =  a_googlesearch_get_search_string_for_this_place(VIK_WINDOW(parent));
+#endif
+#if defined(VIK_CONFIG_GEONAMES) && VIK_CONFIG_SEARCH==VIK_CONFIG_SEARCH_GEONAMES
+  //if (strcmp(VIK_CONFIG_SEARCH,"geonames"))
+    cmt =  a_geonamessearch_get_search_string_for_this_place(VIK_WINDOW(parent));
+#endif
   if (cmt)
     gtk_entry_set_text(GTK_ENTRY(commententry), cmt);