[gnome-shell] userMenu: Only save session status when necessary
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] userMenu: Only save session status when necessary
- Date: Sat, 3 Mar 2012 10:21:42 +0000 (UTC)
commit 2b8705102248b69f1daf7b2d8411a894530a42ab
Author: Florian MÃllner <fmuellner gnome org>
Date: Thu Jan 19 19:04:56 2012 +0100
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
js/ui/userMenu.js | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index b51adf8..f9c2b46 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -388,8 +388,8 @@ const IMStatusChooserItem = new Lang.Class({
if (!this._imPresenceRestored)
return;
+ let savedStatus = global.settings.get_int('saved-session-presence');
if (!this._sessionPresenceRestored) {
- let savedStatus = global.settings.get_int('saved-session-presence');
// We should never save/restore a status other than AVAILABLE
// or BUSY
@@ -404,8 +404,9 @@ const IMStatusChooserItem = new Lang.Class({
this._sessionPresenceRestored = true;
}
- if (sessionStatus == GnomeSession.PresenceStatus.AVAILABLE ||
- sessionStatus == GnomeSession.PresenceStatus.BUSY)
+ if ((sessionStatus == GnomeSession.PresenceStatus.AVAILABLE ||
+ sessionStatus == GnomeSession.PresenceStatus.BUSY) &&
+ savedStatus != sessionStatus)
global.settings.set_int('saved-session-presence', sessionStatus);
let [presence, s, msg] = this._accountMgr.get_most_available_presence();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]