0.9.11cvs7
authorChristoph Hohmann <reboot@gmx.ch>
Wed, 9 Jun 2004 13:43:46 +0000 (13:43 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Wed, 9 Jun 2004 13:43:46 +0000 (13:43 +0000)
* src/folder.[ch]
        add information about added or removed messages to
        FOLDER_ITEM_UPDATE hook

* src/imap_gtk.c
* src/mh_gtk.c
        scan folder when removing a folder failed instead of
        updating the summaryview

ChangeLog.claws
configure.ac
src/folder.c
src/folder.h
src/imap_gtk.c
src/mh_gtk.c

index da83788b85ab91469b873277b648f5e2b3d85bca..3c5bf761ee0ac9b154cac57d50a2478b0a12bdcd 100644 (file)
@@ -1,3 +1,14 @@
+2004-06-09 [christoph] 0.9.11cvs7
+
+       * src/folder.[ch]
+               add information about added or removed messages to
+               FOLDER_ITEM_UPDATE hook
+
+       * src/imap_gtk.c
+       * src/mh_gtk.c
+               scan folder when removing a folder failed instead of
+               updating the summaryview
+
 2004-06-08 [paul]      0.9.11cvs6
 
        * sync with main 0.9.11cvs2
index 0320c316cf65805dead9ae58dd58ed78353e15b6..ae25df9f63896b3eac8907f1542d3f34a2bac82c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=6
+EXTRA_VERSION=7
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
@@ -201,14 +201,6 @@ dnl *****************
 dnl ** common code **
 dnl *****************
 
-dnl search for encrypt function
-OLDLIBS=$LIBS
-LIBS=
-AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
-CRYPT_LIBS=$LIBS
-AC_SUBST(CRYPT_LIBS)
-LIBS=$OLDLIBS
-
 dnl check for glib
 AM_PATH_GLIB(1.2.6,,
        AC_MSG_ERROR(Test for GLIB failed. See the file 'INSTALL' for help.),
@@ -245,7 +237,14 @@ fi
 dnl Check for OpenSSL
 AM_PATH_OPENSSL
 
-dnl Key for password encryption
+dnl password encryption
+OLDLIBS=$LIBS
+LIBS=
+AC_SEARCH_LIBS(encrypt, crypt, [], AC_MSG_ERROR(['encrypt'-function not found.]))
+CRYPT_LIBS=$LIBS
+AC_SUBST(CRYPT_LIBS)
+LIBS=$OLDLIBS
+
 AC_ARG_WITH(passcrypt-key, [  --with-passcrypt-key=KEY     Key used to encode passwords (8 byte string)],
            with_passcrypt_key="$withval", with_passcrypt_key="passkey0")
 AC_SUBST(PASSCRYPT_KEY, $with_passcrypt_key)
index 32c4db8b2611a3a07208ef156fd3a001adc981b2..997a5d1b7b4d8a1e8a362d0a6aea5691609c665d 100644 (file)
@@ -72,6 +72,8 @@ static gboolean persist_prefs_free    (gpointer key, gpointer val, gpointer data);
 void folder_item_read_cache            (FolderItem *item);
 void folder_item_free_cache            (FolderItem *item);
 gint folder_item_scan_full             (FolderItem *item, gboolean filtering);
+static void folder_item_update_with_msg (FolderItem *item, FolderItemUpdateFlags update_flags,
+                                         MsgInfo *msg);
 
 void folder_system_init(void)
 {
@@ -1441,6 +1443,8 @@ gint folder_item_open(FolderItem *item)
        
        folder_item_apply_processing(item);
 
+       item->opened = TRUE;
+
        debug_print("done.\n");
 
        return 0;
@@ -2156,7 +2160,7 @@ static void add_msginfo_to_cache(FolderItem *item, MsgInfo *newmsginfo, MsgInfo
        folder_item_update_freeze();
        msgcache_add_msg(item->cache, newmsginfo);
        copy_msginfo_flags(flagsource, newmsginfo);
-       folder_item_update(item,  F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
+       folder_item_update_with_msg(item,  F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_ADDMSG, newmsginfo);
        folder_item_update_thaw();
 }
 
@@ -2180,7 +2184,7 @@ static void remove_msginfo_from_cache(FolderItem *item, MsgInfo *msginfo)
        hooks_invoke(MSGINFO_UPDATE_HOOKLIST, &msginfo_update);
 
        msgcache_remove_msg(item->cache, msginfo->msgnum);
-       folder_item_update(msginfo->folder, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
+       folder_item_update_with_msg(msginfo->folder, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT | F_ITEM_UPDATE_REMOVEMSG, msginfo);
 }
 
 gint folder_item_add_msg(FolderItem *dest, const gchar *file,
@@ -2627,7 +2631,6 @@ gint folder_item_remove_msg(FolderItem *item, gint num)
                remove_msginfo_from_cache(item, msginfo);
                procmsg_msginfo_free(msginfo);
        }
-       folder_item_update(item, F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT);
 
        return ret;
 }
@@ -3168,6 +3171,20 @@ void folder_item_apply_processing(FolderItem *item)
  */
 static gint folder_item_update_freeze_cnt = 0;
 
+static void folder_item_update_with_msg(FolderItem *item, FolderItemUpdateFlags update_flags, MsgInfo *msg)
+{
+       if (folder_item_update_freeze_cnt == 0 || (msg != NULL && item->opened)) {
+               FolderItemUpdateData source;
+       
+               source.item = item;
+               source.update_flags = update_flags;
+               source.msg = msg;
+               hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
+       } else {
+               item->update_flags |= update_flags & ~(F_ITEM_UPDATE_ADDMSG | F_ITEM_UPDATE_REMOVEMSG);
+       }
+}
+
 /**
  * Notify the folder system about changes to a folder. If the
  * update system is not frozen the FOLDER_ITEM_UPDATE_HOOKLIST will
@@ -3179,15 +3196,7 @@ static gint folder_item_update_freeze_cnt = 0;
  */
 void folder_item_update(FolderItem *item, FolderItemUpdateFlags update_flags)
 {
-       if (folder_item_update_freeze_cnt == 0) {
-               FolderItemUpdateData source;
-       
-               source.item = item;
-               source.update_flags = update_flags;
-               hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
-       } else {
-               item->update_flags |= update_flags;
-       }
+       folder_item_update_with_msg(item, update_flags, NULL);
 }
 
 void folder_item_update_recursive(FolderItem *item, FolderItemUpdateFlags update_flags)
index 4ecd7c1b7f0651cb707a3ef176beb50c53be6295..04a7cff5ab9a26f6c4f0c146fdb6f344c9dacd33 100644 (file)
@@ -111,7 +111,9 @@ typedef enum
 {
        F_ITEM_UPDATE_MSGCNT = 1 << 0,
        F_ITEM_UPDATE_CONTENT = 1 << 1,
-       F_ITEM_UPDATE_NAME = 1 << 2,
+       F_ITEM_UPDATE_ADDMSG = 1 << 2,
+       F_ITEM_UPDATE_REMOVEMSG = 1 << 3,
+       F_ITEM_UPDATE_NAME = 1 << 4,
 } FolderItemUpdateFlags;
 
 typedef void (*FolderUIFunc)           (Folder         *folder,
@@ -630,6 +632,7 @@ struct _FolderItemUpdateData
 {
        FolderItem              *item;
        FolderItemUpdateFlags    update_flags;
+       MsgInfo                 *msg;
 };
 
 void       folder_system_init          (void);
index e73cbda73e8697a103f049c06eeaae1d987e1dc4..c79b763266b583731ba7d7f98f021bd45af580ec 100644 (file)
@@ -313,10 +313,8 @@ static void delete_folder_cb(FolderView *folderview, guint action,
        }
 
        if (item->folder->klass->remove_folder(item->folder, item) < 0) {
+               folder_item_scan(item);
                alertpanel_error(_("Can't remove the folder `%s'."), name);
-               if (folderview->opened == folderview->selected)
-                       summary_show(folderview->summaryview,
-                                    folderview->summaryview->folder_item);
                g_free(old_id);
                return;
        }
index 0d255297b1384ca0591ce550718ff33555479ae6..7dfda25dac480d0ac34cb2874368445530620318 100644 (file)
@@ -183,10 +183,8 @@ static void delete_folder_cb(FolderView *folderview, guint action,
        }
 
        if (item->folder->klass->remove_folder(item->folder, item) < 0) {
+               folder_item_scan(item);
                alertpanel_error(_("Can't remove the folder `%s'."), name);
-               if (folderview->opened == folderview->selected)
-                       summary_show(folderview->summaryview,
-                                    folderview->summaryview->folder_item);
                g_free(old_id);
                return;
        }