[Xfce4-commits] [apps/xfdashboard] 05/05: Fix escaping text before setting it at label

noreply at xfce.org noreply at xfce.org
Fri Oct 27 11:52:21 CEST 2017


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

n   o   m   a   d       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfdashboard.

commit 68d63b2d024d7ae47e12cdb582d3e05a3f548dd4
Author: Stephan Haller <nomad at froevel.de>
Date:   Fri Oct 27 11:51:55 2017 +0200

    Fix escaping text before setting it at label
---
 libxfdashboard/application-button.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/libxfdashboard/application-button.c b/libxfdashboard/application-button.c
index c9409eb..29753ae 100644
--- a/libxfdashboard/application-button.c
+++ b/libxfdashboard/application-button.c
@@ -115,12 +115,12 @@ static void _xfdashboard_application_button_update_text(XfdashboardApplicationBu
 	if(priv->showDescription==FALSE)
 	{
 		if(priv->formatTitleOnly) text=g_markup_printf_escaped(priv->formatTitleOnly, title ? title : "");
-			else text=g_strdup(title ? title : "");
+			else text=g_markup_escape_text(title ? title : "", -1);
 	}
 		else
 		{
 			if(priv->formatTitleDescription) text=g_markup_printf_escaped(priv->formatTitleDescription, title ? title : "", description ? description : "");
-				else text=g_strdup_printf("%s\n%s", title ? title : "", description ? description : "");
+				else text=g_markup_printf_escaped("%s\n%s", title ? title : "", description ? description : "");
 		}
 
 	xfdashboard_label_set_text(XFDASHBOARD_LABEL(self), text);
@@ -821,6 +821,7 @@ guint xfdashboard_application_button_add_popup_menu_items_for_windows(Xfdashboar
 		XfdashboardWindowTrackerWorkspace	*windowWorkspace;
 		gboolean							separatorAdded;
 		ClutterActor						*menuItem;
+		gchar								*windowName;
 
 		/* Create sorted list of windows. The window is added to begin
 		 * of list if it is on active workspace and to end of list if it
@@ -880,10 +881,13 @@ guint xfdashboard_application_button_add_popup_menu_items_for_windows(Xfdashboar
 
 			/* Create menu item for window */
 			menuItem=xfdashboard_popup_menu_item_button_new();
-			xfdashboard_label_set_text(XFDASHBOARD_LABEL(menuItem), xfdashboard_window_tracker_window_get_name(window));
 			clutter_actor_set_x_expand(menuItem, TRUE);
 			xfdashboard_popup_menu_add_item(inMenu, XFDASHBOARD_POPUP_MENU_ITEM(menuItem));
 
+			windowName=g_markup_printf_escaped("%s", xfdashboard_window_tracker_window_get_name(window));
+			xfdashboard_label_set_text(XFDASHBOARD_LABEL(menuItem), windowName);
+			g_free(windowName);
+
 			g_signal_connect(menuItem,
 								"activated",
 								G_CALLBACK(_xfdashboard_application_button_on_popup_menu_item_activate_window),

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


More information about the Xfce4-commits mailing list