[gnome-bluetooth/wip/hadess/bluetooth-off-turn-off] Revert "lib: Fix "Bluetooth Off/Turn Off" wedged state in gnome-shell"



commit ba69d25cf59a099a73d6ac537cad022cf0a06194
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Dec 10 18:47:58 2021 +0100

    Revert "lib: Fix "Bluetooth Off/Turn Off" wedged state in gnome-shell"
    
    This reverts commit aeacc445dd37d93925530dbfc98a60011f631571.

 lib/bluetooth-client.c | 17 +++++++----------
 1 file 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");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]