From 55bd7905ec797fa7477969a3405f7f5b7c43cfd3 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Sun, 14 Feb 2016 14:46:38 -0600 Subject: in bluez.vala, create a symbolic name for bluez' busname --- src/bluez.vala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/bluez.vala b/src/bluez.vala index f7121d7..b3d96dd 100644 --- a/src/bluez.vala +++ b/src/bluez.vala @@ -27,6 +27,7 @@ public class Bluez: Bluetooth, Object uint name_watch_id = 0; uint next_device_id = 1; ObjectManager manager; + static const string BLUEZ_BUSNAME = "org.bluez"; private bool _powered = false; @@ -64,7 +65,7 @@ public class Bluez: Bluetooth, Object } name_watch_id = Bus.watch_name(BusType.SYSTEM, - "org.bluez", + BLUEZ_BUSNAME, BusNameWatcherFlags.AUTO_START, on_bluez_appeared, on_bluez_vanished); @@ -103,7 +104,7 @@ public class Bluez: Bluetooth, Object { try { - manager = bus.get_proxy_sync ("org.bluez", "/"); + manager = bus.get_proxy_sync (BLUEZ_BUSNAME, "/"); // Find the adapters and watch for changes manager.interfaces_added.connect ((object_path, interfaces_and_properties) => { @@ -160,7 +161,7 @@ public class Bluez: Bluetooth, Object if (adapter_proxy == null) { try { - adapter_proxy = bus.get_proxy_sync ("org.bluez", object_path); + adapter_proxy = bus.get_proxy_sync (BLUEZ_BUSNAME, object_path); } catch (Error e) { critical (@"$(e.message)"); return; @@ -260,7 +261,7 @@ public class Bluez: Bluetooth, Object if (device_proxy == null) { try { - device_proxy = bus.get_proxy_sync ("org.bluez", object_path); + device_proxy = bus.get_proxy_sync (BLUEZ_BUSNAME, object_path); } catch (Error e) { critical (@"$(e.message)"); return; -- cgit v1.2.3