]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vapigen: Automatically adjust method names when setting parent.
authorEvan Nemerson <evan@coeus-group.com>
Sat, 21 Aug 2010 20:28:29 +0000 (13:28 -0700)
committerEvan Nemerson <evan@coeus-group.com>
Sat, 21 Aug 2010 20:28:29 +0000 (13:28 -0700)
vapigen/valagidlparser.vala

index 1ba59d2f966e9c46365af0c5876179c9f308589b..99d2d84592861cafca204dc85b4d3fe73dd621bf 100644 (file)
@@ -1951,6 +1951,13 @@ public class Vala.GIdlParser : CodeVisitor {
                                                // force async function, even if it doesn't end in _async
                                                m.coroutine = true;
                                        }
+                               } else if (nv[0] == "parent") {
+                                       Symbol container = get_container_from_name (eval (nv[1]));
+                                       var prefix = container.get_lower_case_cprefix ();
+                                       if (symbol.has_prefix (prefix)) {
+                                               m.set_cname (m.name);
+                                               m.name = symbol.offset (prefix.length);
+                                       }
                                }
                        }
                }