[gnome-control-center/wip/hadess/bluetooth-rfkill-fixes] bluetooth: Add debug for rfkill calls




commit 0590be6209ebc30c651ded1d525e13ee78c6a18f
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Feb 23 15:28:30 2021 +0100

    bluetooth: Add debug for rfkill calls

 panels/bluetooth/cc-bluetooth-panel.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)
---
diff --git a/panels/bluetooth/cc-bluetooth-panel.c b/panels/bluetooth/cc-bluetooth-panel.c
index 5985ab055..c23978756 100644
--- a/panels/bluetooth/cc-bluetooth-panel.c
+++ b/panels/bluetooth/cc-bluetooth-panel.c
@@ -83,6 +83,25 @@ cc_bluetooth_panel_constructed (GObject *object)
                                         GTK_WIDGET (self->header_box), GTK_POS_RIGHT);
 }
 
+static void
+airplane_mode_changed_cb (GObject *source_object,
+                         GAsyncResult *res,
+                         gpointer user_data)
+{
+       g_autoptr(GVariant) ret = NULL;
+       g_autoptr(GError) error = NULL;
+       gboolean state = GPOINTER_TO_UINT (user_data);
+
+       if (!g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object),
+                                      res, &error)) {
+               g_warning ("Failed to change Bluetooth killswitch state to %s",
+                          state ? "on" : "off");
+       } else {
+               g_debug ("Changed Bluetooth killswitch state to %s",
+                        state ? "on" : "off");
+       }
+}
+
 static void
 enable_switch_changed_cb (CcBluetoothPanel *self)
 {
@@ -97,7 +116,7 @@ enable_switch_changed_cb (CcBluetoothPanel *self)
                           G_DBUS_CALL_FLAGS_NONE,
                           -1,
                           cc_panel_get_cancellable (CC_PANEL (self)),
-                          NULL, NULL);
+                          airplane_mode_changed_cb, GUINT_TO_POINTER(state));
 }
 
 static void


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