From 5adec85dc2cc832e68463e97a534a913165f6587 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Mon, 29 Jan 2007 08:37:37 +0000 Subject: [PATCH] * Updated to the new implementation of tny_camel_header_get_xxx methods pmo-trunk-r749 --- src/gtk/modest-edit-msg-window.c | 8 +++----- src/modest-formatter.c | 5 ++++- src/modest-mail-operation.c | 3 +-- src/modest-text-utils.c | 5 ++++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gtk/modest-edit-msg-window.c b/src/gtk/modest-edit-msg-window.c index 705e396..fb4aaf8 100644 --- a/src/gtk/modest-edit-msg-window.c +++ b/src/gtk/modest-edit-msg-window.c @@ -302,13 +302,11 @@ modest_edit_msg_window_set_msg (ModestEditMsgWindow *self, TnyMsg *msg) bcc = tny_header_get_bcc (header); subject = tny_header_get_subject (header); - /* TODO: the comparison with Invalid is ugly, should be fixed - in tinymail -> TnyCamelHeader */ - if (strcmp (to, "Invalid")) + if (to) gtk_entry_set_text (GTK_ENTRY(priv->to_field), to); - if (strcmp (cc, "Invalid")) + if (cc) gtk_entry_set_text (GTK_ENTRY(priv->cc_field), cc); - if (strcmp (bcc, "Invalid")) + if (bcc) gtk_entry_set_text (GTK_ENTRY(priv->bcc_field), bcc); if (subject) gtk_entry_set_text (GTK_ENTRY(priv->subject_field), subject); diff --git a/src/modest-formatter.c b/src/modest-formatter.c index 19d1879..ddbd2e5 100644 --- a/src/modest-formatter.c +++ b/src/modest-formatter.c @@ -27,6 +27,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include #include @@ -171,6 +172,7 @@ modest_formatter_attach (ModestFormatter *self, TnyMimePart *body, TnyHeader *he { TnyMsg *new_msg = NULL; gchar *attach_text = NULL; + const gchar *subject; TnyMimePart *body_part = NULL, *attach_part = NULL; ModestFormatterPrivate *priv; TnyPlatformFactory *fact; @@ -186,7 +188,8 @@ modest_formatter_attach (ModestFormatter *self, TnyMimePart *body, TnyHeader *he attach_text = extract_text (self, body); construct_from_text (body_part, "", priv->content_type); construct_from_text (attach_part, (const gchar*) attach_text, priv->content_type); - tny_mime_part_set_filename (attach_part, tny_header_get_subject (header)); + subject = tny_header_get_subject (header); + tny_mime_part_set_filename (attach_part, subject ? subject : _("No subject")); /* Add parts */ tny_mime_part_add_part (TNY_MIME_PART (new_msg), body_part); diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 3c17847..d67f7fb 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -402,8 +402,7 @@ modest_mail_operation_create_reply_mail (TnyMsg *msg, new_header = tny_msg_get_header (new_msg); reply_to = tny_header_get_replyto (header); - /* TODO: tinymail returns Invalid and it should return NULL */ - if (strcmp (reply_to, "Invalid")) + if (reply_to) tny_header_set_to (new_header, reply_to); else tny_header_set_to (new_header, tny_header_get_from (header)); diff --git a/src/modest-text-utils.c b/src/modest-text-utils.c index 6f84320..88b40ea 100644 --- a/src/modest-text-utils.c +++ b/src/modest-text-utils.c @@ -146,6 +146,10 @@ modest_text_utils_cite (const gchar *text, { gchar *tmp, *retval; + g_return_val_if_fail (text, NULL); + g_return_val_if_fail (content_type, NULL); + g_return_val_if_fail (from, NULL); + tmp = cite (sent_date, from); retval = g_strdup_printf ("%s%s\n", tmp, text); g_free (tmp); @@ -177,7 +181,6 @@ modest_text_utils_inline (const gchar *text, g_return_val_if_fail (from, NULL); g_return_val_if_fail (text, NULL); g_return_val_if_fail (to, NULL); - g_return_val_if_fail (subject, NULL); modest_text_utils_strftime (sent_str, 100, "%c", sent_date); -- 1.7.9.5