builder-tool: Check canonical names

Always canonicalize names before comparing.
We were missing properties like left_attach,
since we were comparing them to left-attach.
This commit is contained in:
Matthias Clasen 2019-04-23 17:30:00 -04:00
parent 28be1c5d3a
commit 491829a2b5

View File

@ -189,7 +189,7 @@ needs_explicit_setting (GParamSpec *pspec,
static gboolean
keep_for_rewrite (const char *class_name,
const char *prop_name,
const char *property_name,
PropKind kind)
{
struct _Prop {
@ -213,12 +213,16 @@ keep_for_rewrite (const char *class_name,
};
gboolean found;
gint k;
char *canonical_name;
canonical_name = g_strdup (property_name);
g_strdelimit (canonical_name, "_", '-');
found = FALSE;
for (k = 0; k < G_N_ELEMENTS (props); k++)
{
if (strcmp (class_name, props[k].class) == 0 &&
strcmp (prop_name, props[k].property) == 0 &&
strcmp (canonical_name, props[k].property) == 0 &&
kind == props[k].kind)
{
found = TRUE;
@ -226,6 +230,8 @@ keep_for_rewrite (const char *class_name,
}
}
g_free (canonical_name);
return found;
}