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

noreply at xfce.org noreply at xfce.org
Sat Aug 20 18:33:01 CEST 2016


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

gottcode pushed a commit to annotated tag v1.0.1
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit ea367b5eb84e340b8da80fdedd917cd31515ce42
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