diff options
author | fiaxh <git@lightrise.org> | 2022-02-01 17:38:15 +0100 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2022-02-01 23:37:54 +0100 |
commit | b7ca33a37de5dd2ecffa7575681c6009996b7ba2 (patch) | |
tree | 838f4e36a8052cd5d287069df7b76b7fbd6fb7bd /libdino/src/dbus/notifications.vala | |
parent | 1e63cb3bd935ad42af7b203efc5f4f83ae131e58 (diff) | |
download | dino-b7ca33a37de5dd2ecffa7575681c6009996b7ba2.tar.gz dino-b7ca33a37de5dd2ecffa7575681c6009996b7ba2.zip |
Initialize and use dbus interfaces async
related #1155
Diffstat (limited to 'libdino/src/dbus/notifications.vala')
-rw-r--r-- | libdino/src/dbus/notifications.vala | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libdino/src/dbus/notifications.vala b/libdino/src/dbus/notifications.vala index 68401440..25a567df 100644 --- a/libdino/src/dbus/notifications.vala +++ b/libdino/src/dbus/notifications.vala @@ -7,23 +7,22 @@ namespace Dino { public signal void notification_closed (uint32 id, uint32 reason); - public abstract uint32 notify(string app_name, uint32 replaces_id, string app_icon, string summary, + public abstract async uint32 notify(string app_name, uint32 replaces_id, string app_icon, string summary, string body, string[] actions, HashTable<string, Variant> hints, int32 expire_timeout) throws DBusError, IOError; - public abstract void get_capabilities(out string[] capabilities) throws Error; + public abstract async void get_capabilities(out string[] capabilities) throws Error; - public abstract void close_notification(uint id) throws DBusError, IOError; + public abstract async void close_notification(uint id) throws DBusError, IOError; - public abstract void get_server_information(out string name, out string vendor, out string version, out string spec_version) throws DBusError, IOError; + public abstract async void get_server_information(out string name, out string vendor, out string version, out string spec_version) throws DBusError, IOError; } - public static DBusNotifications? get_notifications_dbus() { - DBusNotifications? upower = null; + public static async DBusNotifications? get_notifications_dbus() { try { - upower = Bus.get_proxy_sync(BusType.SESSION, "org.freedesktop.Notifications", "/org/freedesktop/Notifications"); + return yield Bus.get_proxy(BusType.SESSION, "org.freedesktop.Notifications", "/org/freedesktop/Notifications"); } catch (IOError e) { warning("Couldn't get org.freedesktop.Notifications DBus instance: %s\n", e.message); } - return upower; + return null; } }
\ No newline at end of file |