From 2ff42126ce2b49688efd81a2a6cc86e28385fa70 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 1 Mar 2023 09:45:23 +0100 Subject: settings-widget: Simplify whether to show the "Send Files" button Use g_strv_contains() instead of an open-coded loop. --- lib/bluetooth-settings-widget.c | 9 ++------- 1 file 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)); -- cgit v1.2.1