[vala/0.10] Genie: Fix lists and dicts with libgee 0.7



commit 9ccd479e9b3bd6a09371211ac59dd866bee69b93
Author: Alban Browaeys <prahal yahoo com>
Date:   Mon Nov 8 09:18:31 2010 +0100

    Genie: Fix lists and dicts with libgee 0.7
    
    The delegate type used for equal and hash functions changed in
    libgee 0.7. However, as libgee 0.5+ takes care of setting reasonable
    default functions, simply removing the corresponding code from the
    Genie parser fixes this incompatibility.

 vala/valagenieparser.vala |   30 +-----------------------------
 1 files changed, 1 insertions(+), 29 deletions(-)
---
diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala
index b132846..c77be79 100644
--- a/vala/valagenieparser.vala
+++ b/vala/valagenieparser.vala
@@ -1095,50 +1095,22 @@ public class Vala.Genie.Parser : CodeVisitor {
 		list_member.creation_member = true;
 		
 		var expr = new ObjectCreationExpression (list_member, get_src (begin));
-		var t = element_type.to_qualified_string ();
-		if (t == "string") {
-			parent_member = new MemberAccess (null, "GLib", get_src (begin));			
-			expr.add_argument (new MemberAccess (parent_member, "str_equal", get_src (begin)));
-			
-		} else if (t == "int") {
-			parent_member = new MemberAccess (null, "GLib", get_src (begin));
-			expr.add_argument (new MemberAccess (parent_member, "int_equal", get_src (begin)));
-		}
-
 		return expr;
 	}
 	
 	Expression parse_dict_creation_expression (SourceLocation begin, DataType key_type, DataType value_type) throws ParseError {
 	
-		MemberAccess dict_member = null, parent_member = null, dict_hash = null, dict_equal = null;
+		MemberAccess dict_member = null, parent_member = null;
 		
 		parent_member = new MemberAccess (null, "Gee", get_src (begin));
 		dict_member = new MemberAccess (parent_member, "HashMap", get_src (begin));
 		dict_member.add_type_argument (key_type);
 		dict_member.add_type_argument (value_type);
 	
-		var key_type_name = key_type.to_qualified_string ();
-		if (key_type_name == "string") {
-			parent_member = new MemberAccess (null, "GLib", get_src (begin));			
-			dict_hash = new MemberAccess (parent_member, "str_hash", get_src (begin));
-			dict_equal = new MemberAccess (parent_member, "str_equal", get_src (begin));
-			
-		} else if (key_type_name == "int") {
-			parent_member = new MemberAccess (null, "GLib", get_src (begin));
-			dict_hash = new MemberAccess (parent_member, "int_hash", get_src (begin));
-			dict_equal = new MemberAccess (parent_member, "int_equal", get_src (begin));
-		}
-
 		dict_member.creation_member = true;
 		
 		var expr = new ObjectCreationExpression (dict_member, get_src (begin));
 
-		if (dict_hash != null && dict_equal != null) {
-			expr.add_argument (dict_hash);
-			expr.add_argument (dict_equal);
-		}
-
-
 		return expr;
 	}
 	



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