aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;