[gtk/simplify-fixes: 2/2] builder-tool: Check canonical names
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/simplify-fixes: 2/2] builder-tool: Check canonical names
- Date: Tue, 23 Apr 2019 21:31:58 +0000 (UTC)
commit 491829a2b5be429b46b960acb33285d0d7488ad7
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 23 17:30:00 2019 -0400
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.
gtk/tools/gtk-builder-tool-simplify.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/tools/gtk-builder-tool-simplify.c b/gtk/tools/gtk-builder-tool-simplify.c
index 9b7eeeba14..4ef7373bd3 100644
--- a/gtk/tools/gtk-builder-tool-simplify.c
+++ b/gtk/tools/gtk-builder-tool-simplify.c
@@ -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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]