aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Lillqvist <tml@novell.com>2005-08-10 18:58:05 +0800
committerTor Lillqvist <tml@src.gnome.org>2005-08-10 18:58:05 +0800
commit14e9427a9e53837d29bcdd1ba957e6e57ea0ac34 (patch)
tree498536145809503eef2e56c5b7fc3e706c0688b5
parentdcb5bcea6faef1370a05132356a432a222e16e5a (diff)
downloadgsoc2013-evolution-14e9427a9e53837d29bcdd1ba957e6e57ea0ac34.tar.gz
gsoc2013-evolution-14e9427a9e53837d29bcdd1ba957e6e57ea0ac34.tar.zst
gsoc2013-evolution-14e9427a9e53837d29bcdd1ba957e6e57ea0ac34.zip
Use g_win32_getlocale() to get locale on Win32. (setlocale() returns
2005-08-10 Tor Lillqvist <tml@novell.com> * e-xml-utils.c (e_xml_get_child_by_name_by_lang): Use g_win32_getlocale() to get locale on Win32. (setlocale() returns strings like "Swedish_Finland.1252", we want the Unixish "sv_FI" style.) Fix typo, use the lang parameter and not "lang" string literal. svn path=/trunk/; revision=30077
-rw-r--r--e-util/ChangeLog6
-rw-r--r--e-util/e-xml-utils.c15
2 files changed, 20 insertions, 1 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index ea7d421dab..11f2091351 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,5 +1,11 @@
2005-08-10 Tor Lillqvist <tml@novell.com>
+ * e-xml-utils.c (e_xml_get_child_by_name_by_lang): Use
+ g_win32_getlocale() to get locale on Win32. (setlocale() returns
+ strings like "Swedish_Finland.1252", we want the Unixish "sv_FI"
+ style.) Fix typo, use the lang parameter and not "lang" string
+ literal.
+
* Makefile.am: Use privsolib instead of privlib. On Unix they are
the same, on Win32 privsolibdir is the same as libdir.
(INCLUDES): Pass also EVOLUTION_SYSCONFDIR, EVOLUTION_DATADIR,
diff --git a/e-util/e-xml-utils.c b/e-util/e-xml-utils.c
index 52c7d6fe77..4f919fcacd 100644
--- a/e-util/e-xml-utils.c
+++ b/e-util/e-xml-utils.c
@@ -73,6 +73,9 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent,
const xmlChar *child_name,
const gchar *lang)
{
+#ifdef G_OS_WIN32
+ gchar *freeme = NULL;
+#endif
xmlNode *child;
/* This is the default version of the string. */
xmlNode *C = NULL;
@@ -81,22 +84,32 @@ e_xml_get_child_by_name_by_lang (const xmlNode *parent,
g_return_val_if_fail (child_name != NULL, NULL);
if (lang == NULL) {
+#ifndef G_OS_WIN32
#ifdef HAVE_LC_MESSAGES
lang = setlocale (LC_MESSAGES, NULL);
#else
lang = setlocale (LC_CTYPE, NULL);
#endif
+#else
+ lang = freeme = g_win32_getlocale ();
+#endif
}
for (child = parent->xmlChildrenNode; child != NULL; child = child->next) {
if (xmlStrcmp (child->name, child_name) == 0) {
xmlChar *this_lang = xmlGetProp (child, "lang");
if (this_lang == NULL) {
C = child;
- } else if (xmlStrcmp(this_lang, "lang") == 0) {
+ } else if (xmlStrcmp(this_lang, lang) == 0) {
+#ifdef G_OS_WIN32
+ g_free (freeme);
+#endif
return child;
}
}
}
+#ifdef G_OS_WIN32
+ g_free (freeme);
+#endif
return C;
}