aboutsummaryrefslogtreecommitdiff
path: root/src/bluez.vala
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-14 18:33:59 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-10-14 18:33:59 -0500
commit73cc5b06408e95c0401cb3cd3c2249f9376f2606 (patch)
treebe18fd3224329aac89dcd397f67a41482e03b1dc /src/bluez.vala
parent46d4ad6f0e470049fee1236e93f2e8f8191da72b (diff)
downloadayatana-indicator-bluetooth-73cc5b06408e95c0401cb3cd3c2249f9376f2606.tar.gz
ayatana-indicator-bluetooth-73cc5b06408e95c0401cb3cd3c2249f9376f2606.tar.bz2
ayatana-indicator-bluetooth-73cc5b06408e95c0401cb3cd3c2249f9376f2606.zip
make org.bluez.Adapter's set_property() call nonblocking
Diffstat (limited to 'src/bluez.vala')
-rw-r--r--src/bluez.vala23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/bluez.vala b/src/bluez.vala
index 472a16d..1a1f837 100644
--- a/src/bluez.vala
+++ b/src/bluez.vala
@@ -449,13 +449,9 @@ public class Bluez: Bluetooth, Object
public void try_set_discoverable (bool b)
{
- if (discoverable != b) try
+ if (discoverable != b)
{
- default_adapter.set_property ("Discoverable", new Variant.boolean (b));
- }
- catch (Error e)
- {
- critical (@"$(e.message)");
+ default_adapter.set_property.begin ("Discoverable", new Variant.boolean (b));
}
}
@@ -475,18 +471,11 @@ public class Bluez: Bluetooth, Object
debug (@"setting killswitch blocked to $(!b)");
killswitch.try_set_blocked (!b);
}
- else
+ else if (default_adapter != null)
{
- if (default_adapter != null) try
- {
- debug (@"setting bluez Adapter's Powered property to $b");
- default_adapter.set_property ("Powered", new Variant.boolean (b));
- powered = b;
- }
- catch (Error e)
- {
- critical (@"$(e.message)");
- }
+ debug (@"setting bluez Adapter's Powered property to $b");
+ default_adapter.set_property.begin ("Powered", new Variant.boolean (b));
+ powered = b;
}
}
}