diff options
author | Dan Winship <danw@src.gnome.org> | 2000-07-04 08:56:45 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-07-04 08:56:45 +0800 |
commit | 7ad9e599926815d42e88dc2a9a9037fc860d143c (patch) | |
tree | c916504956411e0decadac84f9bc06e83d18bd9e /mail/mail-display.c | |
parent | 323c4f2062fce5c4d12210bfdf013ec3b058d6df (diff) | |
download | gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar.gz gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar.bz2 gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar.lz gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar.xz gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.tar.zst gsoc2013-evolution-7ad9e599926815d42e88dc2a9a9037fc860d143c.zip |
call mail_display_set_message with NULL if the message we tried to select
* message-list.c (select_msg): call mail_display_set_message with
NULL if the message we tried to select doesn't exist (probably
meaning we tried to selecte the first message and the folder is
empty.)
* mail-display.c (mail_display_set_message): deal with NULL as an
input (meaning "undisplay previous message and display nothing").
svn path=/trunk/; revision=3879
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c index b5db4c69e1..cdd701ea4b 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -318,7 +318,7 @@ mail_html_write (GtkHTML *html, GtkHTMLStream *stream, /** * mail_display_set_message: * @mail_display: the mail display object - * @mime_message: the input camel medium + * @medium: the input camel medium, or %NULL * * Makes the mail_display object show the contents of the medium * param. This means feeding mail_display->body_stream and @@ -333,30 +333,30 @@ mail_display_set_message (MailDisplay *mail_display, GtkAdjustment *adj; /* - * for the moment, camel-formatter deals only with - * mime messages, but in the future, it should be - * able to deal with any medium. - * It can work on pretty much data wrapper, but in - * fact, only the medium class has the distinction - * header / body + * For the moment, we deal only with CamelMimeMessage, but in + * the future, we should be able to deal with any medium. */ - if (!CAMEL_IS_MIME_MESSAGE (medium)) + if (medium && !CAMEL_IS_MIME_MESSAGE (medium)) return; /* Clean up from previous message. */ if (mail_display->current_message) gtk_object_unref (GTK_OBJECT (mail_display->current_message)); - mail_display->current_message = CAMEL_MIME_MESSAGE (medium); - gtk_object_ref (GTK_OBJECT (medium)); + mail_display->current_message = (CamelMimeMessage*)medium; - gtk_object_set_data (GTK_OBJECT (mail_display->html), "message", medium); stream = gtk_html_begin (mail_display->html); mail_html_write (mail_display->html, stream, "%s%s", HTML_HEADER, "<BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\">\n"); - mail_format_mime_message (CAMEL_MIME_MESSAGE (medium), - mail_display->html, stream, - CAMEL_MIME_MESSAGE (medium)); + + if (medium) { + gtk_object_ref (GTK_OBJECT (medium)); + gtk_object_set_data (GTK_OBJECT (mail_display->html), + "message", medium); + mail_format_mime_message (CAMEL_MIME_MESSAGE (medium), + mail_display->html, stream, + CAMEL_MIME_MESSAGE (medium)); + } mail_html_write (mail_display->html, stream, "</BODY></HTML>\n"); gtk_html_end (mail_display->html, stream, GTK_HTML_STREAM_OK); |