[gnome-settings-daemon] rfkill: More debug output on startup



commit 95baea73f40e9b248ee906bce26a5dae37ab9214
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 10 12:00:53 2016 +0100

    rfkill: More debug output on startup

 plugins/rfkill/gsd-rfkill-manager.c |    6 ++++++
 plugins/rfkill/rfkill-glib.c        |    8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/plugins/rfkill/gsd-rfkill-manager.c b/plugins/rfkill/gsd-rfkill-manager.c
index 9b149f4..87de49e 100644
--- a/plugins/rfkill/gsd-rfkill-manager.c
+++ b/plugins/rfkill/gsd-rfkill-manager.c
@@ -279,6 +279,10 @@ rfkill_changed (CcRfkillGlib     *rfkill,
                                g_hash_table_insert (manager->priv->bt_killswitches,
                                                     GINT_TO_POINTER (event->idx),
                                                     GINT_TO_POINTER (value));
+                       g_debug ("%s %srfkill with ID %d",
+                                event->op == RFKILL_OP_ADD ? "Added" : "Changed",
+                                event->type == RFKILL_TYPE_BLUETOOTH ? "Bluetooth " : "",
+                                event->idx);
                         break;
                 case RFKILL_OP_DEL:
                        g_hash_table_remove (manager->priv->killswitches,
@@ -286,6 +290,8 @@ rfkill_changed (CcRfkillGlib     *rfkill,
                        if (event->type == RFKILL_TYPE_BLUETOOTH)
                                g_hash_table_remove (manager->priv->bt_killswitches,
                                                     GINT_TO_POINTER (event->idx));
+                       g_debug ("Removed %srfkill with ID %d", event->type == RFKILL_TYPE_BLUETOOTH ? 
"Bluetooth " : "",
+                                event->idx);
                         break;
                 }
        }
diff --git a/plugins/rfkill/rfkill-glib.c b/plugins/rfkill/rfkill-glib.c
index 6da3bb0..ede5794 100644
--- a/plugins/rfkill/rfkill-glib.c
+++ b/plugins/rfkill/rfkill-glib.c
@@ -469,8 +469,12 @@ cc_rfkill_glib_open (CcRfkillGlib *rfkill)
                                         (GIOFunc) event_cb,
                                         rfkill);
 
-       events = g_list_reverse (events);
-       emit_changed_signal_and_free (rfkill, events);
+       if (events) {
+               events = g_list_reverse (events);
+               emit_changed_signal_and_free (rfkill, events);
+       } else {
+               g_debug ("No rfkill device available on startup");
+       }
 
        /* Setup write stream */
        priv->stream = g_unix_output_stream_new (fd, TRUE);


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