Use async dbus calls for checking plugin availability

This commit is contained in:
Aleix Pol 2016-06-12 22:26:23 +02:00
parent b73f3d5a8a
commit 9a370da97b

View file

@ -38,8 +38,14 @@ QtObject {
Component.onCompleted: pluginsChanged()
readonly property var v: DBusAsyncResponse {
id: response
autoDelete: false
onSuccess: { root.available = result; }
onError: { root.available = false }
}
function pluginsChanged() {
var result = DBusResponseWaiter.waitForReply(device.hasPlugin("kdeconnect_" + pluginName))
available = (result && result != "error");
response.setPendingCall(device.hasPlugin("kdeconnect_" + pluginName))
}
}