[vala/switch-to-gir: 30/51] girparser: Fix assuming parameter names of signal from virtual method.
- From: Luca Bruno <lucabru src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/switch-to-gir: 30/51] girparser: Fix assuming parameter names of signal from virtual method.
- Date: Fri, 11 Mar 2011 10:40:35 +0000 (UTC)
commit 360397684f1982a67e6e7f07337c2336d4a5df40
Author: Luca Bruno <lucabru src gnome org>
Date: Sat Dec 25 13:05:30 2010 +0100
girparser: Fix assuming parameter names of signal from virtual method.
vala/valagirparser.vala | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 0b7f152..06731bf 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -791,18 +791,26 @@ public class Vala.GirParser : CodeVisitor {
}
}
- void assume_parameter_names (Signal sig, Symbol sym) {
+ void assume_parameter_names (Signal sig, Symbol sym, bool skip_first) {
Iterator<Parameter> iter;
if (sym is Method) {
iter = ((Method) sym).get_parameters ().iterator ();
} else {
iter = ((Delegate) sym).get_parameters ().iterator ();
}
+ bool first = true;
foreach (var param in sig.get_parameters ()) {
if (!iter.next ()) {
// unreachable for valid GIR
break;
}
+ if (skip_first && first) {
+ if (!iter.next ()) {
+ // unreachable for valid GIR
+ break;
+ }
+ first = false;
+ }
param.name = iter.get ().name;
}
}
@@ -905,7 +913,7 @@ public class Vala.GirParser : CodeVisitor {
} else {
sig.has_emitter = true;
}
- assume_parameter_names (sig, method);
+ assume_parameter_names (sig, method, false);
merged.add (cinfo);
} else if (sym is Field) {
merged.add (cinfo);
@@ -2861,7 +2869,7 @@ public class Vala.GirParser : CodeVisitor {
} else if (symbol is Signal) {
var sig = (Signal) symbol;
sig.is_virtual = true;
- assume_parameter_names (sig, d);
+ assume_parameter_names (sig, d, true);
} else if (symbol is Property) {
var prop = (Property) symbol;
prop.is_virtual = true;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]