userMenu: Only save session status when necessary
Saving the status to GSettings is pointless if it did not actually change. If done during login, it is actually harmful, as it causes dconf-service to be started. https://bugzilla.gnome.org/show_bug.cgi?id=668214
This commit is contained in:
parent
a901f2dc5d
commit
2b87051022
@ -388,8 +388,8 @@ const IMStatusChooserItem = new Lang.Class({
|
|||||||
if (!this._imPresenceRestored)
|
if (!this._imPresenceRestored)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
let savedStatus = global.settings.get_int('saved-session-presence');
|
||||||
if (!this._sessionPresenceRestored) {
|
if (!this._sessionPresenceRestored) {
|
||||||
let savedStatus = global.settings.get_int('saved-session-presence');
|
|
||||||
|
|
||||||
// We should never save/restore a status other than AVAILABLE
|
// We should never save/restore a status other than AVAILABLE
|
||||||
// or BUSY
|
// or BUSY
|
||||||
@ -404,8 +404,9 @@ const IMStatusChooserItem = new Lang.Class({
|
|||||||
this._sessionPresenceRestored = true;
|
this._sessionPresenceRestored = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sessionStatus == GnomeSession.PresenceStatus.AVAILABLE ||
|
if ((sessionStatus == GnomeSession.PresenceStatus.AVAILABLE ||
|
||||||
sessionStatus == GnomeSession.PresenceStatus.BUSY)
|
sessionStatus == GnomeSession.PresenceStatus.BUSY) &&
|
||||||
|
savedStatus != sessionStatus)
|
||||||
global.settings.set_int('saved-session-presence', sessionStatus);
|
global.settings.set_int('saved-session-presence', sessionStatus);
|
||||||
|
|
||||||
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
|
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
|
||||||
|
Loading…
Reference in New Issue
Block a user