diff options
author | Bastien Nocera <hadess@hadess.net> | 2021-12-01 16:25:11 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2021-12-02 12:03:07 +0100 |
commit | 1505644f12259d9f15e06ebaf5f7580336e6349b (patch) | |
tree | 64cd2af6c32607a9e8422ebee2b56cdc70c0fcad | |
parent | 6cade952519fada91a4a4c765e58b85f716f5f82 (diff) | |
download | gnome-bluetooth-1505644f12259d9f15e06ebaf5f7580336e6349b.tar.gz |
lib: Remove GtkTreeModel usage when adding devices
-rw-r--r-- | lib/bluetooth-client.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c index 1eea1dbf..d63e03f5 100644 --- a/lib/bluetooth-client.c +++ b/lib/bluetooth-client.c @@ -431,6 +431,7 @@ device_added (GDBusObjectManager *manager, gboolean coldplug) { g_autoptr (GDBusProxy) adapter = NULL; + const char *default_adapter_path; const char *adapter_path, *address, *alias, *name, *icon; g_auto(GStrv) uuids = NULL; gboolean default_adapter; @@ -456,12 +457,14 @@ device_added (GDBusObjectManager *manager, g_debug ("Inserting device '%s' on adapter '%s'", address, adapter_path); + default_adapter_path = g_dbus_proxy_get_object_path (G_DBUS_PROXY (client->default_adapter)); + default_adapter = (g_strcmp0 (default_adapter_path, adapter_path) == 0); + if (get_iter_from_path (client->store, &parent, adapter_path) == FALSE) return; gtk_tree_model_get (GTK_TREE_MODEL(client->store), &parent, BLUETOOTH_COLUMN_PROXY, &adapter, - BLUETOOTH_COLUMN_DEFAULT, &default_adapter, -1); if (get_iter_from_address (client->store, &iter, address, adapter) == FALSE) { |