2007-09-26 [colin] 3.0.1cvs30
authorColin Leroy <colin@colino.net>
Wed, 26 Sep 2007 07:53:13 +0000 (07:53 +0000)
committerColin Leroy <colin@colino.net>
Wed, 26 Sep 2007 07:53:13 +0000 (07:53 +0000)
* src/folder.c
* src/folder.h
* src/mh.c
* src/mh.h
Fix MH mtime hack - make it a folder class function

ChangeLog
PATCHSETS
configure.ac
src/folder.c
src/folder.h
src/mh.c
src/mh.h

index 788a9e7adec9f2b0f87bd907290d8c8022e4a7a0..d2f382bc33251a7e63cb843a369b275146018a8b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-26 [colin]     3.0.1cvs30
+
+       * src/folder.c
+       * src/folder.h
+       * src/mh.c
+       * src/mh.h
+               Fix MH mtime hack - make it a folder class function
+
 2007-09-26 [colin]     3.0.1cvs29
 
        * src/inc.c
index 178ac27ceea655a170456bb8c2116964f20d0358..cbb0c0612725f45edf4204af08862810cbe23509 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/printing.c;  ) > 3.0.1cvs27.patchset
 ( cvs diff -u -r 1.65.2.58 -r 1.65.2.59 src/codeconv.c;  cvs diff -u -r 1.1.4.20 -r 1.1.4.21 src/common/xml.c;  cvs diff -u -r 1.1.4.10 -r 1.1.4.11 src/common/xml.h;  ) > 3.0.1cvs28.patchset
 ( cvs diff -u -r 1.149.2.82 -r 1.149.2.83 src/inc.c;  ) > 3.0.1cvs29.patchset
+( cvs diff -u -r 1.213.2.162 -r 1.213.2.163 src/folder.c;  cvs diff -u -r 1.87.2.48 -r 1.87.2.49 src/folder.h;  cvs diff -u -r 1.79.2.61 -r 1.79.2.62 src/mh.c;  cvs diff -u -r 1.9.2.7 -r 1.9.2.8 src/mh.h;  ) > 3.0.1cvs30.patchset
index 719d029d3dc47d773da9ffa63d4cbf50015c3fbd..6720e8ade5eea8268ebde04f279e5979e21876cd 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=29
+EXTRA_VERSION=30
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 013dfb3ec5d1c28a3f8d0a260f0547f522333b8b..c62f49d02ba466d4a79c09ce1156f8e070dc1537 100644 (file)
@@ -2481,10 +2481,8 @@ void folder_item_write_cache(FolderItem *item)
        if (!item || !item->path || !item->cache)
                return;
 
-       if (FOLDER_TYPE(item->folder) == F_MH) {
-               last_mtime = item->mtime;
-               need_scan = item->folder->klass->scan_required(item->folder, item);
-       }
+       last_mtime = item->mtime;
+       need_scan = item->folder->klass->scan_required(item->folder, item);
 
        id = folder_item_get_identifier(item);
        debug_print("Save cache for folder %s\n", id);
@@ -2504,9 +2502,9 @@ void folder_item_write_cache(FolderItem *item)
                }
         }
 
-       if (!need_scan && FOLDER_TYPE(item->folder) == F_MH) {
+       if (!need_scan && item->folder->klass->set_mtime) {
                if (item->mtime == last_mtime) {
-                       mh_set_mtime(item);
+                       item->folder->klass->set_mtime(item->folder, item);
                }
        }
 
index 1bc3219cc6a51ec4c33bc90cdc62c445d016e9a4..b64df5bd0abcc9f89012ef3d0db71f8040e99a8c 100644 (file)
@@ -392,6 +392,12 @@ struct _FolderClass
        gboolean        (*scan_required)        (Folder         *folder,
                                                 FolderItem     *item);
 
+       /**
+        * Updates the known mtime of a folder
+        */
+       void            (*set_mtime)            (Folder         *folder,
+                                                FolderItem     *item);
+
        /* Message functions */
        /**
         * Get a MsgInfo for a message in a \c FolderItem
index 2b5cff738d337254655c33618a2dc9b09198ac72..a91e65f73d96a28c87c03e5471d666fd36db1f11 100644 (file)
--- a/src/mh.c
+++ b/src/mh.c
@@ -128,6 +128,8 @@ static gchar   *mh_item_get_path            (Folder *folder,
 
 static gboolean mh_scan_required       (Folder         *folder,
                                         FolderItem     *item);
+static void mh_set_mtime               (Folder         *folder,
+                                        FolderItem *item);
 static int mh_item_close               (Folder         *folder,
                                         FolderItem     *item);
 #if 0
@@ -160,6 +162,7 @@ FolderClass *mh_get_class(void)
                mh_class.remove_folder = mh_remove_folder;
                mh_class.get_num_list = mh_get_num_list;
                mh_class.scan_required = mh_scan_required;
+               mh_class.set_mtime = mh_set_mtime;
                mh_class.close = mh_item_close;
                mh_class.get_flags = NULL; /*mh_get_flags */;
 
@@ -308,7 +311,7 @@ gint mh_get_num_list(Folder *folder, FolderItem *item, GSList **list, gboolean *
        }
        closedir(dp);
 
-       mh_set_mtime(item);
+       mh_set_mtime(folder, item);
        return nummsgs;
 }
 
@@ -586,11 +589,11 @@ static gint mh_copy_msgs(Folder *folder, FolderItem *dest, MsgInfoList *msglist,
        mh_write_sequences(dest, TRUE);
 
        if (dest->mtime == last_dest_mtime && !dest_need_scan) {
-               mh_set_mtime(dest);
+               mh_set_mtime(folder, dest);
        }
 
        if (src && src->mtime == last_src_mtime && !src_need_scan) {
-               mh_set_mtime(src);
+               mh_set_mtime(folder, src);
        }
 
        if (total > 100) {
@@ -630,7 +633,7 @@ static gint mh_remove_msg(Folder *folder, FolderItem *item, gint num)
        }
 
        if (item->mtime == last_mtime && !need_scan) {
-               mh_set_mtime(item);
+               mh_set_mtime(folder, item);
        }
        g_free(file);
        return 0;
@@ -689,7 +692,7 @@ static gint mh_remove_msgs(Folder *folder, FolderItem *item,
                statusbar_pop_all();
        }
        if (item->mtime == last_mtime && !need_scan) {
-               mh_set_mtime(item);
+               mh_set_mtime(folder, item);
        }
 
        g_free(path);
@@ -1141,7 +1144,7 @@ static void mh_scan_tree_recursive(FolderItem *item)
        closedir(dp);
 #endif
 
-       mh_set_mtime(item);
+       mh_set_mtime(folder, item);
 }
 
 static gboolean mh_rename_folder_func(GNode *node, gpointer data)
@@ -1429,13 +1432,13 @@ static int mh_item_close(Folder *folder, FolderItem *item)
        mh_write_sequences(item, FALSE);
 
        if (item->mtime == last_mtime && !need_scan) {
-               mh_set_mtime(item);
+               mh_set_mtime(folder, item);
        }
 
        return 0;
 }
 
-void mh_set_mtime(FolderItem *item)
+void mh_set_mtime(Folder *folder, FolderItem *item)
 {
        struct stat s;
        gchar *path = folder_item_get_path(item);
index b67f965d4120e202cb4173d79146127113380ee6..d503ea040e3c46dbd0a2d847ae877c75234438d5 100644 (file)
--- a/src/mh.h
+++ b/src/mh.h
@@ -35,6 +35,5 @@ struct _MHFolder
 };
 
 FolderClass *mh_get_class      (void);
-void mh_set_mtime(FolderItem *item);
 
 #endif /* __MH_H__ */