gnome-panel r10960 - trunk/gnome-panel



Author: fcrozat
Date: Tue Mar 18 17:53:49 2008
New Revision: 10960
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10960&view=rev

Log:
2008-03-18  Frederic Crozat  <fcrozat mandriva com>

        * panel-logout.c: convert username / login
        to UTF-8 if current locale is not UTF-8.



Modified:
   trunk/gnome-panel/ChangeLog
   trunk/gnome-panel/panel-logout.c

Modified: trunk/gnome-panel/panel-logout.c
==============================================================================
--- trunk/gnome-panel/panel-logout.c	(original)
+++ trunk/gnome-panel/panel-logout.c	Tue Mar 18 17:53:49 2008
@@ -217,7 +217,7 @@
 {
 	PanelLogoutDialog *logout_dialog;
 	char              *secondary_text;
-	const char        *name;
+	char              *name;
 	int                seconds_to_show;
 
 	logout_dialog = (PanelLogoutDialog *) data;
@@ -264,9 +264,12 @@
 		g_assert_not_reached ();
 	}
 
-	name = g_get_real_name ();
+	name = g_locale_to_utf8 (g_get_real_name (), -1, NULL, NULL, NULL);
 	if (!name || name[0] == '\0' || strcmp (name, "Unknown") == 0)
-		name = g_get_user_name ();
+		name = g_locale_to_utf8 (g_get_user_name (), -1 , NULL, NULL, NULL);
+
+	if (!name)
+		name = g_strdup (g_get_user_name ());
 
 	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (logout_dialog),
 						  secondary_text,
@@ -276,6 +279,8 @@
 
 	logout_dialog->priv->timeout--;
 
+	g_free (name);
+
 	return TRUE;
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]