diff options
author | Jeffrey Stedfast <fejj@helixcode.com> | 2000-08-29 03:33:45 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2000-08-29 03:33:45 +0800 |
commit | 1e291c07c0b145d4d4183c92cd83867a61fd38ed (patch) | |
tree | c49da1220e1b1c3ec846cdbccf325904e267c0e4 /composer/e-msg-composer-hdrs.c | |
parent | fe8cf8c71d99d823d40bf09059e8312399d8e85e (diff) | |
download | gsoc2013-evolution-1e291c07c0b145d4d4183c92cd83867a61fd38ed.tar.gz gsoc2013-evolution-1e291c07c0b145d4d4183c92cd83867a61fd38ed.tar.zst gsoc2013-evolution-1e291c07c0b145d4d4183c92cd83867a61fd38ed.zip |
Set the "From" address in the CamelMimeMessage. Also updated to use
2000-08-28 Jeffrey Stedfast <fejj@helixcode.com>
* e-msg-composer-hdrs.c (e_msg_composer_hdrs_to_message): Set the
"From" address in the CamelMimeMessage. Also updated to use
get_subject to both make our lives easier and prepare for using UTF8
(e_msg_composer_hdrs_get_subject): Updated to behave similarly to
get_from and return allocated memory (it will have to return
allocated memory once it's converted to use UTF8 anyways)
* e-msg-composer.c (setup_save_draft): Always set
composer->send_html = TRUE so that formatting is preserved.
svn path=/trunk/; revision=5084
Diffstat (limited to 'composer/e-msg-composer-hdrs.c')
-rw-r--r-- | composer/e-msg-composer-hdrs.c | 57 |
1 files changed, 29 insertions, 28 deletions
diff --git a/composer/e-msg-composer-hdrs.c b/composer/e-msg-composer-hdrs.c index 31dbed9e39..96e2fded2e 100644 --- a/composer/e-msg-composer-hdrs.c +++ b/composer/e-msg-composer-hdrs.c @@ -518,18 +518,22 @@ void e_msg_composer_hdrs_to_message (EMsgComposerHdrs *hdrs, CamelMimeMessage *msg) { - const gchar *s; - + gchar *subject; + gchar *from; + g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); g_return_if_fail (msg != NULL); g_return_if_fail (CAMEL_IS_MIME_MESSAGE (msg)); - - gtk_object_get(GTK_OBJECT(hdrs->priv->subject_entry), - "text", &s, - NULL); - camel_mime_message_set_subject (msg, g_strdup (s)); - + + subject = e_msg_composer_hdrs_get_subject (hdrs); + camel_mime_message_set_subject (msg, subject); + g_free (subject); + + from = e_msg_composer_hdrs_get_from (hdrs); + camel_mime_message_set_from (msg, from); + g_free (from); + set_recipients (msg, hdrs->priv->to_entry, CAMEL_RECIPIENT_TYPE_TO); set_recipients (msg, hdrs->priv->cc_entry, CAMEL_RECIPIENT_TYPE_CC); set_recipients (msg, hdrs->priv->bcc_entry, CAMEL_RECIPIENT_TYPE_BCC); @@ -563,7 +567,7 @@ e_msg_composer_hdrs_set_from (EMsgComposerHdrs *hdrs, g_return_if_fail (hdrs != NULL); g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); - + entry = GTK_ENTRY (GTK_COMBO (hdrs->priv->from_entry)->entry); e_utf8_gtk_entry_set_text (entry, from); } @@ -606,14 +610,11 @@ e_msg_composer_hdrs_set_subject (EMsgComposerHdrs *hdrs, g_return_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs)); g_return_if_fail (subject != NULL); - gtk_object_set(GTK_OBJECT(hdrs->priv->subject_entry), - "text", subject, - NULL); + gtk_object_set (GTK_OBJECT (hdrs->priv->subject_entry), + "text", subject, + NULL); } -/* - * Hmmm... this introduces possible memory leak, but syntax suggest allocated string - */ char * e_msg_composer_hdrs_get_from (EMsgComposerHdrs *hdrs) { @@ -629,9 +630,9 @@ e_msg_composer_hdrs_get_to (EMsgComposerHdrs *hdrs) { g_return_val_if_fail (hdrs != NULL, NULL); g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL); - + g_assert_not_reached (); - + return NULL; } @@ -641,9 +642,9 @@ e_msg_composer_hdrs_get_cc (EMsgComposerHdrs *hdrs) { g_return_val_if_fail (hdrs != NULL, NULL); g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL); - + g_assert_not_reached (); - + return NULL; } @@ -653,25 +654,25 @@ e_msg_composer_hdrs_get_bcc (EMsgComposerHdrs *hdrs) { g_return_val_if_fail (hdrs != NULL, NULL); g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL); - + g_assert_not_reached (); - + return NULL; } -const char * +/* FIXME: This is just changed to return allooc'd mem to be consistant with get_from */ +char * e_msg_composer_hdrs_get_subject (EMsgComposerHdrs *hdrs) { gchar *subject; - + g_return_val_if_fail (hdrs != NULL, NULL); g_return_val_if_fail (E_IS_MSG_COMPOSER_HDRS (hdrs), NULL); - - gtk_object_get(GTK_OBJECT(hdrs->priv->subject_entry), - "text", &subject, - NULL); - return subject; + gtk_object_get (GTK_OBJECT (hdrs->priv->subject_entry), + "text", &subject, NULL); + + return g_strdup (subject); } |