[Vala] [PATCH] Fix generation of implemented interfaces in .gir.



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 584576.

Signed-off-by: Jan Hudec <bulb ucw cz>
---
 codegen/valagirwriter.vala |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala
index 98b2af2..f9f6d21 100644
--- a/codegen/valagirwriter.vala
+++ b/codegen/valagirwriter.vala
@@ -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);
 
-- 
1.6.3.3



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