[ostree] Revert "libotutil: Make use of GBytes in ot_variant_read()"
- From: Colin Walters <walters src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [ostree] Revert "libotutil: Make use of GBytes in ot_variant_read()"
 
- Date: Sun, 18 Aug 2013 11:53:04 +0000 (UTC)
 
commit 326be41d1291f30f8acd949a774b600ebcb3e3cf
Author: Colin Walters <walters verbum org>
Date:   Sun Aug 18 07:51:25 2013 -0400
    Revert "libotutil: Make use of GBytes in ot_variant_read()"
    
    This reverts commit c77908bf514d61e75798932f61b5b414d9e36a3c; we can't
    do this since g_variant_get_data_as_bytes() is a GLib 2.36 API.
 src/libotutil/ot-variant-utils.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/libotutil/ot-variant-utils.c b/src/libotutil/ot-variant-utils.c
index 7b034a4..417975f 100644
--- a/src/libotutil/ot-variant-utils.c
+++ b/src/libotutil/ot-variant-utils.c
@@ -190,12 +190,12 @@ GInputStream *
 ot_variant_read (GVariant             *variant)
 {
   GMemoryInputStream *ret = NULL;
-  gs_unref_bytes GBytes *bytes = NULL;
-
-  bytes = g_variant_get_data_as_bytes (variant);
-  ret = (GMemoryInputStream*)g_memory_input_stream_new ();
-  g_memory_input_stream_add_bytes (ret, bytes);
 
+  ret = (GMemoryInputStream*)g_memory_input_stream_new_from_data (g_variant_get_data (variant),
+                                                                  g_variant_get_size (variant),
+                                                                  NULL);
+  g_object_set_data_full ((GObject*)ret, "ot-variant-data",
+                          g_variant_ref (variant), (GDestroyNotify) g_variant_unref);
   return (GInputStream*)ret;
 }
 
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]