2012-10-09 [mones] 3.8.1cvs86
authorRicardo Mones <mones@claws-mail.org>
Tue, 9 Oct 2012 23:58:43 +0000 (23:58 +0000)
committerRicardo Mones <mones@claws-mail.org>
Tue, 9 Oct 2012 23:58:43 +0000 (23:58 +0000)
* doc/man/claws-mail.1
* src/compose.c
* src/common/utils.c
New extra headers feature for adding user-defined
extra headers to the combobox in the compose window
Headers are stablished in 'extraheaderrc', one per
line with a final colon

ChangeLog
PATCHSETS
configure.ac
doc/man/claws-mail.1
src/common/utils.c
src/compose.c

index d938f27ed1dc2d7db56d6fa692b2dd53c7b334a6..f95fdb5e525ce4b12ca5da326b22905d40fd472e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2012-10-09 [mones]     3.8.1cvs86
+
+       * doc/man/claws-mail.1
+       * src/compose.c
+       * src/common/utils.c
+               New extra headers feature for adding user-defined
+               extra headers to the combobox in the compose window
+               Headers are stablished in 'extraheaderrc', one per
+               line with a final colon
+
 2012-10-06 [mones]     3.8.1cvs85
 
        * po/POTFILES.in
 2012-09-22 [mir]       3.8.1cvs72
 
        * src/advsearch.c
-           Fix for not searching in folders marked 'no_select'
-           patch provide by colin.
+               Fix for not searching in folders marked 'no_select'
+               patch provided by Colin.
 
 2012-09-22 [mones]     3.8.1cvs71
 
 
 2012-09-16 [mones]     3.8.1cvs60
 
-        * src/action.c                                                          
-                Removed dup calls with ignored result
-        * src/addr_compl.c                                                      
-                Removed unused var is_group and simplified logic around it      
-        * src/addrharvest.c                                                     
-        * src/matcher.c
-        * src/procmsg.c                                                         
-        * src/etpan/etpan-thread-manager.c                                      
-                Use unused var r to verify result and emit messages on error
-        * src/compose.c                                                         
-                Move color variable into conditional usage blocks
-                Remove assigned but not used vars: lock, titles, count          
-        * src/edittags.c
-                Remove assigned but not used var actions                        
-        * src/folderview.c
-                Remove assigned but not used vars: from_parent, src_node        
-        * src/imap_gtk.c
-        * src/mh_gtk.c                                                          
-                Remove malloc-ed but not used var: old_path                     
-        * src/news.c
-                Comment unused vars from commented block: tofetch, fetched      
-        * src/prefs_account.c
-                Remove assigned but not used var: privacy_enabled
-        * src/prefs_actions.c
-        * src/prefs_customheader.c
-                Remove assigned but not used var: store
-        * src/prefs_filtering.c
-                Remove assigned but not used var: n_rows
-        * src/prefs_template.c
-                Remove assigned but not used vars: model, list_store
-        * src/prefs_toolbar.c
-                Remove assigned but not used var: win_titles
-        * src/printing.c
-                Remove assigned but not used vars: orientation, line, baseline,
-                off_chars 
-        * src/etpan/imap-thread.c
-                Remove assigned but not used var: value, r
-                Refactor to check correct memory allocation
-        * src/etpan/nntp-thread.c
-                Remove assigned but not used var: value
-        * src/gtk/gtkaspell.c
-                Remove assigned but not used vars: textbuf, exist
-                Remove unused function: find_gtkaspeller
-        * src/gtk/gtkcmctree.c
-                Remove unused function: gtk_cmctree_get_offset
-        * src/gtk/gtkshruler.c
-                Remove assigned but not used vars: ruler, priv
+       * src/action.c                                                          
+               Removed dup calls with ignored result
+       * src/addr_compl.c                                                    
+               Removed unused var is_group and simplified logic around it      
+       * src/addrharvest.c                                                  
+       * src/matcher.c
+       * src/procmsg.c                                                  
+       * src/etpan/etpan-thread-manager.c                                    
+               Use unused var r to verify result and emit messages on error
+       * src/compose.c                                                  
+               Move color variable into conditional usage blocks
+               Remove assigned but not used vars: lock, titles, count    
+       * src/edittags.c
+               Remove assigned but not used var actions                        
+       * src/folderview.c
+               Remove assigned but not used vars: from_parent, src_node        
+       * src/imap_gtk.c
+       * src/mh_gtk.c                                                    
+               Remove malloc-ed but not used var: old_path                  
+       * src/news.c
+               Comment unused vars from commented block: tofetch, fetched      
+       * src/prefs_account.c
+               Remove assigned but not used var: privacy_enabled
+       * src/prefs_actions.c
+       * src/prefs_customheader.c
+               Remove assigned but not used var: store
+       * src/prefs_filtering.c
+               Remove assigned but not used var: n_rows
+       * src/prefs_template.c
+               Remove assigned but not used vars: model, list_store
+       * src/prefs_toolbar.c
+               Remove assigned but not used var: win_titles
+       * src/printing.c
+               Remove assigned but not used vars: orientation, line, baseline,
+               off_chars 
+       * src/etpan/imap-thread.c
+               Remove assigned but not used var: value, r
+               Refactor to check correct memory allocation
+       * src/etpan/nntp-thread.c
+               Remove assigned but not used var: value
+       * src/gtk/gtkaspell.c
+               Remove assigned but not used vars: textbuf, exist
+               Remove unused function: find_gtkaspeller
+       * src/gtk/gtkcmctree.c
+               Remove unused function: gtk_cmctree_get_offset
+       * src/gtk/gtkshruler.c
+               Remove assigned but not used vars: ruler, priv
 
 2012-09-14 [mones]     3.8.1cvs59
 
 2012-09-12 [mones]     3.8.1cvs54
 
        * src/prefs_other.c
-               Fix 1975 'preference mutt key bindings do not take effect'
-               (and the other invalid paths too)
+               Fix bug #1975 'preference mutt key bindings do not take
+               effect' (and the other invalid paths too)
 
 2012-09-12 [colin]     3.8.1cvs53
 
index a8c2559615a41f7fb496c44fec426ce6835d922d..1d4bce508a2e13c4c33c4fa12245d37c91ca4fb3 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.5 -r 1.1.2.6 src/advsearch.c;  ) > 3.8.1cvs83.patchset
 ( cvs diff -u -r 1.179.2.266 -r 1.179.2.267 src/imap.c;  ) > 3.8.1cvs84.patchset
 ( cvs diff -u -r 1.53.2.38 -r 1.53.2.39 po/POTFILES.in;  cvs diff -u -r 1.274.2.353 -r 1.274.2.354 src/mainwindow.c;  cvs diff -u -r 1.9.2.59 -r 1.9.2.60 src/common/defs.h;  cvs diff -u -r 1.5.2.47 -r 1.5.2.48 src/gtk/menu.c;  cvs diff -u -r 1.4.2.27 -r 1.4.2.28 src/gtk/menu.h;  ) > 3.8.1cvs85.patchset
+( cvs diff -u -r 1.396.2.3641 -r 1.396.2.3642 ChangeLog;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 doc/man/claws-mail.1;  cvs diff -u -r 1.382.2.613 -r 1.382.2.614 src/compose.c;  cvs diff -u -r 1.36.2.201 -r 1.36.2.202 src/common/utils.c;  ) > 3.8.1cvs86.patchset
index 29a769d4ad0ce25daf9ac903188eaa52c385ae1e..b889cbc40479a8199d891abbc591eece36c55255 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=85
+EXTRA_VERSION=86
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 7254aa27656e332abb2b86fd1c8bad766eb39f3f..11c0829532d6eb7c8cf6449655d4c701d22114f4 100644 (file)
@@ -202,6 +202,9 @@ Configuration for custom headers for sending mail
 .TP 
 $HOME/.claws\-mail/dispheaderrc
 Configuration for custom display of headers in message view
+.TP
+$HOME/.claws\-mail/extraheaderrc
+Editable extra headers to be added to compose window combobox
 .TP 
 $HOME/.claws\-mail/folderitemrc
 All folders' attributes
index a18367935f14627407cba52be56c2e5d2b3984cd..e252ff80f0ff15c4985e9675808888183fef7c70 100644 (file)
@@ -258,10 +258,14 @@ void list_free_strings(GList *list)
 
 void slist_free_strings(GSList *list)
 {
+#if GLIB_CHECK_VERSION(2,28,0)
+       g_slist_free_full(list, (GDestroyNotify)g_free);
+#else
        while (list != NULL) {
                g_free(list->data);
                list = list->next;
        }
+#endif
 }
 
 static void hash_free_strings_func(gpointer key, gpointer value, gpointer data)
index 028e02f63b7758cb9be2dcaa9615777f1fbd7ab8..b827336ad215ea25888a4d1c4f2c27d2e18a1f67 100644 (file)
@@ -183,6 +183,7 @@ typedef enum {
 #define MAX_REFERENCES_LEN     999
 
 static GList *compose_list = NULL;
+static GSList *extra_headers = NULL;
 
 static Compose *compose_generic_new                    (PrefsAccount   *account,
                                                 const gchar    *to,
@@ -6597,6 +6598,54 @@ static void compose_entry_popup_extend(GtkEntry *entry, GtkMenu *menu, gpointer
        gtk_widget_show(menuitem);
 }
 
+void compose_add_extra_header(gchar *header, GtkListStore *model)
+{
+       GtkTreeIter iter;
+       if (strcmp(header, "")) {
+               COMBOBOX_ADD(model, header, COMPOSE_TO);
+       }
+}
+
+void compose_add_extra_header_entries(GtkListStore *model)
+{
+       FILE *exh;
+       gchar *exhrc;
+       gchar buf[BUFFSIZE];
+       gint lastc;
+
+       if (extra_headers == NULL) {
+               exhrc = g_strconcat(get_rc_dir(), G_DIR_SEPARATOR_S, "extraheaderrc", NULL);
+               if ((exh = g_fopen(exhrc, "rb")) == NULL) {
+                       debug_print("extra headers file not found\n");
+                       goto extra_headers_done;
+               }
+               while (fgets(buf, BUFFSIZE, exh) != NULL) {
+                       lastc = strlen(buf) - 1;        /* remove trailing \n */
+                       buf[lastc] = (buf[lastc] == '\n')? '\0': buf[lastc];
+                       --lastc;
+                       if (lastc > 0 && buf[0] != '#' && buf[lastc] == ':') {
+                               buf[lastc] = '\0'; /* remove trailing : for comparison */
+                               if (custom_header_is_allowed(buf)) {
+                                       buf[lastc] = ':';
+                                       extra_headers = g_slist_prepend(extra_headers, g_strdup(buf));
+                               }
+                               else
+                                       g_message("disallowed extra header line: %s\n", buf);
+                       }
+                       else {
+                               if (buf[0] != '#')
+                                       g_message("invalid extra header line: %s\n", buf);
+                       }
+               }
+               fclose(exh);
+extra_headers_done:
+               g_free(exhrc);
+               extra_headers = g_slist_prepend(extra_headers, g_strdup("")); /* end of list */
+               extra_headers = g_slist_reverse(extra_headers);
+       }
+       g_slist_foreach(extra_headers, (GFunc)compose_add_extra_header, (gpointer)model);
+}
+
 static void compose_create_header_entry(Compose *compose) 
 {
        gchar *headers[] = {"To:", "Cc:", "Bcc:", "Newsgroups:", "Reply-To:", "Followup-To:", NULL};
@@ -6632,6 +6681,7 @@ static void compose_create_header_entry(Compose *compose)
                        COMPOSE_REPLYTO);
        COMBOBOX_ADD(model, prefs_common_translated_header_name("Followup-To:"),
                        COMPOSE_FOLLOWUPTO);
+       compose_add_extra_header_entries(model);
 
        gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
        g_signal_connect(G_OBJECT(gtk_bin_get_child(GTK_BIN(combo))), "grab_focus",
@@ -8492,6 +8542,9 @@ static void compose_destroy(Compose *compose)
        slist_free_strings(compose->header_list);
        g_slist_free(compose->header_list);
 
+       slist_free_strings(extra_headers);
+       extra_headers = NULL;
+
        compose->header_list = compose->newsgroup_list = compose->to_list = NULL;
 
        g_hash_table_destroy(compose->email_hashtable);