[Commits] [SCM] claws branch, master, updated. 3.17.4-73-gea54db54d
paul at claws-mail.org
paul at claws-mail.org
Mon Nov 25 12:52:50 CET 2019
The branch, master has been updated
via ea54db54dfda96918926f996483b1753a8347d0e (commit)
from c67b380f102cb8e056db83043ee26a1747ccd0c0 (commit)
Summary of changes:
src/action.c | 4 +-
src/folderview.c | 6 +-
src/imap_gtk.c | 2 +-
src/mainwindow.c | 8 +--
src/mh_gtk.c | 2 +-
src/news_gtk.c | 2 +-
src/plugins/mailmbox/plugin_gtk.c | 4 +-
src/plugins/vcalendar/vcal_meeting_gtk.c | 4 +-
src/plugins/vcalendar/vcalendar.c | 8 +--
src/prefs_folder_item.c | 2 +-
src/summaryview.c | 101 +++++++++++++++++--------------
src/summaryview.h | 3 +-
12 files changed, 79 insertions(+), 67 deletions(-)
- Log -----------------------------------------------------------------
commit ea54db54dfda96918926f996483b1753a8347d0e
Author: Paul <paul at claws-mail.org>
Date: Mon Nov 25 12:52:44 2019 +0000
avoid unwanted summaryview refresh...
... such as when modifying a msg by Actions
Should also fix bug 4277, 'INBOX being "read" automatically - being
marked as read before being selected'
diff --git a/src/action.c b/src/action.c
index b975f8e40..716f2e4fd 100644
--- a/src/action.c
+++ b/src/action.c
@@ -753,7 +753,7 @@ static gboolean execute_filtering_actions(gchar *action, GSList *msglist)
summary_thaw(summaryview);
main_window_cursor_normal(mainwin);
summary_unlock(summaryview);
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
for (p = action_list; p; p = g_slist_next(p))
if (p->data) filteringaction_free(p->data);
@@ -1481,7 +1481,7 @@ static void catch_status(GPid pid, gint status, gpointer data)
}
if (modified_something && last_item &&
summaryview && summaryview->folder_item == last_item) {
- summary_show (summaryview, summaryview->folder_item);
+ summary_show (summaryview, summaryview->folder_item, FALSE);
}
g_slist_free (child_info->msginfo_list);
child_info->msginfo_list = NULL;
diff --git a/src/folderview.c b/src/folderview.c
index 86ec4be2c..35f72da87 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1802,7 +1802,7 @@ static gboolean folderview_update_item_claws(gpointer source, gpointer data)
update_info->item == folderview->summaryview->folder_item &&
update_info->item != NULL)
if (!quicksearch_has_sat_predicate(folderview->summaryview->quicksearch))
- summary_show(folderview->summaryview, update_info->item);
+ summary_show(folderview->summaryview, update_info->item, FALSE);
}
return FALSE;
@@ -2235,7 +2235,7 @@ void folderview_close_opened(FolderView *folderview, gboolean dirty)
main_window_cursor_wait(folderview->mainwin);
g_free(buf);
summary_save_prefs_to_folderitem(folderview->summaryview, olditem);
- summary_show(folderview->summaryview, NULL);
+ summary_show(folderview->summaryview, NULL, FALSE);
folder_item_close(olditem);
main_window_cursor_normal(folderview->mainwin);
STATUSBAR_POP(folderview->mainwin);
@@ -2368,7 +2368,7 @@ static void folderview_selected(GtkCMCTree *ctree, GtkCMCTreeNode *row,
/* Show messages */
summary_set_prefs_from_folderitem(folderview->summaryview, item);
- opened = summary_show(folderview->summaryview, item);
+ opened = summary_show(folderview->summaryview, item, FALSE);
folder_clean_cache_memory(item);
diff --git a/src/imap_gtk.c b/src/imap_gtk.c
index e7b4a2070..afc5a5e4d 100644
--- a/src/imap_gtk.c
+++ b/src/imap_gtk.c
@@ -404,7 +404,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
item = folderview_get_selected_item(folderview);
cm_return_if_fail(item != NULL);
- summary_show(folderview->summaryview, NULL);
+ summary_show(folderview->summaryview, NULL, FALSE);
cm_return_if_fail(item->folder != NULL);
diff --git a/src/mainwindow.c b/src/mainwindow.c
index 62eea35ff..af1b275a0 100644
--- a/src/mainwindow.c
+++ b/src/mainwindow.c
@@ -2797,7 +2797,7 @@ void main_window_toggle_message_view(MainWindow *mainwin)
}
summary_grab_focus(summaryview);
if (!summary_is_list(summaryview)) {
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
}
@@ -3980,7 +3980,7 @@ static void add_mailbox_cb(GtkAction *action, gpointer data)
static void update_folderview_cb(GtkAction *action, gpointer data)
{
MainWindow *mainwin = (MainWindow *)data;
- summary_show(mainwin->summaryview, NULL);
+ summary_show(mainwin->summaryview, NULL, FALSE);
folderview_check_new_all();
}
@@ -4668,7 +4668,7 @@ static void thread_cb(GtkAction *action, gpointer data)
mainwin->summaryview->threaded = threaded;
summary_show(mainwin->summaryview,
- mainwin->summaryview->folder_item);
+ mainwin->summaryview->folder_item, FALSE);
summary_select_by_msgnum(mainwin->summaryview, selected_msgnum, FALSE);
}
@@ -4860,7 +4860,7 @@ static void update_summary_cb(GtkAction *action, gpointer data)
folder_update_op_count();
folder_item_scan(fitem);
- summary_show(mainwin->summaryview, fitem);
+ summary_show(mainwin->summaryview, fitem, FALSE);
}
static void prev_cb(GtkAction *action, gpointer data)
diff --git a/src/mh_gtk.c b/src/mh_gtk.c
index b1a162360..218847208 100644
--- a/src/mh_gtk.c
+++ b/src/mh_gtk.c
@@ -345,7 +345,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
item = folderview_get_selected_item(folderview);
cm_return_if_fail(item != NULL);
- summary_show(folderview->summaryview, NULL);
+ summary_show(folderview->summaryview, NULL, FALSE);
cm_return_if_fail(item->folder != NULL);
diff --git a/src/news_gtk.c b/src/news_gtk.c
index 15e180420..e008219a6 100644
--- a/src/news_gtk.c
+++ b/src/news_gtk.c
@@ -329,7 +329,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
if (mainwin->lock_count || news_folder_locked(item->folder))
return;
- summary_show(folderview->summaryview, NULL);
+ summary_show(folderview->summaryview, NULL, FALSE);
cm_return_if_fail(item->folder != NULL);
diff --git a/src/plugins/mailmbox/plugin_gtk.c b/src/plugins/mailmbox/plugin_gtk.c
index 166055c74..abe898822 100644
--- a/src/plugins/mailmbox/plugin_gtk.c
+++ b/src/plugins/mailmbox/plugin_gtk.c
@@ -171,7 +171,7 @@ static void update_tree_cb(GtkAction *action, gpointer data)
item = folderview_get_selected_item(folderview);
g_return_if_fail(item != NULL);
- summary_show(folderview->summaryview, NULL);
+ summary_show(folderview->summaryview, NULL, FALSE);
g_return_if_fail(item->folder != NULL);
@@ -347,7 +347,7 @@ static void delete_folder_cb(GtkAction *action, gpointer data)
alertpanel_error(_("Can't remove the folder '%s'."), name);
if (item == opened)
summary_show(folderview->summaryview,
- folderview->summaryview->folder_item);
+ folderview->summaryview->folder_item, FALSE);
g_free(old_id);
return;
}
diff --git a/src/plugins/vcalendar/vcal_meeting_gtk.c b/src/plugins/vcalendar/vcal_meeting_gtk.c
index a08c45a0e..2c010cf71 100644
--- a/src/plugins/vcalendar/vcal_meeting_gtk.c
+++ b/src/plugins/vcalendar/vcal_meeting_gtk.c
@@ -1190,7 +1190,7 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
MainWindow *mainwin = mainwindow_get_mainwindow();
if (mainwin->summaryview->folder_item == folder->inbox) {
redisp = TRUE;
- summary_show(mainwin->summaryview, NULL);
+ summary_show(mainwin->summaryview, NULL, FALSE);
}
}
gtk_widget_set_sensitive(meet->save_btn, FALSE);
@@ -1301,7 +1301,7 @@ static gboolean send_meeting_cb(GtkButton *widget, gpointer data)
if (folder && redisp) {
MainWindow *mainwin = mainwindow_get_mainwindow();
- summary_show(mainwin->summaryview, folder->inbox);
+ summary_show(mainwin->summaryview, folder->inbox, FALSE);
}
return res;
diff --git a/src/plugins/vcalendar/vcalendar.c b/src/plugins/vcalendar/vcalendar.c
index fe604ef9f..81a2299c7 100644
--- a/src/plugins/vcalendar/vcalendar.c
+++ b/src/plugins/vcalendar/vcalendar.c
@@ -930,7 +930,7 @@ void vcalendar_refresh_folder_contents(FolderItem *item)
MainWindow *mainwin = mainwindow_get_mainwindow();
folder_item_scan(item);
if (mainwin->summaryview->folder_item == item) {
- summary_show(mainwin->summaryview, item);
+ summary_show(mainwin->summaryview, item, FALSE);
}
}
}
@@ -974,7 +974,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
MainWindow *mainwin = mainwindow_get_mainwindow();
if (mainwin->summaryview->folder_item == item) {
redisp = TRUE;
- summary_show(mainwin->summaryview, NULL);
+ summary_show(mainwin->summaryview, NULL, FALSE);
}
}
@@ -989,7 +989,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
if (folder && redisp) {
MainWindow *mainwin = mainwindow_get_mainwindow();
- summary_show(mainwin->summaryview, item);
+ summary_show(mainwin->summaryview, item, FALSE);
}
return;
}
@@ -1005,7 +1005,7 @@ void vcalendar_cancel_meeting(FolderItem *item, const gchar *uid)
folder_item_scan(item);
if (folder && redisp) {
MainWindow *mainwin = mainwindow_get_mainwindow();
- summary_show(mainwin->summaryview, item);
+ summary_show(mainwin->summaryview, item, FALSE);
}
return;
diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c
index 1c315b268..fc2e1afea 100644
--- a/src/prefs_folder_item.c
+++ b/src/prefs_folder_item.c
@@ -756,7 +756,7 @@ static void general_save_folder_prefs(FolderItem *folder, FolderItemGeneralPage
if (folder->opened && summary_update_needed) {
summary_set_prefs_from_folderitem(folderview->summaryview, folder);
- summary_show(folderview->summaryview, folder);
+ summary_show(folderview->summaryview, folder, FALSE);
}
}
diff --git a/src/summaryview.c b/src/summaryview.c
index c12416918..370d7a94a 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -1272,7 +1272,7 @@ gboolean summaryview_search_root_progress(gpointer data, guint at, guint matched
return TRUE;
}
-gboolean summary_show(SummaryView *summaryview, FolderItem *item)
+gboolean summary_show(SummaryView *summaryview, FolderItem *item, gboolean avoid_refresh)
{
GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
GtkCMCTreeNode *node = NULL;
@@ -1299,7 +1299,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
utils_free_regex();
- is_refresh = (item == summaryview->folder_item) ? TRUE : FALSE;
+ is_refresh = (item == summaryview->folder_item && !manual_filtering) ? TRUE : FALSE;
if (item && item->folder->klass->item_opened) {
item->folder->klass->item_opened(item);
@@ -1431,7 +1431,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
main_window_cursor_normal(summaryview->mainwin);
summary_unlock(summaryview);
inc_unlock();
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
END_TIMING();
return FALSE;
}
@@ -1514,43 +1514,52 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
g_slist_free(mlist);
- if (quicksearch_is_in_typing(summaryview->quicksearch) ||
- quicksearch_is_running(summaryview->quicksearch)) {
- summaryview->displayed =
- summary_find_msg_by_msgnum(summaryview,
- displayed_msgnum);
- if (!summaryview->displayed)
- messageview_clear(summaryview->messageview);
- summary_unlock(summaryview);
-
- if (quicksearch_is_running(summaryview->quicksearch))
- summary_select_by_msgnum(summaryview, selected_msgnum,
- OPEN_SELECTED_ON_SEARCH_RESULTS);
- else
- summary_select_by_msgnum(summaryview, selected_msgnum,
- FALSE);
-
- summary_lock(summaryview);
- if (!summaryview->selected) {
- /* no selected message - select first unread
- message, but do not display it */
- node = summary_find_next_flagged_msg(summaryview, NULL,
- MSG_UNREAD, FALSE);
- if (node == NULL && GTK_CMCLIST(ctree)->row_list != NULL)
- node = gtk_cmctree_node_nth
- (ctree,
- item->sort_type == SORT_DESCENDING
- ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+ if (is_refresh) {
+ if (!quicksearch_is_in_typing(summaryview->quicksearch)) {
+ summaryview->displayed =
+ summary_find_msg_by_msgnum(summaryview,
+ displayed_msgnum);
+ if (!summaryview->displayed)
+ messageview_clear(summaryview->messageview);
summary_unlock(summaryview);
if (quicksearch_is_running(summaryview->quicksearch))
- summary_select_node(summaryview, node,
+ summary_select_by_msgnum(summaryview, selected_msgnum,
OPEN_SELECTED_ON_SEARCH_RESULTS);
else
- summary_select_node(summaryview, node,
- OPEN_SELECTED_ON_FOLDER_OPEN);
+ summary_select_by_msgnum(summaryview, selected_msgnum,
+ FALSE);
summary_lock(summaryview);
+ if (!summaryview->selected) {
+ /* no selected message - select first unread
+ message, but do not display it */
+ node = summary_find_next_flagged_msg(summaryview, NULL,
+ MSG_UNREAD, FALSE);
+ if (node == NULL && GTK_CMCLIST(ctree)->row_list != NULL)
+ node = gtk_cmctree_node_nth
+ (ctree,
+ item->sort_type == SORT_DESCENDING
+ ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+ summary_unlock(summaryview);
+
+ if (quicksearch_is_running(summaryview->quicksearch))
+ summary_select_node(summaryview, node,
+ OPEN_SELECTED_ON_SEARCH_RESULTS);
+ else
+ summary_select_node(summaryview, node,
+ OPEN_SELECTED_ON_FOLDER_OPEN);
+
+ summary_lock(summaryview);
+ }
+ } else {
+ /* just select first/last */
+ if (GTK_CMCLIST(ctree)->row_list != NULL)
+ node = gtk_cmctree_node_nth
+ (ctree,
+ item->sort_type == SORT_DESCENDING
+ ? 0 : GTK_CMCLIST(ctree)->rows - 1);
+ summary_select_node(summaryview, node, OPEN_SELECTED_ON_SEARCH_RESULTS);
}
} else {
/* backward compat */
@@ -1656,10 +1665,12 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
if (node) {
gint open_selected = -1;
- if (OPEN_SELECTED_ON_FOLDER_OPEN)
- open_selected = 1;
- else
- open_selected = 0;
+ if (!is_refresh) {
+ if (OPEN_SELECTED_ON_FOLDER_OPEN)
+ open_selected = 1;
+ else
+ open_selected = 0;
+ }
summary_select_node(summaryview, node, open_selected);
}
@@ -3010,7 +3021,7 @@ void summary_reflect_prefs(void)
summary_relayout(summaryview);
if (summaryview->folder_item)
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
void summary_sort(SummaryView *summaryview,
@@ -5212,7 +5223,7 @@ gboolean summary_execute(SummaryView *summaryview)
main_window_cursor_normal(summaryview->mainwin);
if (move_val < 0)
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
return TRUE;
}
@@ -5900,7 +5911,7 @@ void summary_filter(SummaryView *summaryview, gboolean selected_only)
* CLAWS: summary_show() only valid after having a lock. ideally
* we want the lock to be context aware...
*/
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, TRUE);
}
static void summary_filter_func(MsgInfo *msginfo, PrefsAccount *ac_prefs)
@@ -6883,7 +6894,7 @@ void summary_set_column_order(SummaryView *summaryview)
gtk_container_add(GTK_CONTAINER(scrolledwin), ctree);
gtk_widget_show(ctree);
- summary_show(summaryview, item);
+ summary_show(summaryview, item, FALSE);
summary_select_by_msgnum(summaryview, selected_msgnum, FALSE);
@@ -7143,7 +7154,7 @@ static void quicksearch_execute_cb(QuickSearch *quicksearch, gpointer data)
SummaryView *summaryview = data;
summaryview_reset_recursive_folder_match(summaryview);
- if (summary_show(summaryview, summaryview->folder_item))
+ if (summary_show(summaryview, summaryview->folder_item, FALSE))
summaryview_quicksearch_recurse(summaryview);
else
summaryview_reset_recursive_folder_match(summaryview);
@@ -8135,7 +8146,7 @@ void summary_toggle_show_read_messages(SummaryView *summaryview)
source.update_flags = F_ITEM_UPDATE_NAME;
source.msg = NULL;
hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
void summary_toggle_show_del_messages(SummaryView *summaryview)
@@ -8150,7 +8161,7 @@ void summary_toggle_show_del_messages(SummaryView *summaryview)
source.update_flags = F_ITEM_UPDATE_NAME;
source.msg = NULL;
hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
void summary_toggle_show_read_threads(SummaryView *summaryview)
@@ -8165,7 +8176,7 @@ void summary_toggle_show_read_threads(SummaryView *summaryview)
source.update_flags = F_ITEM_UPDATE_NAME;
source.msg = NULL;
hooks_invoke(FOLDER_ITEM_UPDATE_HOOKLIST, &source);
- summary_show(summaryview, summaryview->folder_item);
+ summary_show(summaryview, summaryview->folder_item, FALSE);
}
static void summary_set_hide_menu (SummaryView *summaryview,
diff --git a/src/summaryview.h b/src/summaryview.h
index c90a48b2b..660572f86 100644
--- a/src/summaryview.h
+++ b/src/summaryview.h
@@ -188,7 +188,8 @@ SummaryView *summary_create(MainWindow *mainwin);
void summaryview_destroy(SummaryView *summaryview);
void summary_init (SummaryView *summaryview);
gboolean summary_show (SummaryView *summaryview,
- FolderItem *fitem);
+ FolderItem *fitem,
+ gboolean avoid_refresh);
void summary_clear_list (SummaryView *summaryview);
void summary_clear_all (SummaryView *summaryview);
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list