From 3c6cf140da7ce89698e3df456124b6225610e29e Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 13 Sep 2019 15:05:13 +0200 Subject: applet: fix gtk warning about label markup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warning: "Failed to set text 'ab&cd' from markup due to error parsing markup: Error on line 1: Entity did not end with a semicolon; most likely you used an ampersand character without intending to start an entity — escape ampersand as &" Don't first enable markup (with the old label) and then set the text; do both with one call to gtk_label_set_markup(). https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/244 --- src/ap-menu-item.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ap-menu-item.c b/src/ap-menu-item.c index 6c3f60c6..207c4e0f 100644 --- a/src/ap-menu-item.c +++ b/src/ap-menu-item.c @@ -167,14 +167,15 @@ update_label (NMNetworkMenuItem *item, gboolean use_bold) { NMNetworkMenuItemPrivate *priv = NM_NETWORK_MENU_ITEM_GET_PRIVATE (item); - gtk_label_set_use_markup (GTK_LABEL (priv->ssid), use_bold); if (use_bold) { char *markup = g_markup_printf_escaped ("%s", priv->ssid_string); gtk_label_set_markup (GTK_LABEL (priv->ssid), markup); g_free (markup); - } else + } else { + gtk_label_set_use_markup (GTK_LABEL (priv->ssid), FALSE); gtk_label_set_text (GTK_LABEL (priv->ssid), priv->ssid_string); + } } void -- cgit v1.2.1