Accept NULL.

2006-12-27  Matthias Clasen  <mclasen@redhat.com>

        * gtk/gtkcellview.c (gtk_cell_view_set_model): Accept NULL.

        * gtk/gtkcombobox.c (gtk_combo_box_set_model):
        (gtk_combo_box_unset_model): Handle repeated unsetting
        of models without warnings.  (#367529, Robert Ancell)
This commit is contained in:
Matthias Clasen 2006-12-27 07:17:53 +00:00 committed by Matthias Clasen
parent da91672d46
commit 8d286a7239
3 changed files with 16 additions and 12 deletions

View File

@ -1,5 +1,14 @@
2006-12-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkcellview.c (gtk_cell_view_set_model): Accept NULL.
* gtk/gtkcombobox.c (gtk_combo_box_set_model):
(gtk_combo_box_unset_model): Handle repeated unsetting
of models without warnings. (#367529, Robert Ancell)
2006-12-27 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/cups/gtkcupsutils.c:
* modules/printbackends/cups/gtkprintbackendcups.c: Use
getters for http fields where available. (#364866,
Björn Lindqvist)

View File

@ -874,7 +874,7 @@ gtk_cell_view_set_model (GtkCellView *cell_view,
GtkTreeModel *model)
{
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
g_return_if_fail (GTK_IS_TREE_MODEL (model));
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
if (cell_view->priv->model)
{

View File

@ -2224,7 +2224,7 @@ gtk_combo_box_unset_model (GtkComboBox *combo_box)
}
if (combo_box->priv->cell_view)
gtk_cell_view_set_displayed_row (GTK_CELL_VIEW (combo_box->priv->cell_view), NULL);
gtk_cell_view_set_model (GTK_CELL_VIEW (combo_box->priv->cell_view), NULL);
}
static void
@ -4714,20 +4714,15 @@ gtk_combo_box_set_model (GtkComboBox *combo_box,
GtkTreeModel *model)
{
g_return_if_fail (GTK_IS_COMBO_BOX (combo_box));
if (!model)
{
gtk_combo_box_unset_model (combo_box);
return;
}
g_return_if_fail (GTK_IS_TREE_MODEL (model));
g_return_if_fail (model == NULL || GTK_IS_TREE_MODEL (model));
if (model == combo_box->priv->model)
return;
if (combo_box->priv->model)
gtk_combo_box_unset_model (combo_box);
gtk_combo_box_unset_model (combo_box);
if (model == NULL)
return;
combo_box->priv->model = model;
g_object_ref (combo_box->priv->model);