]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
codewriter: Do not write GIR information for nested namespaces
authorAbderrahim Kitouni <a.kitouni@gmail.com>
Sat, 6 Nov 2010 11:36:54 +0000 (12:36 +0100)
committerEvan Nemerson <evan@coeus-group.com>
Mon, 8 Nov 2010 09:43:20 +0000 (01:43 -0800)
vala/valacodewriter.vala

index 3cc8929ace801f6f619dcbc48b83039d5a01697b..62f1d0758e3df0470cb7eea6154d6a46f14a11a7 100644 (file)
@@ -141,7 +141,8 @@ public class Vala.CodeWriter : CodeVisitor {
                write_indent ();
                write_string ("[CCode (cprefix = \"%s\", lower_case_cprefix = \"%s\"".printf (ns.get_cprefix (), ns.get_lower_case_cprefix ()));
 
-               if (ns.source_reference != null) {
+               if (ns.source_reference != null && ns.parent_symbol == context.root) {
+                       // Set GIR information only for the main namespace of the file.
                        if (ns.source_reference.file.gir_namespace != null) {
                                write_string (", ");
                                write_string ("gir_namespace = \"%s\"".printf (ns.source_reference.file.gir_namespace));