]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Only process static methods of root namespace
authorLuca Bruno <lucabru@src.gnome.org>
Sun, 1 May 2011 07:27:24 +0000 (09:27 +0200)
committerLuca Bruno <lucabru@src.gnome.org>
Sun, 1 May 2011 07:38:07 +0000 (09:38 +0200)
vala/valagirparser.vala

index 0002ac217cb7a630b67a59e619dd901f81b0e5fb..effe73500a6c5232ada25102ec9fd2e490fb4ff8 100644 (file)
@@ -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);
                                                }
                                        }
                                }