[libgdata/wip/rishi/drive: 2/4] core: Expose _gdata_access_rule_set_key() internally



commit 2883bc51f7b818f128e4915fa8219d9583e375a2
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Jun 10 14:15:58 2015 +0200

    core: Expose _gdata_access_rule_set_key() internally
    
    This will be used by GDataDocumentsAccessRule when parsing the JSON.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684920

 gdata/gdata-access-rule.c |   14 ++++++++++++++
 gdata/gdata-private.h     |    3 +++
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/gdata/gdata-access-rule.c b/gdata/gdata-access-rule.c
index 2fc16fc..53b215b 100644
--- a/gdata/gdata-access-rule.c
+++ b/gdata/gdata-access-rule.c
@@ -675,6 +675,20 @@ gdata_access_rule_get_edited (GDataAccessRule *self)
        return self->priv->edited;
 }
 
+void
+_gdata_access_rule_set_key (GDataAccessRule *self, const gchar *key)
+{
+       g_return_if_fail (GDATA_IS_ACCESS_RULE (self));
+
+       if (g_strcmp0 (key, self->priv->key) == 0)
+               return;
+
+       g_free (self->priv->key);
+       self->priv->key = g_strdup (key);
+
+       g_object_notify (G_OBJECT (self), "key");
+}
+
 /**
  * gdata_access_rule_get_key:
  * @self: a #GDataAccessRule
diff --git a/gdata/gdata-private.h b/gdata/gdata-private.h
index 483c1a4..c3f6138 100644
--- a/gdata/gdata-private.h
+++ b/gdata/gdata-private.h
@@ -120,6 +120,9 @@ G_GNUC_INTERNAL void _gdata_entry_set_published (GDataEntry *self, gint64 publis
 G_GNUC_INTERNAL void _gdata_entry_set_id (GDataEntry *self, const gchar *id);
 G_GNUC_INTERNAL void _gdata_entry_set_batch_data (GDataEntry *self, guint id, GDataBatchOperationType type);
 
+#include "gdata-access-rule.h"
+G_GNUC_INTERNAL void _gdata_access_rule_set_key (GDataAccessRule *self, const gchar *key);
+
 #include "gdata-parser.h"
 
 /**


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