[evolution-kolab/account-mgmt: 8/12] kolab_util_contact_store(): Replace uri argument with EBookBackendSync.



commit 14aa9a3cc181a71d8656b6b9cd59faa2a98d5047
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Jun 28 23:28:48 2012 -0400

    kolab_util_contact_store(): Replace uri argument with EBookBackendSync.
    
    The "backend" parameter really only has to be an EBackend.  I made it
    EBookBackendSync just for calling convenience from EBookBackendKolab.
    
    The function calls kolab_util_backend_get_foldername() to obtain the
    Kolab IMAP foldername for the backend, instead of parsing URIs.

 src/addressbook/e-book-backend-kolab.c |    4 ++--
 src/addressbook/kolab-util-contact.c   |   10 +++++-----
 src/addressbook/kolab-util-contact.h   |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/addressbook/e-book-backend-kolab.c b/src/addressbook/e-book-backend-kolab.c
index 8c826ae..21044d3 100644
--- a/src/addressbook/e-book-backend-kolab.c
+++ b/src/addressbook/e-book-backend-kolab.c
@@ -586,8 +586,8 @@ e_book_backend_kolab_create_contacts (EBookBackendSync *backend,
 			goto exit;
 
 		ok = kolab_util_contact_store (econtact,
+		                               backend,
 		                               priv->book_koma,
-		                               priv->book_uri,
 		                               cancellable,
 		                               &tmp_err);
 		if (! ok)
@@ -698,8 +698,8 @@ e_book_backend_kolab_modify_contacts (EBookBackendSync *backend,
 		}
 
 		ok = kolab_util_contact_store (econtact,
+		                               backend,
 		                               priv->book_koma,
-		                               priv->book_uri,
 		                               cancellable,
 		                               &tmp_err);
 		if (! ok)
diff --git a/src/addressbook/kolab-util-contact.c b/src/addressbook/kolab-util-contact.c
index 9b2bee7..184d6c3 100644
--- a/src/addressbook/kolab-util-contact.c
+++ b/src/addressbook/kolab-util-contact.c
@@ -128,30 +128,30 @@ kolab_util_contact_gen_uid_if_none (EContact **contact)
 
 gboolean
 kolab_util_contact_store (EContact *econtact,
+                          EBookBackendSync *backend,
                           KolabMailAccess *koma,
-                          const gchar *uri,
                           GCancellable *cancellable,
                           GError **error)
 {
-	const gchar *sourcename = NULL;
+	const gchar *foldername = NULL;
 	KolabMailHandle *kmh = NULL;
 	GError *tmp_error = NULL;
 	gboolean ok = FALSE;
 
 	g_assert (E_IS_CONTACT (econtact));
+	g_assert (E_IS_BOOK_BACKEND (backend));
 	g_assert (KOLAB_IS_MAIL_ACCESS (koma));
-	g_assert (uri != NULL);
 	/* cancellable may be NULL */
 	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-	sourcename = kolab_util_backend_get_relative_path_from_uri (uri);
+	foldername = kolab_util_backend_get_foldername (E_BACKEND (backend));
 
 	kolab_util_backend_modtime_set_on_econtact (econtact);
 	kmh = kolab_mail_handle_new_from_econtact (econtact);
 
 	ok =  kolab_mail_access_store_handle (koma,
 	                                      kmh,
-	                                      sourcename,
+	                                      foldername,
 	                                      cancellable,
 	                                      &tmp_error);
 	if (! ok) {
diff --git a/src/addressbook/kolab-util-contact.h b/src/addressbook/kolab-util-contact.h
index cc3c8ce..9cb2e53 100644
--- a/src/addressbook/kolab-util-contact.h
+++ b/src/addressbook/kolab-util-contact.h
@@ -53,8 +53,8 @@ kolab_util_contact_gen_uid_if_none (EContact **contact);
 
 gboolean
 kolab_util_contact_store (EContact *econtact,
+                          EBookBackendSync *backend,
                           KolabMailAccess *koma,
-                          const gchar *uri,
                           GCancellable *cancellable,
                           GError **error);
 



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