Broken fixed:: arguments

The commit 2c95b378 prevents clutter_animation_setup_property from being
called with fixed:: property names. This patch adds a additional
parameter "is_fixed" to clutter_animation_setup_property instead of
searching for "fixed::" in property_name.

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Bastian Winkler 2009-06-03 14:36:18 +02:00 committed by Emmanuele Bassi
parent ca5473836b
commit 6f7afdf553

View File

@ -1414,19 +1414,12 @@ static void
clutter_animation_setup_property (ClutterAnimation *animation, clutter_animation_setup_property (ClutterAnimation *animation,
const gchar *property_name, const gchar *property_name,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec,
gboolean is_fixed)
{ {
ClutterAnimationPrivate *priv = animation->priv; ClutterAnimationPrivate *priv = animation->priv;
gboolean is_fixed = FALSE;
GValue real_value = { 0, }; GValue real_value = { 0, };
/* fixed properties will not be animated */
if (g_str_has_prefix (property_name, "fixed::"))
{
is_fixed = TRUE;
property_name += 7; /* strlen("fixed::") */
}
if (pspec->flags & G_PARAM_CONSTRUCT_ONLY) if (pspec->flags & G_PARAM_CONSTRUCT_ONLY)
{ {
g_warning ("Cannot bind property '%s': the property is " g_warning ("Cannot bind property '%s': the property is "
@ -1525,6 +1518,7 @@ clutter_animation_setupv (ClutterAnimation *animation,
ClutterAnimationPrivate *priv = animation->priv; ClutterAnimationPrivate *priv = animation->priv;
GObjectClass *klass; GObjectClass *klass;
gint i; gint i;
gboolean is_fixed = FALSE;
klass = G_OBJECT_GET_CLASS (priv->object); klass = G_OBJECT_GET_CLASS (priv->object);
@ -1534,7 +1528,10 @@ clutter_animation_setupv (ClutterAnimation *animation,
GParamSpec *pspec; GParamSpec *pspec;
if (g_str_has_prefix (property_name, "fixed::")) if (g_str_has_prefix (property_name, "fixed::"))
{
property_name += 7; /* strlen("fixed::") */ property_name += 7; /* strlen("fixed::") */
is_fixed = TRUE;
}
pspec = g_object_class_find_property (klass, property_name); pspec = g_object_class_find_property (klass, property_name);
if (!pspec) if (!pspec)
@ -1548,7 +1545,8 @@ clutter_animation_setupv (ClutterAnimation *animation,
clutter_animation_setup_property (animation, property_name, clutter_animation_setup_property (animation, property_name,
&values[i], &values[i],
pspec); pspec,
is_fixed);
} }
} }
@ -1569,6 +1567,7 @@ clutter_animation_setup_valist (ClutterAnimation *animation,
GParamSpec *pspec; GParamSpec *pspec;
GValue final = { 0, }; GValue final = { 0, };
gchar *error = NULL; gchar *error = NULL;
gboolean is_fixed = FALSE;
if (g_str_has_prefix (property_name, "signal::")) if (g_str_has_prefix (property_name, "signal::"))
{ {
@ -1581,7 +1580,10 @@ clutter_animation_setup_valist (ClutterAnimation *animation,
else else
{ {
if (g_str_has_prefix (property_name, "fixed::")) if (g_str_has_prefix (property_name, "fixed::"))
{
property_name += 7; /* strlen("fixed::") */ property_name += 7; /* strlen("fixed::") */
is_fixed = TRUE;
}
pspec = g_object_class_find_property (klass, property_name); pspec = g_object_class_find_property (klass, property_name);
if (!pspec) if (!pspec)
@ -1604,7 +1606,8 @@ clutter_animation_setup_valist (ClutterAnimation *animation,
clutter_animation_setup_property (animation, property_name, clutter_animation_setup_property (animation, property_name,
&final, &final,
pspec); pspec,
is_fixed);
} }
property_name = va_arg (var_args, gchar*); property_name = va_arg (var_args, gchar*);