[vala/switch-to-gir: 39/49] girparser: Merge virtual method specified in metadata.



commit 13d3bbbc2d7bbecea916c83a39205ebd2c8a14bb
Author: Luca Bruno <lucabru src gnome org>
Date:   Thu Dec 30 19:44:18 2010 +0100

    girparser: Merge virtual method specified in metadata.

 vala/valagirparser.vala |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 7dff6a4..5251f9e 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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> ();



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