]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
GIR writer: Fix generation of implemented interfaces
authorJan Hudec <bulb@ucw.cz>
Mon, 31 Aug 2009 12:22:55 +0000 (14:22 +0200)
committerJürg Billeter <j@bitron.ch>
Mon, 14 Sep 2009 10:33:52 +0000 (12:33 +0200)
The list of implemented interfaces is expected as

    <implements name="Interface1" />
    <implements name="Interface2" />
    ...

by gobject-introspection library (as of 0.6.3), but was written as

    <implements>
        <implements name="Interface1" />
        <implements name="Interface2" />
        ...
    </implements>

by Vala.GIRWriter. Note, that vapigen expects the same format as
gobject-introspection, so it was not able to read vala-written .girs
before the change and is able to read them properly now.

Fixes bug 584576.

Signed-off-by: Jan Hudec <bulb@ucw.cz>
codegen/valagirwriter.vala

index 25ced90ed712a75474f9e9c030fbfd9473386bd7..029a949973458d37ca823da00441775082c2e2d6 100644 (file)
@@ -166,25 +166,13 @@ public class Vala.GIRWriter : CodeVisitor {
                        indent++;
 
                        // write implemented interfaces
-                       bool first = true;
                        foreach (DataType base_type in cl.get_base_types ()) {
                                var object_type = (ObjectType) base_type;
                                if (object_type.type_symbol is Interface) {
-                                       if (first) {
-                                               write_indent ();
-                                               stream.printf ("<implements>\n");
-                                               indent++;
-                                               first = false;
-                                       }
                                        write_indent ();
-                                       stream.printf ("<interface name=\"%s\"/>\n", gi_type_name (object_type.type_symbol));
+                                       stream.printf ("<implements name=\"%s\"/>\n", gi_type_name (object_type.type_symbol));
                                }
                        }
-                       if (!first) {
-                               indent--;
-                               write_indent ();
-                               stream.printf ("</implements>\n");
-                       }
 
                        write_annotations (cl);