[blam] Only notify is there number of unread feeds is different



commit 9d0bc6693641ff6c9a15881a0a09b08508f13c53
Author: Carlos Martín Nieto <carlos cmartin tk>
Date:   Thu Sep 9 16:30:24 2010 +0100

    Only notify is there number of unread feeds is different

 src/UnreadNotification.cs |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/UnreadNotification.cs b/src/UnreadNotification.cs
index 84b6fb8..bd5ee4e 100644
--- a/src/UnreadNotification.cs
+++ b/src/UnreadNotification.cs
@@ -8,6 +8,7 @@ namespace Imendio.Blam
     {
 
         static Notification note = new Notification();
+        static int old = 0;
 
         public UnreadNotification()
         {
@@ -16,6 +17,12 @@ namespace Imendio.Blam
 
         public static void NotifyUnreadPosts(int unread, int new_items)
         {
+            /* Don't notify if nothing has changed */
+            if(unread != old){
+                return;
+            }
+
+            old = unread;
             /* Same as for the tray icon tooltip */
             /* Total number of unread items */
             string str = string.Format (Catalog.GetPluralString ("{0} unread item", "{0} unread items", unread),



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]