summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-18 18:43:14 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-18 18:43:14 -0300
commit381b6683c22642886b58e382a002aba0c38e1c38 (patch)
tree646d25f4ccaaf9ffa27cd4649e3b90c81a0f3907
parent02da8e1c7a9ecfdedcb16ed20d2adac1d184792f (diff)
downloadglade-381b6683c22642886b58e382a002aba0c38e1c38.tar.gz
GladeProperty: Do not replace - with _
Remove old libglade underscore properties naming scheme. https://gitlab.gnome.org/GNOME/glade/-/issues/281
-rw-r--r--gladeui/glade-property.c10
-rw-r--r--gladeui/glade-signal.c2
2 files changed, 5 insertions, 7 deletions
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 46ff8684..fbdb684c 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -1200,7 +1200,7 @@ glade_property_write (GladeProperty *property,
GladeXmlNode *node)
{
GladeXmlNode *prop_node;
- gchar *name, *value;
+ gchar *value;
gboolean save_always;
gchar *binding_flags = NULL;
GFlagsClass *flags_class;
@@ -1226,10 +1226,6 @@ glade_property_write (GladeProperty *property,
if (!save_always && glade_property_original_default (property) && !property->priv->bind_source)
return;
- /* Escape our string and save with underscores */
- name = g_strdup (glade_property_def_id (property->priv->def));
- glade_util_replace (name, '-', '_');
-
/* convert the value of this property to a string */
if (!(value = glade_widget_adaptor_string_from_value
(glade_property_def_get_adaptor (property->priv->def), property->priv->def,
@@ -1244,7 +1240,8 @@ glade_property_write (GladeProperty *property,
glade_xml_node_append_child (node, prop_node);
/* Name and value */
- glade_xml_node_set_property_string (prop_node, GLADE_XML_TAG_NAME, name);
+ glade_xml_node_set_property_string (prop_node, GLADE_XML_TAG_NAME,
+ glade_property_def_id (property->priv->def));
glade_xml_set_content (prop_node, value);
/* i18n stuff */
@@ -1306,7 +1303,6 @@ glade_property_write (GladeProperty *property,
g_free (binding_flags);
}
}
- g_free (name);
g_free (value);
}
diff --git a/gladeui/glade-signal.c b/gladeui/glade-signal.c
index 44f8edab..028ed132 100644
--- a/gladeui/glade-signal.c
+++ b/gladeui/glade-signal.c
@@ -373,6 +373,8 @@ glade_signal_read (GladeXmlNode *node, GladeWidgetAdaptor *adaptor)
glade_xml_get_property_string_required (node, GLADE_XML_TAG_NAME,
NULL)))
return NULL;
+
+ /* Old files had properties/signals with underscore */
glade_util_replace (name, '_', '-');
/* Search for a detail, and strip it from the signal name */