From: Dirk-Jan C. Binnema Date: Mon, 17 Jul 2006 12:16:34 +0000 (+0000) Subject: * small cleanups X-Git-Tag: git_migration_finished~4492 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1cf57a6ba878c1d28ef8647cd8ad63b253f099c1;hp=64d81bebf80d459f9800395a17b4ce8fa3099e2d * small cleanups pmo-trunk-r384 --- diff --git a/src/modest-tny-msg-view.c b/src/modest-tny-msg-view.c index daeeca4..24fc97d 100644 --- a/src/modest-tny-msg-view.c +++ b/src/modest-tny-msg-view.c @@ -632,6 +632,21 @@ set_text_message (ModestTnyMsgView *self, const TnyMsgMimePartIface *tny_body, return TRUE; } + +static gboolean +set_empty_message (ModestTnyMsgView *self) +{ + ModestTnyMsgViewPrivate *priv; + + g_return_val_if_fail (self, FALSE); + priv = MODEST_TNY_MSG_VIEW_GET_PRIVATE(self); + + gtk_html_load_from_string (priv->gtkhtml, "", 1); + + return TRUE; +} + + gchar * modest_tny_msg_view_get_selected_text (ModestTnyMsgView *self) { @@ -669,6 +684,11 @@ modest_tny_msg_view_set_message (ModestTnyMsgView *self, const TnyMsgIface *msg) priv->msg = msg; + if (!msg) { + set_empty_message (self); + return; + } + body = modest_tny_msg_actions_find_body_part (msg, TRUE); if (body) { if (tny_msg_mime_part_iface_content_type_is (body, "text/html")) @@ -676,7 +696,6 @@ modest_tny_msg_view_set_message (ModestTnyMsgView *self, const TnyMsgIface *msg) else set_text_message (self, body, msg); return; - } else { - /* nothing to show */ - } + } else + set_empty_message (self); }