]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Fix processing deprecation.
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 6 Jan 2011 11:22:04 +0000 (12:22 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 4 Apr 2011 13:14:47 +0000 (15:14 +0200)
vala/valagirparser.vala

index eaddd1d86e4e4a87bf60a674bfa8d8daedad3386..f84d6d7f44d01278a4bf634538b2da398302e6ee 100644 (file)
@@ -1063,10 +1063,13 @@ public class Vala.GirParser : CodeVisitor {
                }
        }
 
-       void postprocess_symbol (Symbol sym, Metadata metadata) {
+       void postprocess_symbol (Symbol sym, Metadata metadata, Map<string,string> girdata) {
                // deprecation
                sym.replacement = metadata.get_string (ArgumentType.REPLACEMENT);
-               sym.deprecated_since = element_get_string ("deprecated-version", ArgumentType.DEPRECATED_SINCE);
+               sym.deprecated_since = metadata.get_string (ArgumentType.DEPRECATED_SINCE);
+               if (sym.deprecated_since == null) {
+                       sym.deprecated_since = girdata.get ("deprecated-version");
+               }
                sym.deprecated = metadata.get_bool (ArgumentType.DEPRECATED) || sym.replacement != null || sym.deprecated_since != null;
 
                // cheader filename
@@ -1119,7 +1122,7 @@ public class Vala.GirParser : CodeVisitor {
                        if (!(current_symbol is Namespace && info.symbol is Method) && !info.metadata.has_argument (ArgumentType.PARENT)) {
                                add_symbol_to_container (container, info.symbol);
                        }
-                       postprocess_symbol (info.symbol, info.metadata);
+                       postprocess_symbol (info.symbol, info.metadata, info.girdata);
                }
        }