[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 06/473: Fix not showing username when real name is unknown.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:52:56 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit ad816f509c84115b1899661e6fe04a87ba349a4a
Author: Graeme Gott <graeme at gottcode.org>
Date:   Fri Jun 21 14:39:43 2013 -0400

    Fix not showing username when real name is unknown.
---
 src/menu.cpp |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/menu.cpp b/src/menu.cpp
index 5db3226..5170389 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -78,7 +78,12 @@ Menu::Menu(XfceRc* settings) :
 	gtk_container_add(GTK_CONTAINER(m_window), frame);
 
 	// Create the username label
-	gchar* username = g_markup_printf_escaped("<b><big>%s</big></b>", g_get_real_name());
+	const gchar* name = g_get_real_name();
+	if (g_strcmp0(name, "Unknown") == 0)
+	{
+		name = g_get_user_name();
+	}
+	gchar* username = g_markup_printf_escaped("<b><big>%s</big></b>", name);
 	m_username = GTK_LABEL(gtk_label_new(nullptr));
 	gtk_label_set_markup(m_username, username);
 	gtk_misc_set_alignment(GTK_MISC(m_username), 0.0f, 0.5f);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list