[gnome-control-center/wip/hadess/bluetooth-rfkill-fixes] bluetooth: Add debug for rfkill calls
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/wip/hadess/bluetooth-rfkill-fixes] bluetooth: Add debug for rfkill calls
- Date: Thu, 22 Apr 2021 10:47:30 +0000 (UTC)
commit 2052c91f8f3d90274e562b6f386e5ef04f17246e
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 | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/panels/bluetooth/cc-bluetooth-panel.c b/panels/bluetooth/cc-bluetooth-panel.c
index 5985ab055..a95ea58fb 100644
--- a/panels/bluetooth/cc-bluetooth-panel.c
+++ b/panels/bluetooth/cc-bluetooth-panel.c
@@ -83,6 +83,26 @@ 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)) {
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+ g_warning ("Failed to change Bluetooth killswitch state to %s: %s",
+ state ? "on" : "off", error->message);
+ } else {
+ g_debug ("Changed Bluetooth killswitch state to %s",
+ state ? "on" : "off");
+ }
+}
+
static void
enable_switch_changed_cb (CcBluetoothPanel *self)
{
@@ -97,7 +117,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]