]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Strip "Enum"-suffix only from enumeration
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 3 Mar 2020 13:28:12 +0000 (14:28 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 25 Mar 2020 11:28:50 +0000 (12:28 +0100)
This lead to superfluous symbol clashes when applied widely.
e.g. GLib.ParamSpecEnum which is subclass of GLib.ParamSpec

Introduced with 37201b0016a6f710dea6c9db08ff351641086686

vala/valagirparser.vala

index 88f874d8f4f3507d2ccdeba51e3fe3fda9875b31..07e70aa348c001864ed544510eeab311cda18b65 100644 (file)
@@ -1870,6 +1870,8 @@ public class Vala.GirParser : CodeVisitor {
        }
 
        string? element_get_name (string? gir_name = null) {
+               unowned string tag = reader.name;
+
                var name = gir_name;
                if (name == null) {
                        name = reader.get_attribute ("name");
@@ -1893,7 +1895,9 @@ public class Vala.GirParser : CodeVisitor {
                                        name = pattern;
                                }
                        }
-               } else {
+               } else if (tag == "enumeration") {
+                       // FIXME Stripping "Enum"-suffix is required for error-domains
+                       // Applied to all enumerations to preserve backwards compatibility
                        if (name != null && name.has_suffix ("Enum")) {
                                name = name.substring (0, name.length - "Enum".length);
                        }