diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-07-06 02:02:01 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-07-06 02:40:10 +0800 |
commit | 005a26de4534cfaf534e8e4828366b619a3b21d1 (patch) | |
tree | e9247d1dfa10750a07335647cf37f43b158a8817 /plugins/audio-inline | |
parent | 17127fbee9fd1b0baecb4e305c005d6abbf8d880 (diff) | |
download | gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.tar.gz gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.tar.zst gsoc2013-evolution-005a26de4534cfaf534e8e4828366b619a3b21d1.zip |
Avoid camel_stream_printf().
camel_stream_printf() is next on the chopping block.
Use g_strdup_printf() or a GString to construct a formatted string in
memory, pass it to camel_stream_write() in one go, and then check for
errors (unless it's a memory stream).
Diffstat (limited to 'plugins/audio-inline')
-rw-r--r-- | plugins/audio-inline/audio-inline.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/plugins/audio-inline/audio-inline.c b/plugins/audio-inline/audio-inline.c index 507bc953e9..07b1bd679b 100644 --- a/plugins/audio-inline/audio-inline.c +++ b/plugins/audio-inline/audio-inline.c @@ -294,16 +294,22 @@ void org_gnome_audio_inline_format (gpointer ep, EMFormatHookTarget *t) { struct _org_gnome_audio_inline_pobject *pobj; - gchar *classid = g_strdup_printf ("org-gnome-audio-inline-button-panel-%d", org_gnome_audio_class_id_counter); + gchar *classid; + gchar *content; + + classid = g_strdup_printf ( + "org-gnome-audio-inline-button-panel-%d", + org_gnome_audio_class_id_counter); org_gnome_audio_class_id_counter++; d(printf ("audio inline formatter: format classid %s\n", classid)); - pobj = (struct _org_gnome_audio_inline_pobject *) em_format_html_add_pobject ((EMFormatHTML *) t->format, sizeof (*pobj), classid, - t->part, org_gnome_audio_inline_button_panel); - g_object_ref (t->part); - pobj->part = t->part; + pobj = (struct _org_gnome_audio_inline_pobject *) + em_format_html_add_pobject ( + (EMFormatHTML *) t->format, sizeof (*pobj), classid, + t->part, org_gnome_audio_inline_button_panel); + pobj->part = g_object_ref (t->part); pobj->filename = NULL; pobj->playbin = NULL; pobj->play_button = NULL; @@ -313,5 +319,7 @@ org_gnome_audio_inline_format (gpointer ep, EMFormatHookTarget *t) pobj->object.free = org_gnome_audio_inline_pobject_free; pobj->target_state = GST_STATE_NULL; - camel_stream_printf (t->stream, "<object classid=%s></object>\n", classid); + content = g_strdup_printf ("<object classid=%s></object>\n", classid); + camel_stream_write_string (t->stream, content, NULL, NULL); + g_free (content); } |