]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Update to prefix handling used in GIR version 1.2
authorJürg Billeter <j@bitron.ch>
Mon, 13 Sep 2010 20:05:21 +0000 (22:05 +0200)
committerJürg Billeter <j@bitron.ch>
Wed, 15 Sep 2010 19:31:24 +0000 (21:31 +0200)
vala/valagirparser.vala

index f213b4da4763a3923ee556e189bfb2db77d90491..5bb2d73c213c8110ef8612eb3cf0c46a6fed13a2 100644 (file)
@@ -208,7 +208,7 @@ public class Vala.GirParser : CodeVisitor {
                        }
                }
 
-               string? cprefix = reader.get_attribute ("c:prefix");
+               string? cprefix = reader.get_attribute ("c:identifier-prefixes");
                if (cprefix != null) {
                        ns.add_cprefix (cprefix);
                        ns.set_lower_case_cprefix (Symbol.camel_case_to_lower_case (cprefix) + "_");
@@ -1044,6 +1044,7 @@ public class Vala.GirParser : CodeVisitor {
                start_element ("constructor");
                string name = reader.get_attribute ("name");
                string throws_string = reader.get_attribute ("throws");
+               string cname = reader.get_attribute ("c:identifier");
                next ();
 
                string? ctype;
@@ -1060,6 +1061,9 @@ public class Vala.GirParser : CodeVisitor {
                } else if (m.name.has_prefix ("new_")) {
                        m.name = m.name.offset ("new_".length);
                }
+               if (cname != null) {
+                       m.set_cname (cname);
+               }
                if (current_token == MarkupTokenType.START_ELEMENT && reader.name == "parameters") {
                        start_element ("parameters");
                        next ();