* src/folderview.c
authorChristoph Hohmann <reboot@gmx.ch>
Tue, 20 Aug 2002 19:50:04 +0000 (19:50 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Tue, 20 Aug 2002 19:50:04 +0000 (19:50 +0000)
* src/main.c
* src/summaryview.[ch]
        more summaryview/folderitem seperation for
        sort_key and sort_type
* src/procmsg.c
        added missing return statement

ChangeLog.claws
configure.in
src/folderview.c
src/main.c
src/procmsg.c
src/summaryview.c
src/summaryview.h

index 6a5facd..74ce724 100644 (file)
@@ -1,3 +1,13 @@
+2002-08-20 [christoph] 0.8.1claws86
+
+       * src/folderview.c
+       * src/main.c
+       * src/summaryview.[ch]
+               more summaryview/folderitem seperation for
+               sort_key and sort_type
+       * src/procmsg.c
+               added missing return statement
+
 2002-08-20 [colin]     0.8.1claws85
 
         * src/summaryview.[ch]
index 2b35901..3944489 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws85
+EXTRA_VERSION=claws86
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 5630097..ab33f28 100644 (file)
@@ -1659,6 +1659,7 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row,
                
                olditem = gtk_ctree_node_get_row_data(ctree, folderview->opened);
                folder_item_write_cache(olditem);
+               summary_save_prefs_to_folderitem(folderview->summaryview, olditem);
        }
 
        /* CLAWS: set compose button type: news folder items 
index 35b5903..c26dc13 100644 (file)
@@ -503,6 +503,15 @@ void app_will_exit(GtkWidget *widget, gpointer data)
        if (prefs_common.clean_on_exit)
                main_window_empty_trash(mainwin, prefs_common.ask_on_clean);
 
+       /* save prefs for opened folder */
+       if(mainwin->folderview->opened)
+       {
+               FolderItem *item;
+
+               item = gtk_ctree_node_get_row_data(GTK_CTREE(mainwin->folderview->ctree), mainwin->folderview->opened);
+               summary_save_prefs_to_folderitem(mainwin->folderview->summaryview, item);
+       }
+
        /* save all state before exiting */
        folder_write_list();
        folder_func_to_all_folders(save_all_caches, NULL);
index 61efa87..6623e3b 100644 (file)
@@ -536,6 +536,8 @@ static gboolean procmsg_ignore_node(GNode *node, gpointer data)
        MsgInfo *msginfo = (MsgInfo *)node->data;
        
        procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
+
+       return FALSE;
 }
 
 /* return the reversed thread tree */
index 04ec831..d052762 100644 (file)
@@ -656,7 +656,11 @@ void summary_init(SummaryView *summaryview)
        gtk_widget_show(pixmap);
        summaryview->folder_pixmap = pixmap;
 
-       /* Init Summaryview prefs */
+       /* Init summaryview prefs */
+       summaryview->sort_key = SORT_BY_NONE;
+       summaryview->sort_type = SORT_ASCENDING;
+
+       /* Init summaryview extra data */
        summaryview->simplify_subject_preg = NULL;
 
        summary_clear_list(summaryview);
@@ -930,11 +934,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
 
        g_slist_free(mlist);
 
-       folderview_update_msg_num(summaryview->folderview,
-                                 summaryview->folderview->opened);
-
-       if (item->sort_key != SORT_BY_NONE)
-               summary_sort(summaryview, item->sort_key, item->sort_type);
+       if (summaryview->sort_key != SORT_BY_NONE)
+               summary_sort(summaryview, summaryview->sort_key, summaryview->sort_type);
 
        gtk_signal_handler_unblock_by_data(GTK_OBJECT(ctree), summaryview);
 
@@ -961,7 +962,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                }
        } else {
                /* select first unread message */
-               if (item->sort_key == SORT_BY_SCORE)
+               if (summaryview->sort_key == SORT_BY_SCORE)
                        node = summary_find_next_important_score(summaryview,
                                                                 NULL);
                else
@@ -1834,7 +1835,6 @@ static void summary_set_column_titles(SummaryView *summaryview)
        SummaryColumnType type;
        gboolean single_char;
        GtkJustification justify;
-       FolderItem *item = summaryview->folder_item;
 
        static FolderSortKey sort_by[N_SUMMARY_COLS] = {
                SORT_BY_MARK,
@@ -1905,9 +1905,9 @@ static void summary_set_column_titles(SummaryView *summaryview)
                        gtk_box_pack_start(GTK_BOX(hbox), label,
                                           FALSE, FALSE, 0);
 
-               if (item && item->sort_key == sort_by[type]) {
+               if (summaryview->sort_key == sort_by[type]) {
                        arrow = gtk_arrow_new
-                               (item->sort_type == SORT_ASCENDING
+                               (summaryview->sort_type == SORT_ASCENDING
                                 ? GTK_ARROW_DOWN : GTK_ARROW_UP,
                                 GTK_SHADOW_IN);
                        if (justify == GTK_JUSTIFY_RIGHT)
@@ -1929,9 +1929,6 @@ void summary_sort(SummaryView *summaryview,
        GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
        GtkCListCompareFunc cmp_func = NULL;
-       FolderItem *item = summaryview->folder_item;
-
-       if (!item || !item->path || !item->parent || item->no_select) return;
 
        switch (sort_key) {
        case SORT_BY_MARK:
@@ -1977,8 +1974,8 @@ void summary_sort(SummaryView *summaryview,
                return;
        }
 
-       item->sort_key = sort_key;
-       item->sort_type = sort_type;
+       summaryview->sort_key = sort_key;
+       summaryview->sort_type = sort_type;
 
        summary_set_column_titles(summaryview);
        summary_set_menu_sensitive(summaryview);
@@ -4594,13 +4591,9 @@ static void summary_create_filter_cb(SummaryView *summaryview,
 static void summary_sort_by_column_click(SummaryView *summaryview,
                                         FolderSortKey sort_key)
 {
-       FolderItem *item = summaryview->folder_item;
-
-       if (!item) return;
-
-       if (item->sort_key == sort_key)
+       if (summaryview->sort_key == sort_key)
                summary_sort(summaryview, sort_key,
-                            item->sort_type == SORT_ASCENDING
+                            summaryview->sort_type == SORT_ASCENDING
                             ? SORT_DESCENDING : SORT_ASCENDING);
        else
                summary_sort(summaryview, sort_key, SORT_ASCENDING);
@@ -5160,6 +5153,16 @@ void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *ite
        if(item->prefs && item->prefs->simplify_subject_regexp && 
           item->prefs->simplify_subject_regexp[0] && item->prefs->enable_simplify_subject)
                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;
+}
+
+void summary_save_prefs_to_folderitem(SummaryView *summaryview, FolderItem *item)
+{
+       item->sort_key = summaryview->sort_key;
+       item->sort_type = summaryview->sort_type;
 }
 
 /*
index fceaf9e..18548d3 100644 (file)
@@ -133,6 +133,8 @@ struct _SummaryView
 
        /* summaryview prefs */
        gint important_score;
+       FolderSortKey sort_key;
+       FolderSortType sort_type;
 
        /* Extra data for summaryview */
        regex_t *simplify_subject_preg;
@@ -259,13 +261,18 @@ void summary_set_column_order       (SummaryView          *summaryview);
 void processing_apply();
 #endif
 
-void summary_toggle_show_read_messages (SummaryView *summaryview);
+void summary_toggle_show_read_messages
+                                 (SummaryView *summaryview);
 
-void summary_toggle_view_real  (SummaryView    *summaryview);
+void summary_toggle_view_real    (SummaryView  *summaryview);
 
-void summary_reflect_prefs_pixmap_theme(SummaryView *summaryview);
+void summary_reflect_prefs_pixmap_theme
+                                  (SummaryView *summaryview);
 
-void summary_harvest_address(SummaryView *summaryview);
-void summary_set_prefs_from_folderitem(SummaryView *summaryview, FolderItem *item);
+void summary_harvest_address      (SummaryView *summaryview);
+void summary_set_prefs_from_folderitem
+                                  (SummaryView *summaryview, FolderItem *item);
+void summary_save_prefs_to_folderitem
+                                  (SummaryView *summaryview, FolderItem *item);
 
 #endif /* __SUMMARY_H__ */