From 3f98ca746637d9a72c8ffdc0c390a64a90523084 Mon Sep 17 00:00:00 2001 From: Avuton Olrich Date: Thu, 9 Feb 2012 19:25:42 -0800 Subject: [PATCH] conf.c: Add windows system key binding config --- src/conf.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/conf.c b/src/conf.c index 9ac3a56..50feefe 100644 --- a/src/conf.c +++ b/src/conf.c @@ -651,7 +651,28 @@ build_user_key_binding_filename(void) static char * g_build_system_key_binding_filename(void) { +#ifdef WIN32 + const gchar* const *system_data_dirs; + gchar *pathname = NULL; + + for (system_data_dirs = g_get_system_config_dirs (); *system_data_dirs != NULL; system_data_dirs++) + { + g_message (*system_data_dirs); + pathname = g_build_filename(*system_data_dirs, PACKAGE, "keys.conf", NULL); + if (g_file_test(pathname, G_FILE_TEST_EXISTS)) + { + break; + } + else + { + g_free (pathname); + pathname = NULL; + } + } + return pathname; +#else return g_build_filename(SYSCONFDIR, PACKAGE, "keys", NULL); +#endif } void -- 2.30.2