From a84a077ac84bb43250b09cc657856b128b20d050 Mon Sep 17 00:00:00 2001 From: Peter de Ridder Date: Sat, 26 Jun 2010 15:38:37 +0200 Subject: [PATCH] Implement default configuration files on Windows --- midori/sokoke.c | 12 +++++++++++- wscript | 10 +++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/midori/sokoke.c b/midori/sokoke.c index c3f3d826..4f7e92d7 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -1455,17 +1455,27 @@ sokoke_find_config_filename (const gchar* folder, const gchar* const* config_dirs = g_get_system_config_dirs (); guint i = 0; const gchar* config_dir; + gchar* path; if (!folder) folder = ""; while ((config_dir = config_dirs[i++])) { - gchar* path = g_build_filename (config_dir, PACKAGE_NAME, folder, filename, NULL); + path = g_build_filename (config_dir, PACKAGE_NAME, folder, filename, NULL); if (g_access (path, F_OK) == 0) return path; g_free (path); } + + #ifdef G_OS_WIN32 + config_dir = g_win32_get_package_installation_directory_of_module (NULL); + path = g_build_filename (config_dir, "etc", "xdg", PACKAGE_NAME, folder, filename, NULL); + if (g_access (path, F_OK) == 0) + return path; + g_free (path); + #endif + return g_build_filename (SYSCONFDIR, "xdg", PACKAGE_NAME, folder, filename, NULL); } diff --git a/wscript b/wscript index 59595b48..76de481a 100644 --- a/wscript +++ b/wscript @@ -503,7 +503,15 @@ def build (bld): bld.install_files ('${MDATADIR}/' + APPNAME + '/res', 'data/autosuggestcontrol.css') # FIXME: Determine the library naming for other platforms - if Options.platform == 'linux': + if bld.env['platform'] == 'win32': + extensions = os.listdir ('data/extensions') + for extension in extensions: + folder = 'lib' + extension + '.dll' + source = 'data/extensions/' + extension + '/config' + if os.path.exists (source): + bld.install_files ('${SYSCONFDIR}/xdg/' + APPNAME + \ + '/extensions/' + folder, source) + elif Options.platform == 'linux': extensions = os.listdir ('data/extensions') for extension in extensions: folder = 'lib' + extension + '.so' -- 2.39.5