aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/bluez.vala23
-rw-r--r--src/org-bluez.vala2
2 files changed, 7 insertions, 18 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;
}
}
}
diff --git a/src/org-bluez.vala b/src/org-bluez.vala
index 49c8e4d..4bd267f 100644
--- a/src/org-bluez.vala
+++ b/src/org-bluez.vala
@@ -69,7 +69,7 @@ namespace org {
public abstract GLib.HashTable<string, GLib.Variant> get_properties() throws DBusError, IOError;
[DBus (name = "SetProperty")]
- public abstract void set_property(string name, GLib.Variant value) throws DBusError, IOError;
+ public abstract async void set_property(string name, GLib.Variant value) throws DBusError, IOError;
[DBus (name = "RequestSession")]
public abstract void request_session() throws DBusError, IOError;