]> git.street.me.uk Git - andy/viking.git/commitdiff
Fix availability of the Google routing direction engine
authorRob Norris <rw_norris@hotmail.com>
Thu, 16 Apr 2015 22:56:07 +0000 (23:56 +0100)
committerRob Norris <rw_norris@hotmail.com>
Thu, 16 Apr 2015 23:14:54 +0000 (00:14 +0100)
src/google.c
src/google.h
src/modules.c

index 7dc09a1edc6b72fddc18b8e6e368c00ad7f0d0d1..98b01fa64ae1f78e1715ad35ec6ccae6cba7e43c 100644 (file)
@@ -44,7 +44,13 @@ void google_init () {
   GoogleGotoTool *gototool = google_goto_tool_new (  );
   vik_goto_register ( VIK_GOTO_TOOL ( gototool ) );
   g_object_unref ( gototool );
+}
 
+/**
+ * Delayed initialization part as the check for gpsbabel availability needs to have been performed
+ */
+void google_post_init ()
+{
   // Routing
   /* Google Directions service as routing engine.
    * 
index b3afecd768f22f829609dff4bb3310a7ea8cd1de..82ffbbc4a860108637ecea001f62eff4b176a14a 100644 (file)
@@ -23,5 +23,6 @@
 #define __VIKING_GOOGLE_H
 
 void google_init();
+void google_post_init();
 
 #endif
index 21325245ec10ea10e8fba5e575145ded35999926..2f52b8d74e2cfd72ae74940103b76d9836985c33 100644 (file)
@@ -275,10 +275,13 @@ void modules_init()
  * modules_post_init:
  *
  * Secondary stage initialization
- * Can now use a_get_preferences()
+ * Can now use a_get_preferences() and a_babel_available()
  */
 void modules_post_init ()
 {
+#ifdef VIK_CONFIG_GOOGLE
+  google_post_init();
+#endif
 #ifdef HAVE_LIBMAPNIK
   vik_mapnik_layer_post_init();
 #endif