diff options
author | Havoc Pennington <hp@pobox.com> | 1999-11-11 19:55:38 +0000 |
---|---|---|
committer | Havoc Pennington <hp@src.gnome.org> | 1999-11-11 19:55:38 +0000 |
commit | 3bb9cf602c5f94592f979288a177879999c937d0 (patch) | |
tree | 39d45c1e639a2cdaffdae8440dfd11fdc72bdb8d /gconf/gconf-internals.c | |
parent | 04dbbc953aa469e882b6f31fb460e49233c45964 (diff) | |
download | gconf-3bb9cf602c5f94592f979288a177879999c937d0.tar.gz |
Enhance to detect missing tests.
1999-11-11 Havoc Pennington <hp@pobox.com>
* tests/runtests.sh: Enhance to detect missing tests.
* gconf/gconf-internals.c (gconf_log): don't log DEBUG level stuff
if built without GCONF_ENABLE_DEBUG
* backends/xml-backend.c (safe_g_hash_table_insert): Same, use
GCONF_ENABLE_DEBUG
Add locales stuff throughout this file, but do nothing with it for
now.
* gconf/gconfd.c (safe_g_hash_table_insert): Make this dependent
on GCONF_ENABLE_DEBUG setting.
* gconf/gconf-sources.c (gconf_sources_query_value): fix locale
(gconf_sources_unset_value): locale
(gconf_sources_all_entries): locales
* gconf/gconfd.c (context_query_value): Use locale list
(context_unset): locale argument
(context_all_entries): locale argument
(gconfd_unset_with_locale): locale
* gconf/gconf-sources.c (gconf_source_query_value): Pass an array
of locales to look for
(gconf_source_all_entries): ditto
(gconf_source_unset_value): pass locale to unset
* gconf/gconf-backend.h: Add locale args to the backend functions
that need it
* gconf/gconf-internals.c (gconf_current_locale): Use setlocale()
again, not guess_category_value from gnome-i18n
Diffstat (limited to 'gconf/gconf-internals.c')
-rw-r--r-- | gconf/gconf-internals.c | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/gconf/gconf-internals.c b/gconf/gconf-internals.c index 38f2f477..d6b617d2 100644 --- a/gconf/gconf-internals.c +++ b/gconf/gconf-internals.c @@ -947,48 +947,10 @@ gconf_string_to_gulong(const gchar* str) return retval; } -/* START OF CUT-AND-PASTE */ -/* The following is (partly) taken from the gettext package. - Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc. */ - -static const gchar * -guess_category_value (const gchar *categoryname) -{ - const gchar *retval; - - /* The highest priority value is the `LANGUAGE' environment - variable. This is a GNU extension. */ - retval = getenv ("LANGUAGE"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* `LANGUAGE' is not set. So we have to proceed with the POSIX - methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some - systems this can be done by the `setlocale' function itself. */ - - /* Setting of LC_ALL overwrites all other. */ - retval = getenv ("LC_ALL"); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Next comes the name of the desired category. */ - retval = getenv (categoryname); - if (retval != NULL && retval[0] != '\0') - return retval; - - /* Last possibility is the LANG environment variable. */ - retval = getenv ("LANG"); - if (retval != NULL && retval[0] != '\0') - return retval; - - return NULL; -} -/* END OF CUT-AND-PASTE */ - const gchar* gconf_current_locale(void) { - return guess_category_value("LC_MESSAGES"); + return setlocale(LC_MESSAGES, NULL); } /* @@ -1047,7 +1009,14 @@ gconf_log(GConfLogPriority pri, const gchar* fmt, ...) break; } - syslog(syslog_pri, msg); - +#ifndef GCONF_ENABLE_DEBUG + if (pri != GCL_DEBUG) + { +#endif + syslog(syslog_pri, msg); +#ifndef GCONF_ENABLE_DEBUG + } +#endif + g_free(msg); } |