[gnome-keyring: 4/12] gcr: Add gcr_collection_model_get_collection()



commit 34e1858639eaaffbae0aaf407c2299e4f0ac0b8e
Author: Stef Walter <stefw collabora co uk>
Date:   Mon Sep 5 16:08:26 2011 +0200

    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(+), 0 deletions(-)
---
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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]