summaryrefslogtreecommitdiff
path: root/gladeui/glade-property.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2013-03-31 23:18:53 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2013-04-01 18:18:24 +0900
commit222d4ac3dbd13fc65b2c6c69d8c2a4a9f35b4ce8 (patch)
treed2d2ea248ab53dd080505d7fa4fbdcf28a0b00dd /gladeui/glade-property.c
parent90f1ab492bfbd26a060bc2b40c6d8228ed1c2be4 (diff)
downloadglade-222d4ac3dbd13fc65b2c6c69d8c2a4a9f35b4ce8.tar.gz
GladeProperty: Otional properties that are enabled are always set now.
... Even if they are at the default value, this is more intuitive as we safely reload the check mark state, and allows explicit setting of properties like hexpand = FALSE or vexpand = FALSE.
Diffstat (limited to 'gladeui/glade-property.c')
-rw-r--r--gladeui/glade-property.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gladeui/glade-property.c b/gladeui/glade-property.c
index 08eb6deb..1e4265ce 100644
--- a/gladeui/glade-property.c
+++ b/gladeui/glade-property.c
@@ -1164,6 +1164,7 @@ glade_property_write (GladeProperty * property,
{
GladeXmlNode *prop_node;
gchar *name, *value;
+ gboolean save_always;
g_return_if_fail (GLADE_IS_PROPERTY (property));
g_return_if_fail (node != NULL);
@@ -1173,11 +1174,14 @@ glade_property_write (GladeProperty * property,
glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET)))
return;
+ /* There can be a couple of reasons to forcefully save a property */
+ save_always = (glade_property_class_save_always (property->priv->klass) || property->priv->save_always);
+ save_always = save_always || (glade_property_class_optional (property->priv->klass) && property->priv->enabled);
+
/* Skip properties that are default by original pspec default
* (excepting those that specified otherwise).
*/
- if (!(glade_property_class_save_always (property->priv->klass) || property->priv->save_always) &&
- glade_property_original_default (property))
+ if (!save_always && glade_property_original_default (property))
return;
/* Escape our string and save with underscores */