summaryrefslogtreecommitdiff
path: root/lib/bluetooth-client.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-12-01 16:25:11 +0100
committerBastien Nocera <hadess@hadess.net>2021-12-02 12:03:07 +0100
commit1505644f12259d9f15e06ebaf5f7580336e6349b (patch)
tree64cd2af6c32607a9e8422ebee2b56cdc70c0fcad /lib/bluetooth-client.c
parent6cade952519fada91a4a4c765e58b85f716f5f82 (diff)
downloadgnome-bluetooth-1505644f12259d9f15e06ebaf5f7580336e6349b.tar.gz
lib: Remove GtkTreeModel usage when adding devices
Diffstat (limited to 'lib/bluetooth-client.c')
-rw-r--r--lib/bluetooth-client.c5
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) {