[Commits] [SCM] claws branch, master, updated. 3.14.1-35-g3f46e81

claws at claws-mail.org claws at claws-mail.org
Mon Dec 12 11:18:04 CET 2016


The branch, master has been updated
       via  3f46e81d2cc34000fd5de4b4a6c0f6f6b0afdd03 (commit)
      from  f37bbdecf9791f5b427e16e7951df766de1034e6 (commit)

Summary of changes:
 src/compose.c |   30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)


- Log -----------------------------------------------------------------
commit 3f46e81d2cc34000fd5de4b4a6c0f6f6b0afdd03
Author: Paul <paul at claws-mail.org>
Date:   Mon Dec 12 10:17:59 2016 +0000

    don't remove the To when changing account

diff --git a/src/compose.c b/src/compose.c
index 65c447a..7f44aec 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9742,7 +9742,8 @@ static void account_activated(GtkComboBox *optmenu, gpointer data)
 	gint account_id = 0;
 	GtkTreeModel *menu;
 	GtkTreeIter iter;
-	GSList *list = NULL;
+	GSList *list, *saved_list = NULL;
+	HeaderEntryState *state;
 
 	/* Get ID of active account in the combo box */
 	menu = gtk_combo_box_get_model(optmenu);
@@ -9758,8 +9759,19 @@ static void account_activated(GtkComboBox *optmenu, gpointer data)
 		for (list = compose->header_list; list; list = list->next) {
 			ComposeHeaderEntry *hentry=(ComposeHeaderEntry *)list->data;
 			
-			if (hentry->type == PREF_ACCOUNT || !list->next)
+			if (hentry->type == PREF_ACCOUNT || !list->next) {
 				compose_destroy_headerentry(compose, hentry);
+				continue;
+			}
+			state = g_malloc0(sizeof(HeaderEntryState));
+			state->header = gtk_editable_get_chars(GTK_EDITABLE(
+					gtk_bin_get_child(GTK_BIN(hentry->combo))), 0, -1);
+			state->entry = gtk_editable_get_chars(
+					GTK_EDITABLE(hentry->entry), 0, -1);
+			state->type = hentry->type;
+
+			saved_list = g_slist_append(saved_list, state);
+			compose_destroy_headerentry(compose, hentry);
 		}
 
 		compose->header_last = NULL;
@@ -9784,6 +9796,20 @@ static void account_activated(GtkComboBox *optmenu, gpointer data)
 			compose_entry_mark_default_to(compose, ac->auto_replyto);
 		}
 		
+		for (list = saved_list; list; list = list->next) {
+			state = (HeaderEntryState *) list->data;
+
+			compose_add_header_entry(compose, state->header,
+						state->entry, state->type);
+			if (state->entry_marked)
+				compose_entry_mark_default_to(compose, state->entry);
+
+			g_free(state->header);
+			g_free(state->entry);
+			g_free(state);
+		}
+		g_slist_free(saved_list);
+
 		combobox_select_by_data(GTK_COMBO_BOX(compose->header_last->combo),
 					(ac->protocol == A_NNTP) ? 
 					COMPOSE_NEWSGROUPS : COMPOSE_TO);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list