mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-06 00:30:08 +00:00
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:
parent
da91672d46
commit
8d286a7239
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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,21 +4714,16 @@ 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);
|
||||
|
||||
if (model == NULL)
|
||||
return;
|
||||
|
||||
combo_box->priv->model = model;
|
||||
g_object_ref (combo_box->priv->model);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user