Add methods to get services from collections, items
authorStef Walter <stefw@gnome.org>
Mon, 25 Jun 2012 08:17:16 +0000 (10:17 +0200)
committerStef Walter <stefw@gnome.org>
Mon, 25 Jun 2012 08:17:29 +0000 (10:17 +0200)
 * Add secret_collection_get_service()
 * Add secret_item_get_service()

docs/reference/libsecret/libsecret-sections.txt
library/secret-collection.c
library/secret-collection.h
library/secret-item.c
library/secret-item.h

index 7f23f23..98de4c8 100644 (file)
@@ -13,6 +13,7 @@ secret_collection_delete
 secret_collection_delete_finish
 secret_collection_delete_sync
 secret_collection_get_created
+secret_collection_get_service
 secret_collection_get_items
 secret_collection_get_label
 secret_collection_set_label
@@ -57,6 +58,7 @@ secret_item_set_label_finish
 secret_item_set_label_sync
 secret_item_get_locked
 secret_item_get_modified
+secret_item_get_service
 secret_item_get_secret
 secret_item_get_secret_finish
 secret_item_get_secret_sync
index 52d153a..251ac0b 100644 (file)
@@ -1171,6 +1171,21 @@ secret_collection_delete_sync (SecretCollection *self,
 }
 
 /**
+ * secret_collection_get_service:
+ * @self: a collection
+ *
+ * Get the Secret Service object that this collection was created with.
+ *
+ * Returns: (transfer none): the Secret Service object
+ */
+SecretService *
+secret_collection_get_service (SecretCollection *self)
+{
+       g_return_val_if_fail (SECRET_IS_COLLECTION (self), NULL);
+       return self->pv->service;
+}
+
+/**
  * secret_collection_get_items:
  * @self: a collection
  *
index 9e916eb..9f9b617 100644 (file)
@@ -96,6 +96,8 @@ gboolean            secret_collection_delete_sync              (SecretCollection
                                                                 GCancellable *cancellable,
                                                                 GError **error);
 
+SecretService *     secret_collection_get_service              (SecretCollection *self);
+
 GList *             secret_collection_get_items                (SecretCollection *self);
 
 gchar *             secret_collection_get_label                (SecretCollection *self);
index fa433eb..d0fa861 100644 (file)
@@ -937,6 +937,22 @@ secret_item_delete_sync (SecretItem *self,
        return ret;
 }
 
+/**
+ * secret_item_get_service:
+ * @self: an item
+ *
+ * Get the Secret Service object that this item was created with.
+ *
+ * Returns: (transfer none): the Secret Service object
+ */
+SecretService *
+secret_item_get_service (SecretItem *self)
+{
+       g_return_val_if_fail (SECRET_IS_COLLECTION (self), NULL);
+       return self->pv->service;
+}
+
+
 typedef struct {
        GCancellable *cancellable;
        SecretValue *value;
index 12af0d7..90744cc 100644 (file)
@@ -102,6 +102,8 @@ gboolean            secret_item_delete_sync                (SecretItem *self,
                                                             GCancellable *cancellable,
                                                             GError **error);
 
+SecretService *     secret_item_get_service                (SecretItem *self);
+
 void                secret_item_get_secret                 (SecretItem *self,
                                                             GCancellable *cancellable,
                                                             GAsyncReadyCallback callback,