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
This commit is contained in:
Florian Müllner 2012-06-26 17:44:24 +02:00
parent 965287e724
commit ae16da4e81
2 changed files with 5 additions and 5 deletions

View File

@ -70,7 +70,7 @@ const PowerMenuButton = new Lang.Class({
this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this, this._systemdLoginManager.CanPowerOffRemote(Lang.bind(this,
function(result, error) { function(result, error) {
if (!error) if (!error)
this._haveShutdown = result != 'no'; this._haveShutdown = result[0] != 'no';
else else
this._haveShutdown = false; this._haveShutdown = false;
@ -81,7 +81,7 @@ const PowerMenuButton = new Lang.Class({
this._consoleKitManager.CanStopRemote(Lang.bind(this, this._consoleKitManager.CanStopRemote(Lang.bind(this,
function(result, error) { function(result, error) {
if (!error) if (!error)
this._haveShutdown = result; this._haveShutdown = result[0];
else else
this._haveShutdown = false; this._haveShutdown = false;
@ -97,7 +97,7 @@ const PowerMenuButton = new Lang.Class({
this._systemdLoginManager.CanRebootRemote(Lang.bind(this, this._systemdLoginManager.CanRebootRemote(Lang.bind(this,
function(result, error) { function(result, error) {
if (!error) if (!error)
this._haveRestart = result != 'no'; this._haveRestart = result[0] != 'no';
else else
this._haveRestart = false; this._haveRestart = false;
@ -108,7 +108,7 @@ const PowerMenuButton = new Lang.Class({
this._consoleKitManager.CanRestartRemote(Lang.bind(this, this._consoleKitManager.CanRestartRemote(Lang.bind(this,
function(result, error) { function(result, error) {
if (!error) if (!error)
this._haveRestart = result; this._haveRestart = result[0];
else else
this._haveRestart = false; this._haveRestart = false;

View File

@ -584,7 +584,7 @@ const UserMenuButton = new Lang.Class({
this._session.CanShutdownRemote(Lang.bind(this, this._session.CanShutdownRemote(Lang.bind(this,
function(result, error) { function(result, error) {
if (!error) { if (!error) {
this._haveShutdown = result; this._haveShutdown = result[0];
this._updateSuspendOrPowerOff(); this._updateSuspendOrPowerOff();
} }
})); }));