[gnome-bluetooth/wip/hadess/ampersand-device-name] settings-row: Fix display of devices with & in their names
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-bluetooth/wip/hadess/ampersand-device-name] settings-row: Fix display of devices with & in their names
- Date: Tue, 10 May 2022 08:52:24 +0000 (UTC)
commit 362f4368e5ec357d560bfcc34a9e56c50a741037
Author: Bastien Nocera <hadess hadess net>
Date: Tue May 10 10:51:14 2022 +0200
settings-row: Fix display of devices with & in their names
Escape the device name/alias before using it as a label.
Closes: #115
lib/bluetooth-settings-row.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]