[libgdata] contacts: Remove gdata_contacts_service_update_contact()



commit 9bcac38a8819608633c24045df4098bbd4e0ae4b
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Sep 7 09:30:08 2010 +0100

    contacts: Remove gdata_contacts_service_update_contact()
    
    It was an unnecessary wrapper around gdata_service_update_entry(), which
    should be used instead. This is an API break.

 docs/reference/gdata-sections.txt                |    1 -
 gdata/gdata.symbols                              |    1 -
 gdata/services/contacts/gdata-contacts-service.c |   40 ----------------------
 gdata/services/contacts/gdata-contacts-service.h |    2 -
 gdata/tests/contacts.c                           |    2 +-
 5 files changed, 1 insertions(+), 45 deletions(-)
---
diff --git a/docs/reference/gdata-sections.txt b/docs/reference/gdata-sections.txt
index 9e4503a..2198384 100644
--- a/docs/reference/gdata-sections.txt
+++ b/docs/reference/gdata-sections.txt
@@ -279,7 +279,6 @@ gdata_contacts_service_new
 gdata_contacts_service_query_contacts
 gdata_contacts_service_query_contacts_async
 gdata_contacts_service_insert_contact
-gdata_contacts_service_update_contact
 <SUBSECTION Standard>
 gdata_contacts_service_get_type
 GDATA_CONTACTS_SERVICE
diff --git a/gdata/gdata.symbols b/gdata/gdata.symbols
index 330b592..5eb1ee1 100644
--- a/gdata/gdata.symbols
+++ b/gdata/gdata.symbols
@@ -257,7 +257,6 @@ gdata_contacts_service_new
 gdata_contacts_service_query_contacts
 gdata_contacts_service_query_contacts_async
 gdata_contacts_service_insert_contact
-gdata_contacts_service_update_contact
 gdata_contacts_query_get_type
 gdata_contacts_query_new
 gdata_contacts_query_new_with_limits
diff --git a/gdata/services/contacts/gdata-contacts-service.c b/gdata/services/contacts/gdata-contacts-service.c
index b450eae..9ab85d9 100644
--- a/gdata/services/contacts/gdata-contacts-service.c
+++ b/gdata/services/contacts/gdata-contacts-service.c
@@ -202,43 +202,3 @@ gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContacts
 
 	return GDATA_CONTACTS_CONTACT (entry);
 }
-
-/**
- * gdata_contacts_service_update_contact:
- * @self: a #GDataContactsService
- * @contact: the #GDataContactsContact to update
- * @cancellable: optional #GCancellable object, or %NULL
- * @error: a #GError, or %NULL
- *
- * Updates @contact on the online contacts service.
- *
- * For more details, see gdata_service_update_entry().
- *
- * Return value: an updated #GDataContactsContact, or %NULL
- *
- * Since: 0.4.0
- **/
-GDataContactsContact *
-gdata_contacts_service_update_contact (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, GError **error)
-{
-	/* TODO: Async variant */
-	const gchar *uri;
-	GDataLink *_link;
-
-	g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL);
-	g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (contact), NULL);
-	g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL);
-	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
-	/* Can't trust the edit URI the contact gives us, as it has the wrong projection; it uses the base projection, which
-	 * doesn't allow for extended attributes to be set (for some weird reason). */
-	_link = gdata_entry_look_up_link (GDATA_ENTRY (contact), GDATA_LINK_EDIT);
-	g_assert (_link != NULL);
-	uri = gdata_link_get_uri (_link);
-	g_assert (uri != NULL);
-	uri = strstr (uri, "/base/");
-	if (uri != NULL)
-		memcpy ((char*) uri, "/full/", 6);
-
-	return GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (self), GDATA_ENTRY (contact), cancellable, error));
-}
diff --git a/gdata/services/contacts/gdata-contacts-service.h b/gdata/services/contacts/gdata-contacts-service.h
index 2dbfc00..3b58791 100644
--- a/gdata/services/contacts/gdata-contacts-service.h
+++ b/gdata/services/contacts/gdata-contacts-service.h
@@ -75,8 +75,6 @@ void gdata_contacts_service_query_contacts_async (GDataContactsService *self, GD
 
 GDataContactsContact *gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContactsContact *contact,
                                                              GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
-GDataContactsContact *gdata_contacts_service_update_contact (GDataContactsService *self, GDataContactsContact *contact,
-                                                             GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC;
 
 G_END_DECLS
 
diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c
index 5d93664..1635260 100644
--- a/gdata/tests/contacts.c
+++ b/gdata/tests/contacts.c
@@ -595,7 +595,7 @@ test_update_simple (gconstpointer service)
 	g_assert (gdata_contacts_contact_set_extended_property (contact, "contact-test", "value"));
 
 	/* Update the contact */
-	new_contact = gdata_contacts_service_update_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, &error);
+	new_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error));
 	g_assert_no_error (error);
 	g_assert (GDATA_IS_CONTACTS_CONTACT (new_contact));
 	check_kind (GDATA_ENTRY (new_contact));



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