2006-10-04 [colin] 2.5.2cvs42
authorColin Leroy <colin@colino.net>
Wed, 4 Oct 2006 06:18:28 +0000 (06:18 +0000)
committerColin Leroy <colin@colino.net>
Wed, 4 Oct 2006 06:18:28 +0000 (06:18 +0000)
* src/folder.c
* src/folder.h
* src/summaryview.c
Provide a way for folder classes to set their sort
type and key

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

index ece641e..d8a7878 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2006-10-04 [colin]     2.5.2cvs42
+
+       * src/folder.c
+       * src/folder.h
+       * src/summaryview.c
+               Provide a way for folder classes to set their sort
+               type and key
+
 2006-10-03 [colin]     2.5.2cvs41
 
        * src/mh.c
index fb49922..f9ce796 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.21 -r 1.60.2.22 src/filtering.c;  cvs diff -u -r 1.213.2.119 -r 1.213.2.120 src/folder.c;  cvs diff -u -r 1.149.2.59 -r 1.149.2.60 src/inc.c;  cvs diff -u -r 1.28.2.28 -r 1.28.2.29 src/mbox.c;  ) > 2.5.2cvs39.patchset
 ( cvs diff -u -r 1.79.2.47 -r 1.79.2.48 src/mh.c;  ) > 2.5.2cvs40.patchset
 ( cvs diff -u -r 1.79.2.48 -r 1.79.2.49 src/mh.c;  ) > 2.5.2cvs41.patchset
+( cvs diff -u -r 1.213.2.120 -r 1.213.2.121 src/folder.c;  cvs diff -u -r 1.87.2.30 -r 1.87.2.31 src/folder.h;  cvs diff -u -r 1.395.2.261 -r 1.395.2.262 src/summaryview.c;  ) > 2.5.2cvs42.patchset
index 4305937..cba1397 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=41
+EXTRA_VERSION=42
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6165a85..ac0dc90 100644 (file)
@@ -4012,4 +4012,17 @@ gboolean folder_subscribe (const gchar *uri)
        return FALSE;
 
 }
+
+gboolean folder_get_sort_type          (Folder         *folder,
+                                        FolderSortKey  *sort_key,
+                                        FolderSortType *sort_type)
+{
+       if (!folder || !sort_key || !sort_type)
+               return FALSE;
+       if (folder->klass->get_sort_type == NULL)
+               return FALSE;
+       folder->klass->get_sort_type(folder, sort_key, sort_type); 
+       return TRUE;
+}
+
 #undef PUT_ESCAPE_STR
index a49223b..a349e9a 100644 (file)
@@ -576,6 +576,9 @@ struct _FolderClass
        void            (*synchronise)          (FolderItem     *item);
        gboolean        (*subscribe)            (Folder         *folder,
                                                 const gchar    *uri);
+       void            (*get_sort_type)        (Folder         *folder,
+                                                FolderSortKey  *sort_key,
+                                                FolderSortType *sort_type);
 };
 
 struct _FolderItem
@@ -827,5 +830,8 @@ gboolean folder_have_mailbox                (void);
 gboolean folder_item_free_cache                (FolderItem *item, gboolean force);
 void folder_item_change_type           (FolderItem *item,
                                         SpecialFolderItemType newtype);
+gboolean folder_get_sort_type          (Folder         *folder,
+                                        FolderSortKey  *sort_key,
+                                        FolderSortType *sort_type);
 
 #endif /* __FOLDER_H__ */
index 852078e..9c4d454 100644 (file)
@@ -6216,6 +6216,8 @@ static regex_t *summary_compile_simplify_regexp(gchar *simplify_subject_regexp)
 
 void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *item)
 {
+       FolderSortKey sort_key;
+       FolderSortType sort_type;
        g_return_if_fail(summaryview != NULL);
        g_return_if_fail(item != NULL);
 
@@ -6230,9 +6232,13 @@ void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *ite
                summaryview->simplify_subject_preg = summary_compile_simplify_regexp(item->prefs->simplify_subject_regexp);
 
        /* Sorting */
-       summaryview->sort_key = item->sort_key;
-       summaryview->sort_type = item->sort_type;
-
+       if (folder_get_sort_type(item->folder, &sort_key, &sort_type)) {
+               summaryview->sort_key = sort_key;
+               summaryview->sort_type = sort_type;
+       } else {
+               summaryview->sort_key = item->sort_key;
+               summaryview->sort_type = item->sort_type;
+       }
        /* Threading */
        summaryview->threaded = item->threaded;
        summaryview->thread_collapsed = item->thread_collapsed;