]> git.street.me.uk Git - andy/viking.git/blobdiff - src/dir.c
Mapnik library needs full filename for the configuration file.
[andy/viking.git] / src / dir.c
index 161ed408bd717a0d2b827f10a5d3300032e999bd..0c14b427dd0d997a2a603e07c85bf5887d032c4d 100644 (file)
--- a/src/dir.c
+++ b/src/dir.c
@@ -105,7 +105,13 @@ a_get_viking_data_home()
 gchar **
 a_get_viking_data_path()
 {
 gchar **
 a_get_viking_data_path()
 {
+#ifdef WINDOWS
+  // Try to use from the install directory - normally the working directory of Viking is where ever it's install location is
+  const gchar *xdg_data_dirs = "./data";
+  //const gchar *xdg_data_dirs = g_strdup ( "%s/%s/data", g_getenv("ProgramFiles"), PACKAGE );
+#else
   const gchar *xdg_data_dirs = g_getenv("XDG_DATA_DIRS");
   const gchar *xdg_data_dirs = g_getenv("XDG_DATA_DIRS");
+#endif
   if (xdg_data_dirs == NULL)
   {
     /* Default value specified in 
   if (xdg_data_dirs == NULL)
   {
     /* Default value specified in 
@@ -113,7 +119,10 @@ a_get_viking_data_path()
      */
     xdg_data_dirs = "/usr/local/share/:/usr/share/";
   }
      */
     xdg_data_dirs = "/usr/local/share/:/usr/share/";
   }
-  gchar **data_path = g_strsplit(xdg_data_dirs, ":", 0);
+
+  gchar **data_path = g_strsplit(xdg_data_dirs, G_SEARCHPATH_SEPARATOR_S, 0);
+
+#ifndef WINDOWS
   /* Append the viking dir */
   gchar **path;
   for (path = data_path ; *path != NULL ; path++)
   /* Append the viking dir */
   gchar **path;
   for (path = data_path ; *path != NULL ; path++)
@@ -122,5 +131,6 @@ a_get_viking_data_path()
     *path = g_build_filename(dir, PACKAGE, NULL);
     g_free(dir);
   }
     *path = g_build_filename(dir, PACKAGE, NULL);
     g_free(dir);
   }
+#endif
   return data_path;
 }
   return data_path;
 }