Mercurial > pidgin.yaz
diff libpurple/prefs.c @ 20999:c4802e8288c1
Look for a default prefs.xml in the CSIDL_COMMON_APPDATA directory (e.g. c:\Documents and Settings\All Users\Application Data\purple\prefs.xml) on Windows, similarly to how this is done on other platforms.
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 22 Oct 2007 23:37:00 +0000 |
parents | 999b77dcb63f |
children | f2cf1d61a676 |
line wrap: on
line diff
--- a/libpurple/prefs.c Mon Oct 22 15:57:29 2007 +0000 +++ b/libpurple/prefs.c Mon Oct 22 23:37:00 2007 +0000 @@ -383,13 +383,20 @@ purple_debug_info("prefs", "Reading %s\n", filename); if(!g_file_get_contents(filename, &contents, &length, &error)) { -#ifndef _WIN32 +#ifdef _WIN32 + gchar *common_appdata = wpurple_get_special_folder(CSIDL_COMMON_APPDATA); +#endif g_free(filename); g_error_free(error); error = NULL; +#ifdef _WIN32 + filename = g_build_filename(common_appdata ? common_appdata : "", "purple", "prefs.xml", NULL); + g_free(common_appdata); +#else filename = g_build_filename(SYSCONFDIR, "purple", "prefs.xml", NULL); +#endif purple_debug_info("prefs", "Reading %s\n", filename); @@ -402,15 +409,6 @@ return FALSE; } -#else /* _WIN32 */ - purple_debug_error("prefs", "Error reading prefs: %s\n", - error->message); - g_error_free(error); - g_free(filename); - prefs_loaded = TRUE; - - return FALSE; -#endif /* _WIN32 */ } context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL);