From 20ea5744b5e5deaf7026e1a267fcfd99843580d2 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 14 Feb 2016 15:05:19 -0600 Subject: in bluez.vala, silence a startup g_warning by calling init_bluez_state_vars() before we start listening for org.bluez on the bus --- src/bluez.vala | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/bluez.vala b/src/bluez.vala index 3e9df06..b74b53a 100644 --- a/src/bluez.vala +++ b/src/bluez.vala @@ -57,6 +57,8 @@ public class Bluez: Bluetooth, Object public Bluez (KillSwitch? killswitch) { + init_bluez_state_vars (); + if ((killswitch != null) && (killswitch.is_valid())) { this.killswitch = killswitch; @@ -82,7 +84,7 @@ public class Bluez: Bluetooth, Object bus = connection; - reset_bluez_lookup_vars(); + init_bluez_state_vars(); reset_manager(); } @@ -90,15 +92,10 @@ public class Bluez: Bluetooth, Object { debug(@"$name vanished from the bus"); - reset_bluez_lookup_vars(); - - devices_changed (); - update_combined_adapter_state (); - update_connected (); - update_enabled (); + reset_bluez(); } - private void reset_bluez_lookup_vars () + private void init_bluez_state_vars () { id_to_path = new HashTable (direct_hash, direct_equal); id_to_device = new HashTable (direct_hash, direct_equal); @@ -107,6 +104,16 @@ public class Bluez: Bluetooth, Object path_to_device_proxy = new HashTable (str_hash, str_equal); } + private void reset_bluez () + { + init_bluez_state_vars (); + + devices_changed (); + update_combined_adapter_state (); + update_connected (); + update_enabled (); + } + private void reset_manager() { try -- cgit v1.2.3