From: Avuton Olrich Date: Fri, 10 Feb 2012 03:25:42 +0000 (-0800) Subject: conf.c: Add windows system key binding config X-Git-Tag: release-0.21~28 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3f98ca746637d9a72c8ffdc0c390a64a90523084;p=ncmpc.git conf.c: Add windows system key binding config --- 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