diff options
author | Bastien Nocera <hadess@hadess.net> | 2023-03-01 09:45:23 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2023-03-01 09:46:40 +0100 |
commit | 2ff42126ce2b49688efd81a2a6cc86e28385fa70 (patch) | |
tree | 520f10fda433c08af7d06b4c015327c3a4c0b945 | |
parent | 6780b0f30d557f9db4f9168007d7fd88e3a8516b (diff) | |
download | gnome-bluetooth-2ff42126ce2b49688efd81a2a6cc86e28385fa70.tar.gz |
settings-widget: Simplify whether to show the "Send Files" button
Use g_strv_contains() instead of an open-coded loop.
-rw-r--r-- | lib/bluetooth-settings-widget.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/bluetooth-settings-widget.c b/lib/bluetooth-settings-widget.c index 462f65bc..6b2c61f2 100644 --- a/lib/bluetooth-settings-widget.c +++ b/lib/bluetooth-settings-widget.c @@ -1090,7 +1090,6 @@ update_properties (BluetoothSettingsWidget *self, g_auto(GStrv) uuids = NULL; char *bdaddr, *alias; g_autofree char *icon = NULL; - guint i; if (self->debug) bluetooth_device_dump (device); @@ -1139,12 +1138,8 @@ update_properties (BluetoothSettingsWidget *self, /* UUIDs */ gtk_widget_set_sensitive (GTK_WIDGET (button), connectable); - for (i = 0; uuids && uuids[i] != NULL; i++) { - if (g_str_equal (uuids[i], "OBEXObjectPush")) { - gtk_widget_show (WID ("send_button")); - break; - } - } + if (uuids && g_strv_contains (uuids, "OBEXObjectPush")) + gtk_widget_show (WID ("send_button")); /* Type */ gtk_label_set_text (GTK_LABEL (WID ("type_label")), bluetooth_type_to_string (type)); |