X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/4cfba6c7a364755192c63d8a32ec18da4e6dbb0a..e8bab170981ff0e1cd572107ca4de122d4aafe8c:/src/dir.c?ds=sidebyside diff --git a/src/dir.c b/src/dir.c index 161ed408..0c14b427 100644 --- a/src/dir.c +++ b/src/dir.c @@ -105,7 +105,13 @@ a_get_viking_data_home() 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"); +#endif 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/"; } - 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++) @@ -122,5 +131,6 @@ a_get_viking_data_path() *path = g_build_filename(dir, PACKAGE, NULL); g_free(dir); } +#endif return data_path; }