[Pkg-mozext-commits] [firetray] 302/399: fix icon update when changing icon preferences (continued)

David Prévot taffit at alioth.debian.org
Tue Oct 29 18:24:03 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch dfsg-clean
in repository firetray.

commit f91bc8b0391ca588a72b46b347a8631e6f118fd2
Author: foudfou <foudil.newbie+git at gmail.com>
Date:   Thu Sep 6 16:25:24 2012 +0200

    fix icon update when changing icon preferences (continued)
---
 src/modules/FiretrayMessaging.jsm |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/modules/FiretrayMessaging.jsm b/src/modules/FiretrayMessaging.jsm
index 3502165..4a4004c 100644
--- a/src/modules/FiretrayMessaging.jsm
+++ b/src/modules/FiretrayMessaging.jsm
@@ -164,13 +164,16 @@ firetray.Messaging = {
     log.debug("updateMsgCountWithCb");
     if (!this.initialized) return;
 
-    if ("undefined" === typeof(callback) || !callback) callback = function() { // default
-      firetray.Messaging.updateIcon(this.newMsgCount);
-
-      let mailChangeTriggerFile = firetray.Utils.prefService.getCharPref("mail_change_trigger");
-      if (mailChangeTriggerFile)
-        firetray.Messaging.runProcess(mailChangeTriggerFile, [this.newMsgCount.toString()]);
-    };
+    if ("undefined" === typeof(callback) || !callback)
+      callback = function(haveNewMail, newMsgCount) { // default
+        firetray.Messaging.updateIcon(newMsgCount);
+
+        if (haveNewMail) {
+          let mailChangeTriggerFile = firetray.Utils.prefService.getCharPref("mail_change_trigger");
+          if (mailChangeTriggerFile)
+            firetray.Messaging.runProcess(mailChangeTriggerFile, [newMsgCount.toString()]);
+        }
+      };
 
     let msgCountType = firetray.Utils.prefService.getIntPref("message_count_type");
     log.debug("msgCountType="+msgCountType);
@@ -181,12 +184,9 @@ firetray.Messaging = {
     } else
       log.error('unknown message count type');
 
-    if (this.newMsgCount !== this.currentMsgCount) {
-      callback.call(this);
-      this.currentMsgCount = this.newMsgCount;
-    } else {
-      log.debug("message count unchanged");
-    }
+    let haveNewMail = (this.newMsgCount > this.currentMsgCount);
+    callback.call(this, haveNewMail, this.newMsgCount);
+    this.currentMsgCount = this.newMsgCount;
   },
 
   updateIcon: function(msgCount) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firetray.git



More information about the Pkg-mozext-commits mailing list