prevent summary view from updating when the associated folder doesn't have new messag...
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 20 Jan 2002 14:13:20 +0000 (14:13 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 20 Jan 2002 14:13:20 +0000 (14:13 +0000)
ChangeLog.claws
configure.in
src/inc.c

index 416931b..a5fd2c6 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-19 [alfons] 0.7.0claws17
+
+       * src/inc.c
+               prevent unnecessary updates when currently selected folder has
+               no new messages 
+
 2002-01-19 [alfons] 0.7.0claws16
        
        * src/summaryview.c
index a362eb6..669f4db 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws16
+EXTRA_VERSION=claws17
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index b5b9519..8136646 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -118,6 +118,10 @@ static void inc_all_spool(void);
 static void inc_autocheck_timer_set_interval   (guint           interval);
 static gint inc_autocheck_func                 (gpointer        data);
 
+#define FOLDER_SUMMARY_MISMATCH(f, s) \
+       (f) && (s) ? ((s)->newmsgs != (f)->new) || ((f)->unread != (s)->unread) || ((f)->total != (s)->messages) \
+       : FALSE
+       
 /**
  * inc_finished:
  * @mainwin: Main window.
@@ -130,7 +134,7 @@ static gint inc_autocheck_func                      (gpointer        data);
 static void inc_finished(MainWindow *mainwin, gboolean new_messages)
 {
        FolderItem *item;
-
+       
        if (prefs_common.scan_all_after_inc)
                folderview_update_all_node();
 
@@ -140,12 +144,16 @@ static void inc_finished(MainWindow *mainwin, gboolean new_messages)
                item = cur_account && cur_account->inbox
                        ? folder_find_item_from_path(cur_account->inbox)
                        : folder_get_default_inbox();
-               folderview_unselect(mainwin->folderview);
-               folderview_select(mainwin->folderview, item);
+               if (FOLDER_SUMMARY_MISMATCH(item, mainwin->summaryview)) {      
+                       folderview_unselect(mainwin->folderview);
+                       folderview_select(mainwin->folderview, item);
+               }       
        } else {
                item = mainwin->summaryview->folder_item;
-               folderview_unselect(mainwin->folderview);
-               folderview_select(mainwin->folderview, item);
+               if (FOLDER_SUMMARY_MISMATCH(item, mainwin->summaryview)) {
+                       folderview_unselect(mainwin->folderview);
+                       folderview_select(mainwin->folderview, item);
+               }       
        }
 }