[gnome-shell] Fix wrong result handling of remote calls



commit ae16da4e8168f99140641ef90c99c18af3609870
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Jun 26 17:44:24 2012 +0200

    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 3804ec5..613a896 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 8e9c3e7..41bf998 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();
                 }
             }));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]