From f2005e3b2f17eb9870cc477fdc4a391919abc4be Mon Sep 17 00:00:00 2001 From: Přemysl Janouch Date: Fri, 4 Feb 2011 17:17:57 +0100 Subject: Make LdDiagram work with json-glib 0.10. --- liblogdiag/ld-diagram.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'liblogdiag') diff --git a/liblogdiag/ld-diagram.c b/liblogdiag/ld-diagram.c index 3120c58..9acea59 100644 --- a/liblogdiag/ld-diagram.c +++ b/liblogdiag/ld-diagram.c @@ -393,6 +393,8 @@ ld_diagram_save_to_file (LdDiagram *self, GFileOutputStream *file_stream; JsonGenerator *generator; JsonNode *root; + gchar *buffer; + gsize length; GError *local_error; g_return_val_if_fail (LD_IS_DIAGRAM (self), FALSE); @@ -428,10 +430,12 @@ ld_diagram_save_to_file (LdDiagram *self, json_node_free (root); local_error = NULL; - json_generator_to_stream (generator, G_OUTPUT_STREAM (file_stream), - NULL, &local_error); + buffer = json_generator_to_data (generator, &length); + g_output_stream_write (G_OUTPUT_STREAM (file_stream), + buffer, length, NULL, &local_error); g_object_unref (file_stream); g_object_unref (generator); + g_free (buffer); if (local_error) { -- cgit v1.2.3-70-g09d2