[vala] girparser: Only process static methods of root namespace



commit e0ecf2993dc0a7d17c603404c43711aa85fcd323
Author: Luca Bruno <lucabru src gnome org>
Date:   Sun May 1 09:27:24 2011 +0200

    girparser: Only process static methods of root namespace

 vala/valagirparser.vala |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 0002ac2..effe735 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -747,7 +747,7 @@ public class Vala.GirParser : CodeVisitor {
 			var ns = symbol as Namespace;
 			if (!(new_symbol && merged) && is_container (symbol)) {
 				foreach (var node in members) {
-					if (node.new_symbol && !node.merged && !metadata.get_bool (ArgumentType.HIDDEN) && !(ns != null && node.symbol is Method)) {
+					if (node.new_symbol && !node.merged && !metadata.get_bool (ArgumentType.HIDDEN) && !(ns != null && parent == parser.root && node.symbol is Method)) {
 						add_symbol_to_container (symbol, node.symbol);
 					}
 				}
@@ -760,14 +760,12 @@ public class Vala.GirParser : CodeVisitor {
 					cm.has_construct_function = false;
 					cm.access = SymbolAccessibility.PROTECTED;
 					cl.add_method (cm);
-				} else if (symbol is Namespace) {
+				} else if (symbol is Namespace && parent == parser.root) {
 					// postprocess namespace methods
-					foreach (var nodes in scope.get_values ()) {
-						foreach (var node in nodes) {
-							var m = node.symbol as Method;
-							if (m != null) {
-								parser.process_namespace_method (ns, m);
-							}
+					foreach (var node in members) {
+						var m = node.symbol as Method;
+						if (m != null) {
+							parser.process_namespace_method (ns, m);
 						}
 					}
 				}



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