commit ddf9af77a8c8d3dfcc6b409d187cb9424e8fe494
parent 41581c6b470611f3f6ecce74ac334773ddee9ecb
Author: Colin Leroy <colin@colino.net>
Date: Wed, 23 Apr 2008 19:01:24 +0000
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)
Diffstat:
7 files changed, 49 insertions(+), 29 deletions(-)
diff --git 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
diff --git a/PATCHSETS b/PATCHSETS
@@ -3304,3 +3304,4 @@
( 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
diff --git a/configure.ac b/configure.ac
@@ -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=
diff --git a/src/compose.c b/src/compose.c
@@ -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)
diff --git a/src/prefs_folder_item.c b/src/prefs_folder_item.c
@@ -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))) {
diff --git a/src/prefs_template.c b/src/prefs_template.c
@@ -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);
diff --git a/src/quote_fmt.c b/src/quote_fmt.c
@@ -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)) {