aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-02-14 15:05:19 -0600
committerCharles Kerr <charles.kerr@canonical.com>2016-02-14 15:05:19 -0600
commit20ea5744b5e5deaf7026e1a267fcfd99843580d2 (patch)
tree5c07c073fbb1913a35e69e21f0b03d4050198df1
parent4fc9eb374f299b473f9ebf27dbb80a4b7f8a726e (diff)
downloadayatana-indicator-bluetooth-20ea5744b5e5deaf7026e1a267fcfd99843580d2.tar.gz
ayatana-indicator-bluetooth-20ea5744b5e5deaf7026e1a267fcfd99843580d2.tar.bz2
ayatana-indicator-bluetooth-20ea5744b5e5deaf7026e1a267fcfd99843580d2.zip
in bluez.vala, silence a startup g_warning by calling init_bluez_state_vars() before we start listening for org.bluez on the bus
-rw-r--r--src/bluez.vala23
1 files 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<uint,ObjectPath> (direct_hash, direct_equal);
id_to_device = new HashTable<uint,Device> (direct_hash, direct_equal);
@@ -107,6 +104,16 @@ public class Bluez: Bluetooth, Object
path_to_device_proxy = new HashTable<ObjectPath,BluezDevice> (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