aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2016-02-14 14:46:38 -0600
committerCharles Kerr <charles.kerr@canonical.com>2016-02-14 14:46:38 -0600
commit55bd7905ec797fa7477969a3405f7f5b7c43cfd3 (patch)
treee3061b6dd8bc2686a87b59f6dcaa2861cd3d4cb7 /src
parent5262691ed74c99daefb848d1038eda63217eca0e (diff)
downloadayatana-indicator-bluetooth-55bd7905ec797fa7477969a3405f7f5b7c43cfd3.tar.gz
ayatana-indicator-bluetooth-55bd7905ec797fa7477969a3405f7f5b7c43cfd3.tar.bz2
ayatana-indicator-bluetooth-55bd7905ec797fa7477969a3405f7f5b7c43cfd3.zip
in bluez.vala, create a symbolic name for bluez' busname
Diffstat (limited to 'src')
-rw-r--r--src/bluez.vala9
1 files changed, 5 insertions, 4 deletions
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;