summaryrefslogtreecommitdiff
path: root/gtk/gtkcolumnview.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-07-16 16:16:02 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-07-17 07:35:09 -0400
commita9c7f94e04207d95c0ff1f18f37477dab440d353 (patch)
tree69d151a4a9fd5f8592d245dcff4dc1f4bf20289c /gtk/gtkcolumnview.c
parent31bb969cce30f30121d5b03730417aa41ae2e4b9 (diff)
downloadgtk+-view-model-selection.tar.gz
Change list widget to use a GtkSelectionModelview-model-selection
Change the type of the model property in GtkListView, GtkColumnView and GtkGridView to be GtkSelectionModel. The convenience of automatic interposition of a selection model is minor, compared to the confusion. Update all callers.
Diffstat (limited to 'gtk/gtkcolumnview.c')
-rw-r--r--gtk/gtkcolumnview.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/gtk/gtkcolumnview.c b/gtk/gtkcolumnview.c
index acaa2b9b07..0328c136bd 100644
--- a/gtk/gtkcolumnview.c
+++ b/gtk/gtkcolumnview.c
@@ -628,7 +628,7 @@ gtk_column_view_class_init (GtkColumnViewClass *klass)
g_param_spec_object ("model",
P_("Model"),
P_("Model for the items displayed"),
- G_TYPE_LIST_MODEL,
+ GTK_TYPE_SELECTION_MODEL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
@@ -1202,7 +1202,7 @@ gtk_column_view_new (void)
*
* Returns: (nullable) (transfer none): The model in use
**/
-GListModel *
+GtkSelectionModel *
gtk_column_view_get_model (GtkColumnView *self)
{
g_return_val_if_fail (GTK_IS_COLUMN_VIEW (self), NULL);
@@ -1215,17 +1215,14 @@ gtk_column_view_get_model (GtkColumnView *self)
* @self: a #GtkColumnView
* @model: (allow-none) (transfer none): the model to use or %NULL for none
*
- * Sets the #GListModel to use.
- *
- * If the @model is a #GtkSelectionModel, it is used for managing the selection.
- * Otherwise, @self creates a #GtkSingleSelection for the selection.
+ * Sets the #GtkSelectionModel to use.
**/
void
-gtk_column_view_set_model (GtkColumnView *self,
- GListModel *model)
+gtk_column_view_set_model (GtkColumnView *self,
+ GtkSelectionModel *model)
{
g_return_if_fail (GTK_IS_COLUMN_VIEW (self));
- g_return_if_fail (model == NULL || G_IS_LIST_MODEL (model));
+ g_return_if_fail (model == NULL || GTK_IS_SELECTION_MODEL (model));
if (gtk_list_view_get_model (self->listview) == model)
return;