[vala] codewriter: Do not write GIR information for nested namespaces



commit 5e8cf82b3c23972c75677303ab3a2eb37731c906
Author: Abderrahim Kitouni <a kitouni gmail com>
Date:   Sat Nov 6 12:36:54 2010 +0100

    codewriter: Do not write GIR information for nested namespaces

 vala/valacodewriter.vala |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/vala/valacodewriter.vala b/vala/valacodewriter.vala
index 3cc8929..62f1d07 100644
--- a/vala/valacodewriter.vala
+++ b/vala/valacodewriter.vala
@@ -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));



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