[gnome-system-tools] Show user's login when Real name is empty



commit b68e64c1c6f2ed5bef64be624475ca7e15dfd95a
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Sun Apr 25 19:10:31 2010 +0200

    Show user's login when Real name is empty
    
    liboobs was returning NULL for users with no/empty login, which was shown as (null) in the users list. Showing login twice is nicer. This fix mostly applies to system users, and especially the root user (when shown).

 src/users/users-table.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/users/users-table.c b/src/users/users-table.c
index adef0f4..64101a4 100644
--- a/src/users/users-table.c
+++ b/src/users/users-table.c
@@ -186,6 +186,11 @@ users_table_set_user (OobsUser *user, GtkTreeIter *iter)
 	face = user_settings_get_user_face (user, 48);
 	name = oobs_user_get_full_name (user);
 	login = oobs_user_get_login_name (user);
+
+	/* Work around users with empty Real name */
+	if (!name)
+		name = login;
+
 	label = g_strdup_printf ("<big><b>%s</b>\n<span color=\'dark grey\'><i>%s</i></span></big>", name, login);
 
 	gtk_list_store_set (GTK_LIST_STORE (model), iter,



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