From 185ab819dea0a3e4bc57ac12bcd5f0e0a4e243ea Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Mon, 5 Sep 2011 16:08:26 +0200 Subject: [PATCH] gcr: Add gcr_collection_model_get_collection() * A way to get the collection that collection model is based on. --- docs/reference/gcr/gcr-sections.txt | 1 + gcr/gcr-collection-model.c | 15 +++++++++++++++ gcr/gcr-collection-model.h | 2 ++ 3 files changed, 18 insertions(+) diff --git a/docs/reference/gcr/gcr-sections.txt b/docs/reference/gcr/gcr-sections.txt index 46a6a92..ee7bd91 100644 --- a/docs/reference/gcr/gcr-sections.txt +++ b/docs/reference/gcr/gcr-sections.txt @@ -268,6 +268,7 @@ GcrCollectionModelClass gcr_collection_model_new gcr_collection_model_new_full gcr_collection_model_set_columns +gcr_collection_model_get_collection gcr_collection_model_iter_for_object gcr_collection_model_object_for_iter gcr_collection_model_is_selected diff --git a/gcr/gcr-collection-model.c b/gcr/gcr-collection-model.c index 16d15d0..54b5ee5 100644 --- a/gcr/gcr-collection-model.c +++ b/gcr/gcr-collection-model.c @@ -1326,6 +1326,21 @@ gcr_collection_model_set_columns (GcrCollectionModel *self, const GcrColumn *col } /** + * gcr_collection_model_get_collection: + * @self: a collection model + * + * Get the collection which this model represents + * + * Returns: (transfer none): the collection, owned by the model + */ +GcrCollection * +gcr_collection_model_get_collection (GcrCollectionModel *self) +{ + g_return_val_if_fail (GCR_IS_COLLECTION_MODEL (self), NULL); + return self->pv->collection; +} + +/** * gcr_collection_model_object_for_iter: * @self: The model * @iter: The row diff --git a/gcr/gcr-collection-model.h b/gcr/gcr-collection-model.h index c8a1775..9e3b726 100644 --- a/gcr/gcr-collection-model.h +++ b/gcr/gcr-collection-model.h @@ -60,6 +60,8 @@ GcrCollectionModel* gcr_collection_model_new_full (GcrCollection *c void gcr_collection_model_set_columns (GcrCollectionModel *self, const GcrColumn *columns); +GcrCollection * gcr_collection_model_get_collection (GcrCollectionModel *self); + GObject* gcr_collection_model_object_for_iter (GcrCollectionModel *self, const GtkTreeIter *iter); -- 2.7.4