From ae16da4e8168f99140641ef90c99c18af3609870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 26 Jun 2012 17:44:24 +0200 Subject: [PATCH] Fix wrong result handling of remote calls When using dbus-glib, single return values were special-cased to be returned verbatim rather than as array with a single element. This is no longer true since switching to GDBus, so fix the places where the change was overlooked. https://bugzilla.gnome.org/show_bug.cgi?id=678852 --- js/gdm/powerMenu.js | 8 ++++---- js/ui/userMenu.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/gdm/powerMenu.js b/js/gdm/powerMenu.js index 3804ec568..613a89607 100644 --- a/js/gdm/powerMenu.js +++ b/js/gdm/powerMenu.js @@ -70,7 +70,7 @@ const PowerMenuButton = new Lang.Class({ this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveShutdown = result != 'no'; + this._haveShutdown = result[0] != 'no'; else this._haveShutdown = false; @@ -81,7 +81,7 @@ const PowerMenuButton = new Lang.Class({ this._consoleKitManager.CanStopRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveShutdown = result; + this._haveShutdown = result[0]; else this._haveShutdown = false; @@ -97,7 +97,7 @@ const PowerMenuButton = new Lang.Class({ this._systemdLoginManager.CanRebootRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveRestart = result != 'no'; + this._haveRestart = result[0] != 'no'; else this._haveRestart = false; @@ -108,7 +108,7 @@ const PowerMenuButton = new Lang.Class({ this._consoleKitManager.CanRestartRemote(Lang.bind(this, function(result, error) { if (!error) - this._haveRestart = result; + this._haveRestart = result[0]; else this._haveRestart = false; diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js index 8e9c3e703..41bf99889 100644 --- a/js/ui/userMenu.js +++ b/js/ui/userMenu.js @@ -584,7 +584,7 @@ const UserMenuButton = new Lang.Class({ this._session.CanShutdownRemote(Lang.bind(this, function(result, error) { if (!error) { - this._haveShutdown = result; + this._haveShutdown = result[0]; this._updateSuspendOrPowerOff(); } }));