]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Merge virtual method specified in metadata.
authorLuca Bruno <lucabru@src.gnome.org>
Thu, 30 Dec 2010 18:44:18 +0000 (19:44 +0100)
committerLuca Bruno <lucabru@src.gnome.org>
Mon, 4 Apr 2011 13:14:46 +0000 (15:14 +0200)
vala/valagirparser.vala

index 7dff6a404373725f922ad71333d27b27944937e2..5251f9e31bd412a2c26f6bd9673acc639bccf538 100644 (file)
@@ -958,8 +958,8 @@ public class Vala.GirParser : CodeVisitor {
                                                                m.attributes.remove (attr);
                                                                merged.add (invoker);
                                                                different_invoker = true;
-                                                               break;
                                                        }
+                                                       break;
                                                }
                                        }
                                        if (!different_invoker) {
@@ -967,6 +967,13 @@ public class Vala.GirParser : CodeVisitor {
                                        }
                                }
                        }
+                       // merge custom vfunc
+                       if (info.metadata.has_argument (ArgumentType.VFUNC_NAME)) {
+                               var vfunc = get_current_first_symbol_info (info.metadata.get_string (ArgumentType.VFUNC_NAME));
+                               if (vfunc != null && vfunc != info) {
+                                       merged.add (vfunc);
+                               }
+                       }
                        if (m.coroutine) {
                                // handle async methods
                                string finish_method_base;
@@ -2321,7 +2328,10 @@ public class Vala.GirParser : CodeVisitor {
                                method.is_abstract = metadata.get_bool (ArgumentType.ABSTRACT);
                                method.is_virtual = false;
                        }
-                       method.vfunc_name = metadata.get_string (ArgumentType.VFUNC_NAME);
+                       if (metadata.has_argument (ArgumentType.VFUNC_NAME)) {
+                               method.vfunc_name = metadata.get_string (ArgumentType.VFUNC_NAME);
+                               method.is_virtual = true;
+                       }
                }
 
                var parameters = new ArrayList<ParameterInfo> ();