mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 05:44:08 +00:00
model: Let get_n_columns() return a sane value
If you call get_n_columns() during the instance initialization phase but before set_name()/set_types() have been called, you'll get a (guint) -1. This is less than ideal. If columns haven't been initialized we should just return 0, which was the intent of the API since the beginning. Based on a patch by: Bastian Winkler <buz@netbuz.org> Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
parent
0a6497a3b6
commit
d735ac4807
@ -244,7 +244,12 @@ clutter_model_real_get_column_name (ClutterModel *model,
|
|||||||
static guint
|
static guint
|
||||||
clutter_model_real_get_n_columns (ClutterModel *model)
|
clutter_model_real_get_n_columns (ClutterModel *model)
|
||||||
{
|
{
|
||||||
return model->priv->n_columns;
|
ClutterModelPrivate *priv = model->priv;
|
||||||
|
|
||||||
|
if (priv->n_columns < 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return priv->n_columns;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user