[vala/0.10] GVariant: Fix serialization of empty hash tables



commit 091f441069e4b6e156ac992099051cee7aa9cb49
Author: Jürg Billeter <j bitron ch>
Date:   Wed Dec 29 19:36:05 2010 +0100

    GVariant: Fix serialization of empty hash tables

 codegen/valagvariantmodule.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/codegen/valagvariantmodule.vala b/codegen/valagvariantmodule.vala
index 64b653b..19c145a 100644
--- a/codegen/valagvariantmodule.vala
+++ b/codegen/valagvariantmodule.vala
@@ -722,9 +722,12 @@ public class Vala.GVariantModule : GAsyncModule {
 		iter_init_call.add_argument (hash_table_expr);
 		fragment.append (new CCodeExpressionStatement (iter_init_call));
 
+		var gvariant_type = new CCodeFunctionCall (new CCodeIdentifier ("G_VARIANT_TYPE"));
+		gvariant_type.add_argument (new CCodeConstant ("\"%s\"".printf (get_type_signature (type))));
+
 		var iter_call = new CCodeFunctionCall (new CCodeIdentifier ("g_variant_builder_init"));
 		iter_call.add_argument (new CCodeUnaryExpression (CCodeUnaryOperator.ADDRESS_OF, new CCodeIdentifier (subiter_name)));
-		iter_call.add_argument (new CCodeIdentifier ("G_VARIANT_TYPE_DICTIONARY"));
+		iter_call.add_argument (gvariant_type);
 		fragment.append (new CCodeExpressionStatement (iter_call));
 
 		var iter_next_call = new CCodeFunctionCall (new CCodeIdentifier ("g_hash_table_iter_next"));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]