summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2022-05-10 10:51:14 +0200
committerBastien Nocera <hadess@hadess.net>2022-05-10 10:52:13 +0200
commit362f4368e5ec357d560bfcc34a9e56c50a741037 (patch)
treeab04510745c8ac3744d5cba552a9b6eba960a5b4
parent2c53d6bfbb2e6452f3f980cdaba0c5525bd5bdc7 (diff)
downloadgnome-bluetooth-362f4368e5ec357d560bfcc34a9e56c50a741037.tar.gz
settings-row: Fix display of devices with & in their names
Escape the device name/alias before using it as a label. Closes: #115
-rw-r--r--lib/bluetooth-settings-row.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bluetooth-settings-row.c b/lib/bluetooth-settings-row.c
index 51d509e7..99e1585a 100644
--- a/lib/bluetooth-settings-row.c
+++ b/lib/bluetooth-settings-row.c
@@ -177,7 +177,10 @@ update_row (BluetoothSettingsRow *self)
bluetooth_type_to_string (self->type));
gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
} else {
- adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self), self->alias);
+ g_autofree char *escaped = NULL;
+ if (self->alias != NULL)
+ escaped = g_markup_escape_text (self->alias, -1);
+ adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self), escaped);
gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
}
}