Fixes bug 615633.
Signed-off-by: Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
}
}
+ public string? get_default_type_id () {
+ if (is_compact) {
+ return "G_TYPE_POINTER";
+ }
+
+ return get_upper_case_cname ("TYPE_");
+ }
+
public override string? get_type_id () {
if (type_id == null) {
- if (!is_compact) {
- type_id = get_upper_case_cname ("TYPE_");
- } else {
- type_id = "G_TYPE_POINTER";
- }
+ type_id = get_default_type_id ();
}
-
+
return type_id;
}
write_string ("type_check_function = \"%s\", ".printf (cl.type_check_function ));
}
- if (cl.is_compact && cl.get_type_id () != "G_TYPE_POINTER") {
+ if (cl.get_type_id () != cl.get_default_type_id ()) {
write_string ("type_id = \"%s\", ".printf (cl.get_type_id ()));
}
}
} else if (nv[0] == "type_check_function") {
cl.type_check_function = eval (nv[1]);
+ } else if (nv[0] == "type_id") {
+ cl.set_type_id (eval (nv[1]));
} else if (nv[0] == "abstract") {
if (eval (nv[1]) == "1") {
cl.is_abstract = true;