gcr: Add gcr_collection_model_get_collection()
authorStef Walter <stefw@collabora.co.uk>
Mon, 5 Sep 2011 14:08:26 +0000 (16:08 +0200)
committerStef Walter <stefw@collabora.co.uk>
Mon, 5 Sep 2011 14:08:26 +0000 (16:08 +0200)
 * A way to get the collection that collection model is based on.

docs/reference/gcr/gcr-sections.txt
gcr/gcr-collection-model.c
gcr/gcr-collection-model.h

index 46a6a92..ee7bd91 100644 (file)
@@ -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
index 16d15d0..54b5ee5 100644 (file)
@@ -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
index c8a1775..9e3b726 100644 (file)
@@ -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);