Mercurial > pidgin.yaz
comparison src/prefs.c @ 8671:d99d2572d1a9
[gaim-migrate @ 9423]
This is a feature requested by warren from the Fedora project. If a
/etc/gaim/prefs.xml file exists, and no $HOME/.gaim/prefs.xml exists,
/etc/gaim/prefs.xml will be read in. This is currently only enabled if Gaim
isn't compiled on Windows, and it really shouldn't cause any trouble.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Fri, 16 Apr 2004 04:39:03 +0000 |
parents | 1a016d979ce0 |
children | 68d8280c5e13 |
comparison
equal
deleted
inserted
replaced
8670:e72824b84285 | 8671:d99d2572d1a9 |
---|---|
904 } | 904 } |
905 | 905 |
906 gaim_debug(GAIM_DEBUG_INFO, "prefs", "Reading %s\n", filename); | 906 gaim_debug(GAIM_DEBUG_INFO, "prefs", "Reading %s\n", filename); |
907 | 907 |
908 if(!g_file_get_contents(filename, &contents, &length, &error)) { | 908 if(!g_file_get_contents(filename, &contents, &length, &error)) { |
909 #ifndef _WIN32 | |
910 g_free(filename); | |
911 g_error_free(error); | |
912 | |
913 error = NULL; | |
914 | |
915 /* | |
916 * We're hard-coding /etc here, which may not be great, but for | |
917 * now it works. This was requested by the Fedora guys for the | |
918 * upcoming FC2 release. | |
919 */ | |
920 filename = g_build_filename("/etc", "gaim", "prefs.xml", NULL); | |
921 | |
922 gaim_debug(GAIM_DEBUG_INFO, "prefs", "Reading %s\n", filename); | |
923 | |
924 if (!g_file_get_contents(filename, &contents, &length, &error)) { | |
925 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error reading prefs: %s\n", | |
926 error->message); | |
927 g_error_free(error); | |
928 g_free(filename); | |
929 prefs_is_loaded = TRUE; | |
930 | |
931 return FALSE; | |
932 } | |
933 #else /* _WIN32 */ | |
909 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error reading prefs: %s\n", | 934 gaim_debug(GAIM_DEBUG_ERROR, "prefs", "Error reading prefs: %s\n", |
910 error->message); | 935 error->message); |
911 g_error_free(error); | 936 g_error_free(error); |
912 g_free(filename); | 937 g_free(filename); |
913 prefs_is_loaded = TRUE; | 938 prefs_is_loaded = TRUE; |
914 | 939 |
915 return FALSE; | 940 return FALSE; |
941 #endif /* _WIN32 */ | |
916 } | 942 } |
917 | 943 |
918 context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL); | 944 context = g_markup_parse_context_new(&prefs_parser, 0, NULL, NULL); |
919 | 945 |
920 if(!g_markup_parse_context_parse(context, contents, length, NULL)) { | 946 if(!g_markup_parse_context_parse(context, contents, length, NULL)) { |