add prefs for default folder sort and direction, no ui yet
authorPaul <paul@claws-mail.org>
Wed, 9 Sep 2015 15:54:57 +0000 (16:54 +0100)
committerPaul <paul@claws-mail.org>
Wed, 9 Sep 2015 15:54:57 +0000 (16:54 +0100)
src/folder.c
src/prefs_common.c
src/prefs_common.h

index 78d7821..16ceae1 100644 (file)
@@ -389,8 +389,8 @@ FolderItem *folder_item_new(Folder *folder, const gchar *name, const gchar *path
        item->data = NULL;
        item->parent_stype = -1;
 
-       item->sort_key = SORT_BY_DATE;
-       item->sort_type = SORT_ASCENDING;
+       item->sort_key = prefs_common.default_sort_key;
+       item->sort_type = prefs_common.default_sort_type;
 
        item->prefs = folder_item_prefs_new();
 
index eb28b96..029371f 100644 (file)
@@ -437,6 +437,10 @@ static PrefParam param[] = {
         NULL, NULL, NULL},
 
        /* Display: Summary View */
+       {"default_sort_key", "3", &prefs_common.default_sort_key, P_ENUM,
+        NULL, NULL, NULL},
+       {"default_sort_type", "1", &prefs_common.default_sort_type, P_ENUM,
+        NULL, NULL, NULL},
        {"use_address_book", "FALSE", &prefs_common.use_addr_book, P_BOOL,
         NULL, NULL, NULL},
        {"thread_by_subject", "TRUE", &prefs_common.thread_by_subject, P_BOOL,
index e9686ae..2daf079 100644 (file)
@@ -235,6 +235,8 @@ struct _PrefsCommon
        gboolean thread_by_subject;
        gint thread_by_subject_max_age; /*!< Max. age of a thread which was threaded
                                         *   by subject (days) */
+       FolderSortKey default_sort_key;
+       FolderSortType default_sort_type;
 
        gchar *last_opened_folder;
        gboolean goto_last_folder_on_startup;