diff options
-rw-r--r-- | src/accounts-service-user.vala | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/src/accounts-service-user.vala b/src/accounts-service-user.vala index fee5fe9..e7e2299 100644 --- a/src/accounts-service-user.vala +++ b/src/accounts-service-user.vala @@ -193,14 +193,18 @@ public class AccountsServiceUser : Object { void new_privacy_proxy (GLib.Object? obj, AsyncResult res) { try { this.privacyproxy = Bus.get_proxy.end (res); - - (this.privacyproxy as DBusProxy).g_properties_changed.connect((proxy, changed, invalid) => { - var welcomeval = changed.lookup_value("MessagesWelcomeScreen", VariantType.BOOLEAN); - if (welcomeval != null) { - debug("Messages on welcome screen changed"); - this.showDataOnGreeter = welcomeval.get_boolean(); - } - }); + var pDBusProxy = this.privacyproxy as DBusProxy; + + if (pDBusProxy != null) + { + pDBusProxy.g_properties_changed.connect((proxy, changed, invalid) => { + var welcomeval = changed.lookup_value("MessagesWelcomeScreen", VariantType.BOOLEAN); + if (welcomeval != null) { + debug("Messages on welcome screen changed"); + this.showDataOnGreeter = welcomeval.get_boolean(); + } + }); + } this.showDataOnGreeter = this.privacyproxy.messages_welcome_screen; } catch (Error e) { @@ -214,15 +218,19 @@ public class AccountsServiceUser : Object { void new_system_sound_proxy (GLib.Object? obj, AsyncResult res) { try { this.syssoundproxy = Bus.get_proxy.end (res); - - (this.syssoundproxy as DBusProxy).g_properties_changed.connect((proxy, changed, invalid) => { - var silentvar = changed.lookup_value("SilentMode", VariantType.BOOLEAN); - if (silentvar != null) { - debug("Silent Mode changed"); - this._silentMode = silentvar.get_boolean(); - this.notify_property("silentMode"); - } - }); + var pDBusProxy = this.syssoundproxy as DBusProxy; + + if (pDBusProxy != null) + { + pDBusProxy.g_properties_changed.connect((proxy, changed, invalid) => { + var silentvar = changed.lookup_value("SilentMode", VariantType.BOOLEAN); + if (silentvar != null) { + debug("Silent Mode changed"); + this._silentMode = silentvar.get_boolean(); + this.notify_property("silentMode"); + } + }); + } this._silentMode = this.syssoundproxy.silent_mode; this.notify_property("silentMode"); |