don't expect utf8 in plain greeter either
This commit is contained in:
parent
2b7de6018b
commit
60b9c65d07
@ -1,16 +1,29 @@
|
|||||||
--- gdm-2.18.0/gui/greeter/greeter_item_ulist.c.dont-expect-utf8 2007-04-05 11:19:40.000000000 -0400
|
--- gdm-2.18.0/gui/gdmlogin.c.dont-expect-utf8 2007-04-05 12:02:47.000000000 -0400
|
||||||
+++ gdm-2.18.0/gui/greeter/greeter_item_ulist.c 2007-04-05 11:39:06.000000000 -0400
|
+++ gdm-2.18.0/gui/gdmlogin.c 2007-04-05 12:03:24.000000000 -0400
|
||||||
@@ -168,6 +168,29 @@
|
@@ -2042,8 +2042,8 @@
|
||||||
&size_of_users, GDM_IS_LOCAL, !DOING_GDM_DEVELOPMENT);
|
char *label;
|
||||||
|
char *login, *gecos;
|
||||||
|
|
||||||
|
- login = g_markup_escape_text (usr->login, -1);
|
||||||
|
- gecos = g_markup_escape_text (usr->gecos, -1);
|
||||||
|
+ login = gdm_common_text_to_escaped_utf8 (usr->login);
|
||||||
|
+ gecos = gdm_common_text_to_escaped_utf8 (usr->gecos, -1);
|
||||||
|
|
||||||
|
label = g_strdup_printf ("<b>%s</b>\n%s",
|
||||||
|
login,
|
||||||
|
--- gdm-2.18.0/gui/gdmcommon.c.dont-expect-utf8 2007-04-05 11:59:23.000000000 -0400
|
||||||
|
+++ gdm-2.18.0/gui/gdmcommon.c 2007-04-05 12:02:29.000000000 -0400
|
||||||
|
@@ -379,6 +379,29 @@
|
||||||
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
+static gchar *
|
+gchar *
|
||||||
+greeter_string_to_escaped_utf8 (const gchar *raw_string)
|
+gdm_common_text_to_escaped_utf8 (const char *text)
|
||||||
+{
|
+{
|
||||||
+ gchar *utf8_string, *escaped_string, *p;
|
+ gchar *utf8_string, *escaped_string, *p;
|
||||||
+ const gchar *q;
|
+ const gchar *q;
|
||||||
+
|
+
|
||||||
+ utf8_string = g_strdup (raw_string);
|
+ utf8_string = g_strdup (text);
|
||||||
+ p = utf8_string;
|
+ p = utf8_string;
|
||||||
+ while ((*p != '\0') &&
|
+ while ((*p != '\0') &&
|
||||||
+ !g_utf8_validate (p, -1, &q)) {
|
+ !g_utf8_validate (p, -1, &q)) {
|
||||||
@ -27,18 +40,30 @@
|
|||||||
+ return escaped_string;
|
+ return escaped_string;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
static void
|
gchar *
|
||||||
greeter_populate_user_list (GtkTreeModel *tm)
|
gdm_common_get_config_file (void)
|
||||||
{
|
{
|
||||||
@@ -181,9 +204,9 @@
|
--- gdm-2.18.0/gui/gdmcommon.h.dont-expect-utf8 2007-04-05 11:59:37.000000000 -0400
|
||||||
|
+++ gdm-2.18.0/gui/gdmcommon.h 2007-04-05 12:00:40.000000000 -0400
|
||||||
|
@@ -58,6 +58,7 @@
|
||||||
|
guint max_width,
|
||||||
|
guint max_height);
|
||||||
|
|
||||||
|
+gchar* gdm_common_text_to_escaped_utf8 (const char *text);
|
||||||
|
gchar* gdm_common_get_config_file (void);
|
||||||
|
gchar* gdm_common_get_custom_config_file (void);
|
||||||
|
gboolean gdm_common_select_time_format (void);
|
||||||
|
--- gdm-2.18.0/gui/greeter/greeter_item_ulist.c.dont-expect-utf8 2007-04-05 11:59:05.000000000 -0400
|
||||||
|
+++ gdm-2.18.0/gui/greeter/greeter_item_ulist.c 2007-04-05 12:02:09.000000000 -0400
|
||||||
|
@@ -181,9 +181,9 @@
|
||||||
gboolean active;
|
gboolean active;
|
||||||
|
|
||||||
if (usr->gecos && strcmp (usr->gecos, "") != 0) {
|
if (usr->gecos && strcmp (usr->gecos, "") != 0) {
|
||||||
- name = g_markup_escape_text (usr->gecos, -1);
|
- name = g_markup_escape_text (usr->gecos, -1);
|
||||||
+ name = greeter_string_to_escaped_utf8 (usr->gecos);
|
+ name = gdm_common_text_to_escaped_utf8 (usr->gecos);
|
||||||
} else {
|
} else {
|
||||||
- name = g_markup_escape_text (usr->login, -1);
|
- name = g_markup_escape_text (usr->login, -1);
|
||||||
+ name = greeter_string_to_escaped_utf8 (usr->login);
|
+ name = gdm_common_text_to_escaped_utf8 (usr->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_hash_table_lookup (displays_hash, usr->login))
|
if (g_hash_table_lookup (displays_hash, usr->login))
|
||||||
|
Loading…
Reference in New Issue
Block a user