power: Remove _checkError()

On error, we tried to kill and respawn gnome-power-manager, but
as of commit c5676900 the DBus interface provided by g-s-d's power
plugin is used, so the respawning does not have any effect.

https://bugzilla.gnome.org/show_bug.cgi?id=654300
This commit is contained in:
Florian Müllner 2011-07-09 17:23:03 +02:00
parent bf28c24c82
commit fda4fc674d

View File

@ -93,7 +93,6 @@ Indicator.prototype = {
_readPrimaryDevice: function() { _readPrimaryDevice: function() {
this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(device, error) { this._proxy.GetPrimaryDeviceRemote(Lang.bind(this, function(device, error) {
if (error) { if (error) {
this._checkError(error);
this._hasPrimary = false; this._hasPrimary = false;
this._primaryDeviceId = null; this._primaryDeviceId = null;
this._batteryItem.actor.hide(); this._batteryItem.actor.hide();
@ -145,7 +144,6 @@ Indicator.prototype = {
this._deviceItems = []; this._deviceItems = [];
if (error) { if (error) {
this._checkError(error);
this._deviceSep.actor.hide(); this._deviceSep.actor.hide();
return; return;
} }
@ -176,21 +174,12 @@ Indicator.prototype = {
this.setGIcon(gicon); this.setGIcon(gicon);
this.actor.show(); this.actor.show();
} else { } else {
this._checkError(error);
this.menu.close(); this.menu.close();
this.actor.hide(); this.actor.hide();
} }
})); }));
this._readPrimaryDevice(); this._readPrimaryDevice();
this._readOtherDevices(); this._readOtherDevices();
},
_checkError: function(error) {
if (!this._restarted && error && error.message.match(/org\.freedesktop\.DBus\.Error\.(UnknownMethod|InvalidArgs)/)) {
Util.killall('gnome-power-manager');
Util.spawn(['gnome-power-manager']);
this._restarted = true;
}
} }
}; };