summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-09-13 15:05:13 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2019-09-13 15:05:13 +0200
commit3c6cf140da7ce89698e3df456124b6225610e29e (patch)
tree4dbf9d68dfd31805f28d7ccd4d5b0c95151aea33
parent31c0d3c6b8db22ba464024be7e7cbe31da983a29 (diff)
downloadnetwork-manager-applet-bg/menu-markup.tar.gz
applet: fix gtk warning about label markupbg/menu-markup
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 &amp;" 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
-rw-r--r--src/ap-menu-item.c5
1 files 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 ("<b>%s</b>", 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