[libgdata] core: Fix the GDataAccessRule example



commit 10802aec3d4207e6c5520ec677649b9d57ee2838
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Jun 4 15:03:39 2015 +0200

    core: Fix the GDataAccessRule example
    
    We need to pass the a GDataAuthorizationDomain to
    gdata_service_insert_entry, and we should not unref the GDataLink
    returned by gdata_entry_look_up_link.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750395

 gdata/gdata-access-rule.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gdata/gdata-access-rule.c b/gdata/gdata-access-rule.c
index 01d550a..25b5f23 100644
--- a/gdata/gdata-access-rule.c
+++ b/gdata/gdata-access-rule.c
@@ -34,12 +34,15 @@
  * <example>
  *     <title>Adding a Rule to the Access Control List for an Entry</title>
  *     <programlisting>
+ *     GDataAuthorizationDomain *domain;
  *     GDataService *service;
  *     GDataEntry *entry;
  *     GDataFeed *acl_feed;
  *     GDataAccessRule *rule, *new_rule;
  *     GError *error = NULL;
  *
+ *     domain = gdata_documents_service_get_primary_authorization_domain ();
+ *
  *     /<!-- -->* Retrieve a GDataEntry which will have a new rule inserted into its ACL. *<!-- -->/
  *     service = build_my_service ();
  *     entry = get_the_entry (service);
@@ -53,9 +56,8 @@
  *     gdata_access_rule_set_scope (rule, GDATA_ACCESS_SCOPE_USER, "example gmail com"); /<!-- -->* e-mail 
address of the user the ACL applies to *<!-- -->/
  *
  *     acl_link = gdata_entry_look_up_link (entry, GDATA_LINK_ACCESS_CONTROL_LIST);
- *     new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), gdata_link_get_uri 
(acl_link), GDATA_ENTRY (rule),
- *                                                               NULL, &error));
- *     g_object_unref (acl_link);
+ *     new_rule = GDATA_ACCESS_RULE (gdata_service_insert_entry (GDATA_SERVICE (service), domain, 
gdata_link_get_uri (acl_link),
+ *                                                               GDATA_ENTRY (rule), NULL, &error));
  *
  *     g_object_unref (rule);
  *     g_object_unref (entry);


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