fix annoyance where your current reading is disturbed when a new msg is filtered...
[claws.git] / src / summaryview.c
index 8fe04840faea08d0327ff72ae97902e750b7fbfd..2bc9e057c72f888c8c414467c7911fa83f88abab 100644 (file)
@@ -46,6 +46,7 @@
 #include "prefs_filtering.h"
 #include "account.h"
 #include "compose.h"
+#include "file-utils.h"
 #include "utils.h"
 #include "gtkutils.h"
 #include "stock_pixmap.h"
@@ -1151,7 +1152,7 @@ static void summaryview_quicksearch_recurse(SummaryView *summaryview)
                || summaryview->folder_item == NULL) {
                return;
        }
-
+       START_TIMING("");
        main_window_cursor_wait(summaryview->mainwin);
 
        summaryview_reset_recursive_folder_match(summaryview);
@@ -1160,6 +1161,7 @@ static void summaryview_quicksearch_recurse(SummaryView *summaryview)
        summaryview_quicksearch_search_subfolders(summaryview, summaryview->folder_item);
        
        main_window_cursor_normal(summaryview->mainwin);
+       END_TIMING();
 }
 
 static gboolean summary_check_consistency(FolderItem *item, GSList *mlist)
@@ -1477,7 +1479,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                                                OPEN_SELECTED_ON_SEARCH_RESULTS);
                        else
                                summary_select_by_msgnum(summaryview, selected_msgnum,
-                                               OPEN_SELECTED_ON_FOLDER_OPEN);
+                                               FALSE);
 
                        summary_lock(summaryview);
                        if (!summaryview->selected) {
@@ -6664,7 +6666,6 @@ static GtkWidget *summary_ctree_create(SummaryView *summaryview)
        gtk_cmclist_set_column_width(GTK_CMCLIST(ctree), col_pos[S_COL_TAGS],
                                   prefs_common.summary_col_size[S_COL_TAGS]);
 
-       gtk_cmctree_set_line_style(GTK_CMCTREE(ctree), GTK_CMCTREE_LINES_NONE);
        gtk_cmctree_set_expander_style(GTK_CMCTREE(ctree),
                             GTK_CMCTREE_EXPANDER_TRIANGLE);
 
@@ -6990,7 +6991,7 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                        break;
                                case GDK_KEY_Down: case GDK_KEY_KP_Down:
                                        next = gtk_cmctree_node_nth(ctree,
-                                                       MIN(GTK_CMCLIST(ctree)->focus_row + 1, GTK_CMCLIST(ctree)->rows));
+                                                       MIN(GTK_CMCLIST(ctree)->focus_row + 1, GTK_CMCLIST(ctree)->rows - 1));
                                        break;
                                case GDK_KEY_Page_Up: case GDK_KEY_KP_Page_Up:
                                        next = gtk_cmctree_node_nth(ctree,
@@ -7008,7 +7009,8 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                                        break;
                        }
 
-                       if (next) {
+                       if (next != NULL &&
+                                       next != gtk_cmctree_node_nth(ctree, GTK_CMCLIST(ctree)->focus_row)) {
                                gtk_sctree_select_with_state
                                        (GTK_SCTREE(ctree), next, (event->state & ~GDK_CONTROL_MASK) );
 
@@ -8452,12 +8454,8 @@ gboolean summary_is_opened_message_selected(SummaryView *summaryview)
 
 gboolean summary_has_opened_message(SummaryView *summaryview)
 {
-       GList *sel = NULL;
-
        cm_return_val_if_fail(summaryview != NULL, FALSE);
 
-       sel = GTK_CMCLIST(summaryview->ctree)->selection;
-
        return (summaryview->displayed != NULL);
 }