Make LdDiagram work with json-glib 0.10.
This commit is contained in:
parent
e651ac258a
commit
f2005e3b2f
|
@ -393,6 +393,8 @@ ld_diagram_save_to_file (LdDiagram *self,
|
||||||
GFileOutputStream *file_stream;
|
GFileOutputStream *file_stream;
|
||||||
JsonGenerator *generator;
|
JsonGenerator *generator;
|
||||||
JsonNode *root;
|
JsonNode *root;
|
||||||
|
gchar *buffer;
|
||||||
|
gsize length;
|
||||||
GError *local_error;
|
GError *local_error;
|
||||||
|
|
||||||
g_return_val_if_fail (LD_IS_DIAGRAM (self), FALSE);
|
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);
|
json_node_free (root);
|
||||||
|
|
||||||
local_error = NULL;
|
local_error = NULL;
|
||||||
json_generator_to_stream (generator, G_OUTPUT_STREAM (file_stream),
|
buffer = json_generator_to_data (generator, &length);
|
||||||
NULL, &local_error);
|
g_output_stream_write (G_OUTPUT_STREAM (file_stream),
|
||||||
|
buffer, length, NULL, &local_error);
|
||||||
g_object_unref (file_stream);
|
g_object_unref (file_stream);
|
||||||
g_object_unref (generator);
|
g_object_unref (generator);
|
||||||
|
g_free (buffer);
|
||||||
|
|
||||||
if (local_error)
|
if (local_error)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue