[Xfce4-commits] <postler:master> Pick the first text part of a message or display an error
Christian Dywan
noreply at xfce.org
Sat Jun 26 03:22:04 CEST 2010
Updating branch refs/heads/master
to 5c8b02d4b3cdff2e8657e27d6f557a93f0390975 (commit)
from 7e75ef0d79fee740537531b03910a3e25f0cdb28 (commit)
commit 5c8b02d4b3cdff2e8657e27d6f557a93f0390975
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Jun 22 20:13:43 2010 +0200
Pick the first text part of a message or display an error
postler/postler-content.vala | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/postler/postler-content.vala b/postler/postler-content.vala
index 9b697f1..40ca6aa 100644
--- a/postler/postler-content.vala
+++ b/postler/postler-content.vala
@@ -516,7 +516,15 @@ public class Postler.Content : WebKit.WebView {
body[body_parts].append_c ('\n');
}
- display_part (0);
+ int part;
+ for (part = 0; part < body_parts; part++)
+ if (mime_types[part].has_prefix ("text/"))
+ break;
+ if (mime_types[part].has_prefix ("text/"))
+ display_part(part);
+ else
+ throw new GLib.FileError.FAILED (
+ _("No text in the message that can be displayed"));
} catch (GLib.Error contents_error) {
load_string ("""
<title>%s</title>
More information about the Xfce4-commits
mailing list