Ticket #15039: patch-gladeui-upstream.diff

File patch-gladeui-upstream.diff, 2.5 KB (added by dbevans (David B. Evans), 16 years ago)

Upstream patch for gladeui

  • gladeui/glade-editor-property.c

    glade_editor_property_commit (GladeEdito 
    101101        /* If the value was denied by a verify function, we'll have to
    102102         * reload the real value.
    103103         */
    104         if (g_param_values_cmp (eprop->property->klass->pspec,
    105                                 eprop->property->value, value) != 0)
     104        if (glade_property_class_values_cmp (eprop->property->klass,
     105                                             eprop->property->value, value) != 0)
    106106                GLADE_EDITOR_PROPERTY_GET_CLASS (eprop)->load (eprop, eprop->property);
    107107}
    108108
  • gladeui/glade-property-class.c

    glade_property_class_void_value (GladePr 
    15781578
    15791579        return FALSE;
    15801580}
     1581
     1582/**
     1583 * glade_property_class_values_cmp:
     1584 * @klass: a #GladePropertyClass
     1585 * @value1: a GValue of correct type for @klass
     1586 * @value2: a GValue of correct type for @klass
     1587 *
     1588 * Compares value1 with value2 according to @klass.
     1589 *
     1590 * Returns: -1, 0 or +1, if value1 is found to be less than,
     1591 * equal to or greater than value2, respectively.
     1592 */
     1593gint
     1594glade_property_class_values_cmp (GladePropertyClass *klass,
     1595                                 GValue             *value1,
     1596                                 GValue             *value2)
     1597{
     1598        gint retval;
     1599       
     1600        /* GLib does not know how to compare a boxed real value */
     1601        if (G_PARAM_SPEC_BOXED (klass->pspec))
     1602        {
     1603                gchar *val1, *val2;
     1604               
     1605                val1 = glade_property_class_make_string_from_gvalue (klass, value1),
     1606                val2 = glade_property_class_make_string_from_gvalue (klass, value2);
     1607
     1608                retval = strcmp (val1, val2);
     1609               
     1610                g_free (val1);
     1611                g_free (val2);
     1612        }
     1613        else
     1614                retval = g_param_values_cmp (klass->pspec, value1, value2);
     1615       
     1616        return retval;
     1617}
  • gladeui/glade-property-class.h

    gboolean glade_property_class 
    214214gboolean            glade_property_class_void_value              (GladePropertyClass *klass,
    215215                                                                  GValue             *value);
    216216
     217gint                glade_property_class_values_cmp              (GladePropertyClass *klass,
     218                                                                  GValue             *value1,
     219                                                                  GValue             *value2);
    217220G_END_DECLS
    218221
    219222#endif /* __GLADE_PROPERTY_CLASS_H__ */