2008-04-23 [colin] 3.4.0cvs9
authorColin Leroy <colin@colino.net>
Wed, 23 Apr 2008 19:01:24 +0000 (19:01 +0000)
committerColin Leroy <colin@colino.net>
Wed, 23 Apr 2008 19:01:24 +0000 (19:01 +0000)
* src/compose.c
* src/prefs_folder_item.c
* src/prefs_template.c
* src/quote_fmt.c
Fix bug 1576: Fix unescaping of templates when testing them
I think it breaks nothing. (wwp, you're welcome to double-check)

ChangeLog
PATCHSETS
configure.ac
src/compose.c
src/prefs_folder_item.c
src/prefs_template.c
src/quote_fmt.c

index 35d4ea11ae785df7bcb14a6a83d5e073fff75dc4..fff149530182f6caa7bcb5dd53b94830ef2014e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-23 [colin]     3.4.0cvs9
+
+       * src/compose.c
+       * src/prefs_folder_item.c
+       * src/prefs_template.c
+       * src/quote_fmt.c
+               Fix bug 1576: Fix unescaping of templates when testing them
+               I think it breaks nothing. (wwp, you're welcome to double-check)
+
 2008-04-23 [paul]      3.4.0cvs8
 
        * manual/advanced.xml
index 70b9faac5bbaae753175efa5c8374bf7eb8a743f..e61fbb22e81ed31c0c7c319fae9361e2229d3bf5 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.149.2.88 -r 1.149.2.89 src/inc.c;  cvs diff -u -r 1.43.2.70 -r 1.43.2.71 src/prefs_matcher.c;  cvs diff -u -r 1.17.2.46 -r 1.17.2.47 src/send_message.c;  ) > 3.4.0cvs6.patchset
 ( cvs diff -u -r 1.204.2.165 -r 1.204.2.166 src/prefs_common.c;  cvs diff -u -r 1.103.2.106 -r 1.103.2.107 src/prefs_common.h;  cvs diff -u -r 1.395.2.364 -r 1.395.2.365 src/summaryview.c;  ) > 3.4.0cvs7.patchset
 ( cvs diff -u -r 1.1.2.46 -r 1.1.2.47 manual/advanced.xml;  ) > 3.4.0cvs8.patchset
+( cvs diff -u -r 1.382.2.443 -r 1.382.2.444 src/compose.c;  cvs diff -u -r 1.52.2.62 -r 1.52.2.63 src/prefs_folder_item.c;  cvs diff -u -r 1.12.2.61 -r 1.12.2.62 src/prefs_template.c;  cvs diff -u -r 1.8.2.33 -r 1.8.2.34 src/quote_fmt.c;  ) > 3.4.0cvs9.patchset
index 3c1f5f2e8438f2182af25d5fc0ee5b620c94c0f0..09a2b0c573c0be3cc3be80e465df498a427f2b59 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=8
+EXTRA_VERSION=9
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index a455ac84ca4bf3d59be0f69c25c8aaaa81e1d38b..1194db0752ff5a9a79b1bd33aa4981d066600f54 100644 (file)
@@ -9261,7 +9261,8 @@ static void entry_paste_clipboard(Compose *compose, GtkWidget *entry,
                }
        } else if (GTK_IS_EDITABLE(entry))
                gtk_editable_paste_clipboard (GTK_EDITABLE(entry));
-       
+
+       compose->modified = TRUE;
 }
 
 static void entry_allsel(GtkWidget *entry)
index ccf8d16719c48a4926f3f4d844a05732013d13ad..e61dbfad702f1466d3bc2cc7944ece993e17335e 100644 (file)
@@ -1305,6 +1305,7 @@ static void templates_save_folder_prefs(FolderItem *folder, FolderItemTemplatesP
        /* save and check formats */
 
        if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->new_msg_format_rec_checkbtn))) {
+               
                prefs->compose_with_format =
                        gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->checkbtn_compose_with_format));
                prefs->compose_override_from_format = pref_get_pref_from_entry(
@@ -1314,9 +1315,9 @@ static void templates_save_folder_prefs(FolderItem *folder, FolderItemTemplatesP
                prefs->compose_body_format = pref_get_pref_from_textview(
                                GTK_TEXT_VIEW(page->compose_body_format));
                quotefmt_check_new_msg_formats(prefs->compose_with_format,
-                                                                               prefs->compose_override_from_format,
-                                                                               prefs->compose_subject_format,
-                                                                               prefs->compose_body_format);
+                                               prefs->compose_override_from_format,
+                                               prefs->compose_subject_format,
+                                               prefs->compose_body_format);
        }
 
        if (all || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(page->reply_format_rec_checkbtn))) {
index b53bfb595f620043b54a159ec337d9ac923f5372..cc3db46571e942c3072e6f3ff70ee52d41bab03a 100644 (file)
@@ -640,18 +640,26 @@ gboolean prefs_template_string_is_valid(gchar *string, gint *line, gboolean esca
 {
        gboolean result = TRUE;
        if (string && *string != '\0') {
+               gchar *tmp = NULL;
                gchar *parsed_buf;
                MsgInfo dummyinfo;
                PrefsAccount *account = account_get_default();
 
+               if (escaped_string) {
+                       tmp = malloc(strlen(string)+1);
+                       pref_get_unescaped_pref(tmp, string);
+               } else {
+                       tmp = g_strdup(string);
+               }
                memset(&dummyinfo, 0, sizeof(MsgInfo));
 #ifdef USE_ASPELL
-               quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, escaped_string, NULL);
+               quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, FALSE, NULL);
 #else
-               quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, escaped_string);
+               quote_fmt_init(&dummyinfo, NULL, NULL, TRUE, account, FALSE);
 #endif
-               quote_fmt_scan_string(string);
+               quote_fmt_scan_string(tmp);
                quote_fmt_parse();
+               g_free(tmp);
                parsed_buf = quote_fmt_get_buffer();
                if (!parsed_buf) {
                        if (line)
@@ -700,7 +708,7 @@ static gboolean prefs_template_list_view_set_row(gint row)
                        g_free(value);
                value = NULL;
                }
-       if (!prefs_template_string_is_valid(value, &line, FALSE, FALSE)) {
+       if (!prefs_template_string_is_valid(value, &line, TRUE, FALSE)) {
                alertpanel_error(_("Template body format error at line %d."), line);
                g_free(value);
                return FALSE;
@@ -745,31 +753,31 @@ static gboolean prefs_template_list_view_set_row(gint row)
                subject = NULL;
        }
 
-       if (!prefs_template_string_is_valid(from, NULL, FALSE, TRUE)) {
+       if (!prefs_template_string_is_valid(from, NULL, TRUE, TRUE)) {
                alertpanel_error(_("Template From format error."));
                g_free(from);
                g_free(value);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(to, NULL, FALSE, TRUE)) {
+       if (!prefs_template_string_is_valid(to, NULL, TRUE, TRUE)) {
                alertpanel_error(_("Template To format error."));
                g_free(to);
                g_free(value);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(cc, NULL, FALSE, TRUE)) {
+       if (!prefs_template_string_is_valid(cc, NULL, TRUE, TRUE)) {
                alertpanel_error(_("Template Cc format error."));       
                g_free(cc);
                g_free(value);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(bcc, NULL, FALSE, TRUE)) {
+       if (!prefs_template_string_is_valid(bcc, NULL, TRUE, TRUE)) {
                alertpanel_error(_("Template Bcc format error."));      
                g_free(bcc);
                g_free(value);
                return FALSE;
        }
-       if (!prefs_template_string_is_valid(subject, NULL, FALSE, FALSE)) {
+       if (!prefs_template_string_is_valid(subject, NULL, TRUE, FALSE)) {
                alertpanel_error(_("Template subject format error."));  
                g_free(subject);
                g_free(value);
index b510ee29f2b3d93da9f5569dc9f681b8e0b04c7c..3f230c0562e081c51dabca2ec4d410681c580895 100644 (file)
@@ -523,17 +523,17 @@ void quotefmt_add_defaults_button(GtkWindow *parent_window,
 }
 
 void quotefmt_check_new_msg_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
-                                                                       gchar *subject_fmt,
-                                                                       gchar *body_fmt)
+                                   gchar *override_from_fmt,
+                                   gchar *subject_fmt,
+                                   gchar *body_fmt)
 {
        if (use_format) {
                gint line;
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE, TRUE))
+               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
                        alertpanel_error(_("New message From format error."));
 
-               if (!prefs_template_string_is_valid(subject_fmt, NULL, FALSE, FALSE))
+               if (!prefs_template_string_is_valid(subject_fmt, NULL, TRUE, FALSE))
                        alertpanel_error(_("New message subject format error."));
 
                if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {
@@ -543,17 +543,17 @@ void quotefmt_check_new_msg_formats(gboolean use_format,
 }
 
 void quotefmt_check_reply_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
-                                                                       gchar *quotation_mark,
-                                                                       gchar *body_fmt)
+                                 gchar *override_from_fmt,
+                                 gchar *quotation_mark,
+                                 gchar *body_fmt)
 {
        if (use_format) {
                gint line;
 
-               if (!prefs_template_string_is_valid(quotation_mark, NULL, FALSE, FALSE))
+               if (!prefs_template_string_is_valid(quotation_mark, NULL, TRUE, FALSE))
                        alertpanel_error(_("Message reply quotation mark format error."));
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE, TRUE))
+               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
                        alertpanel_error(_("Message reply From format error."));
 
                if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {
@@ -563,17 +563,17 @@ void quotefmt_check_reply_formats(gboolean use_format,
 }
 
 void quotefmt_check_forward_formats(gboolean use_format,
-                                                                       gchar *override_from_fmt,
-                                                                       gchar *quotation_mark,
-                                                                       gchar *body_fmt)
+                                   gchar *override_from_fmt,
+                                   gchar *quotation_mark,
+                                   gchar *body_fmt)
 {
        if (use_format) {
                gint line;
 
-               if (!prefs_template_string_is_valid(quotation_mark, NULL, FALSE, FALSE))
+               if (!prefs_template_string_is_valid(quotation_mark, NULL, TRUE, FALSE))
                        alertpanel_error(_("Message forward quotation mark format error."));
 
-               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, FALSE, TRUE))
+               if (override_from_fmt && !prefs_template_string_is_valid(override_from_fmt, NULL, TRUE, TRUE))
                        alertpanel_error(_("Message forward From format error."));
 
                if (!prefs_template_string_is_valid(body_fmt, &line, TRUE, FALSE)) {