diff options
Diffstat (limited to 'lib/bluetooth-client.c')
-rw-r--r-- | lib/bluetooth-client.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c index 3f1d8d87..4e496610 100644 --- a/lib/bluetooth-client.c +++ b/lib/bluetooth-client.c @@ -526,8 +526,8 @@ default_adapter_changed (GDBusObjectManager *manager, { BluetoothClientPrivate *priv = BLUETOOTH_CLIENT_GET_PRIVATE(client); GtkTreeIter iter; - g_autoptr(GtkTreePath) tree_path = NULL; - gboolean powered, is_default; + GtkTreePath *tree_path; + gboolean powered; g_assert (!priv->default_adapter); @@ -538,16 +538,13 @@ default_adapter_changed (GDBusObjectManager *manager, tree_path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->store), &iter); priv->default_adapter = gtk_tree_row_reference_new (GTK_TREE_MODEL (priv->store), tree_path); + gtk_tree_path_free (tree_path); - gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter, - BLUETOOTH_COLUMN_DEFAULT, &is_default, - BLUETOOTH_COLUMN_POWERED, &powered, -1); + gtk_tree_store_set (priv->store, &iter, + BLUETOOTH_COLUMN_DEFAULT, TRUE, -1); - if (!is_default) { - gtk_tree_store_set (priv->store, &iter, - BLUETOOTH_COLUMN_DEFAULT, TRUE, -1); - gtk_tree_model_row_changed (GTK_TREE_MODEL (priv->store), tree_path, &iter); - } + gtk_tree_model_get (GTK_TREE_MODEL(priv->store), &iter, + BLUETOOTH_COLUMN_POWERED, &powered, -1); if (powered) { g_debug ("New default adapter is powered, so invalidating all the default-adapter* properties"); |