aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer/ChangeLog10
-rw-r--r--composer/e-msg-composer.c25
2 files changed, 23 insertions, 12 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index d00f1cef9e..4d1a38325c 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,13 @@
+2001-10-15 Larry Ewing <lewing@ximian.com>
+
+ * e-msg-composer.c (e_msg_composer_add_message_attachments):
+ s/apply/flush/.
+ (e_msg_composer_flush_pending_body): renamed from apply now takes
+ apply as an argument.
+ (e_msg_composer_show_sig_file): s/g_assert/g_return_if_fail/
+ warnings make for less painful bugs than crashes.
+ (set_editor_text): s/g_assert/g_return_if_fail/
+
2001-10-13 Dan Winship <danw@ximian.com>
* e-msg-composer.c (autosave_manager_unregister): Don't pop up an
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2615b61965..8e611843eb 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -706,8 +706,8 @@ prepare_engine (EMsgComposer *composer)
{
CORBA_Environment ev;
- g_assert (composer);
- g_assert (E_IS_MSG_COMPOSER (composer));
+ g_return_if_fail (composer != NULL);
+ g_return_if_fail (E_IS_MSG_COMPOSER (composer));
/* printf ("prepare_engine\n"); */
@@ -788,7 +788,8 @@ set_editor_text (EMsgComposer *composer, const char *text)
CORBA_exception_init (&ev);
persist = (Bonobo_PersistStream) bonobo_object_client_query_interface (
bonobo_widget_get_server (editor), "IDL:Bonobo/PersistStream:1.0", &ev);
- g_assert (persist != CORBA_OBJECT_NIL);
+
+ g_return_if_fail (persist != CORBA_OBJECT_NIL);
stream = bonobo_stream_mem_create (text, strlen (text),
TRUE, FALSE);
@@ -2444,13 +2445,15 @@ e_msg_composer_set_pending_body (EMsgComposer *composer, char *text)
}
static void
-e_msg_composer_apply_pending_body (EMsgComposer *composer)
+e_msg_composer_flush_pending_body (EMsgComposer *composer, gboolean apply)
{
char *body;
body = gtk_object_get_data (GTK_OBJECT (composer), "body:text");
if (body) {
- e_msg_composer_set_body_text (composer, body);
+ if (apply)
+ e_msg_composer_set_body_text (composer, body);
+
gtk_object_set_data (GTK_OBJECT (composer), "body:text", NULL);
g_free (body);
}
@@ -2624,12 +2627,10 @@ e_msg_composer_add_message_attachments (EMsgComposer *composer, CamelMimeMessage
e_msg_composer_set_pending_body (composer, text);
}
- if (settext) {
- /* We wait until now to set the body text because we need to ensure that
- * the attachment bar has all the attachments, before we request them.
- */
- e_msg_composer_apply_pending_body (composer);
- }
+ /* We wait until now to set the body text because we need to ensure that
+ * the attachment bar has all the attachments, before we request them.
+ */
+ e_msg_composer_flush_pending_body (composer, settext);
}
/**
@@ -2907,7 +2908,7 @@ e_msg_composer_new_from_url (const char *url_in)
if (body) {
char *htmlbody = e_text_to_html (body, E_TEXT_TO_HTML_PRE);
- set_editor_text (composer, htmlbody);
+ e_msg_composer_set_body_text (composer, htmlbody);
g_free (htmlbody);
}