diff options
author | Robert Tari <robert@tari.in> | 2021-11-10 11:19:39 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2021-11-12 13:13:10 +0100 |
commit | 611fb696d239afec803bd2fdfdcbc1b475ff3a26 (patch) | |
tree | f7131a27f3a989d1294740466fed4f33af84cd6e /src/accounts-service-access.vala | |
parent | 27963fd99ac38eee2477ec6ae6e8d2882959994a (diff) | |
download | ayatana-indicator-sound-611fb696d239afec803bd2fdfdcbc1b475ff3a26.tar.gz ayatana-indicator-sound-611fb696d239afec803bd2fdfdcbc1b475ff3a26.tar.bz2 ayatana-indicator-sound-611fb696d239afec803bd2fdfdcbc1b475ff3a26.zip |
Drop org.ayatana.AccountsService.Sound
Diffstat (limited to 'src/accounts-service-access.vala')
-rw-r--r-- | src/accounts-service-access.vala | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/accounts-service-access.vala b/src/accounts-service-access.vala index 19a27c6..1c55ff2 100644 --- a/src/accounts-service-access.vala +++ b/src/accounts-service-access.vala @@ -143,10 +143,8 @@ public class AccountsServiceAccess : Object string user_path; if (user_path_variant.check_format_string ("(o)", true)) { user_path_variant.get ("(o)", out user_path); -#if HAS_LOMIRI_ACCTSERVICE_SOUND_SETTINGS +#if HAS_LOMIRI_SOUND_SCHEMA _user_proxy = yield new DBusProxy.for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "com.lomiri.AccountsService.Sound"); -#else - _user_proxy = yield new DBusProxy.for_bus (BusType.SYSTEM, DBusProxyFlags.GET_INVALIDATED_PROPERTIES, null, "org.freedesktop.Accounts", user_path, "org.ayatana.AccountsService.Sound"); #endif } else { warning ("Unable to find user name after calling FindUserByName. Expected type: %s and obtained %s", "(o)", user_path_variant.get_type_string () ); @@ -157,20 +155,23 @@ public class AccountsServiceAccess : Object return; } - // Get current values and listen for changes - _user_proxy.g_properties_changed.connect (accountsservice_props_changed_cb); - try { - var props_variant = yield _user_proxy.get_connection ().call (_user_proxy.get_name (), _user_proxy.get_object_path (), "org.freedesktop.DBus.Properties", "GetAll", new Variant ("(s)", _user_proxy.get_interface_name ()), null, DBusCallFlags.NONE, -1); - if (props_variant.check_format_string ("(@a{sv})", true)) { - Variant props; - props_variant.get ("(@a{sv})", out props); - accountsservice_props_changed_cb(_user_proxy, props, null); - } else { - warning ("Unable to get accounts service properties after calling GetAll. Expected type: %s and obtained %s", "(@a{sv})", props_variant.get_type_string () ); - return; + if (_user_proxy != null) + { + // Get current values and listen for changes + _user_proxy.g_properties_changed.connect (accountsservice_props_changed_cb); + try { + var props_variant = yield _user_proxy.get_connection ().call (_user_proxy.get_name (), _user_proxy.get_object_path (), "org.freedesktop.DBus.Properties", "GetAll", new Variant ("(s)", _user_proxy.get_interface_name ()), null, DBusCallFlags.NONE, -1); + if (props_variant.check_format_string ("(@a{sv})", true)) { + Variant props; + props_variant.get ("(@a{sv})", out props); + accountsservice_props_changed_cb(_user_proxy, props, null); + } else { + warning ("Unable to get accounts service properties after calling GetAll. Expected type: %s and obtained %s", "(@a{sv})", props_variant.get_type_string () ); + return; + } + } catch (GLib.Error e) { + debug("Unable to get properties for user %s at first try: %s", username, e.message); } - } catch (GLib.Error e) { - debug("Unable to get properties for user %s at first try: %s", username, e.message); } } |