[gnome-bluetooth/wip/hadess/btd-restart-fixes: 4/10] lib: Fix adapter never getting powered after it's made default




commit a55f97d3b846f84526d8d04d337fd67eb57b3dad
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Dec 8 23:51:37 2021 +0100

    lib: Fix adapter never getting powered after it's made default
    
    Fix the inverted logic that meant that adapter_set_powered() was never
    called when the adapter was unpowered.
    
    Fixes: 7956dd42630fd52ba30417fbd4a65894f5fb0d3c

 lib/bluetooth-client.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/lib/bluetooth-client.c b/lib/bluetooth-client.c
index bdc136cf..d39171b2 100644
--- a/lib/bluetooth-client.c
+++ b/lib/bluetooth-client.c
@@ -534,7 +534,7 @@ default_adapter_changed (GDBusObjectManager   *manager,
        g_object_notify (G_OBJECT (client), "default-adapter-name");
 
        powered = adapter1_get_powered (client->default_adapter);
-       if (powered)
+       if (!powered)
                adapter_set_powered (client, adapter, TRUE);
 }
 


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