[evolution-data-server] EGdbusBook: Remove the remove() method.



commit 83b89a578804cf6d33d87d506beb48782ce8a414
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Oct 6 23:12:12 2012 -0400

    EGdbusBook: Remove the remove() method.
    
    Not used anymore.  Remove the ESource instead.
    
    This also takes out the following backend functions:
    
        e_book_backend_remove()
        e_book_backend_sync_remove()
        e_data_book_respond_remove()

 addressbook/libedata-book/e-book-backend-sync.c    |   37 -----------------
 addressbook/libedata-book/e-book-backend-sync.h    |    8 ----
 addressbook/libedata-book/e-book-backend.c         |   27 ------------
 addressbook/libedata-book/e-book-backend.h         |    8 ----
 addressbook/libedata-book/e-data-book.c            |   41 -------------------
 addressbook/libedata-book/e-data-book.h            |    3 -
 addressbook/libegdbus/e-gdbus-book.c               |   43 --------------------
 addressbook/libegdbus/e-gdbus-book.h               |    9 ----
 .../libedata-book/libedata-book-sections.txt       |    3 -
 9 files changed, 0 insertions(+), 179 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend-sync.c b/addressbook/libedata-book/e-book-backend-sync.c
index f786d58..f9730e6 100644
--- a/addressbook/libedata-book/e-book-backend-sync.c
+++ b/addressbook/libedata-book/e-book-backend-sync.c
@@ -87,29 +87,6 @@ e_book_backend_sync_create_contacts (EBookBackendSync *backend,
 }
 
 /**
- * e_book_backend_sync_remove:
- * @backend: an #EBookBackendSync
- * @book: an #EDataBook
- * @cancellable: a #GCancellable for the operation
- * @error: #GError to set, when something fails
- *
- * Remove @book's database and storage overhead from the storage
- * medium. This will delete all contacts in @book.
- **/
-void
-e_book_backend_sync_remove (EBookBackendSync *backend,
-                            EDataBook *book,
-                            GCancellable *cancellable,
-                            GError **error)
-{
-	e_return_data_book_error_if_fail (E_IS_BOOK_BACKEND_SYNC (backend), E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (E_IS_DATA_BOOK (book), E_DATA_BOOK_STATUS_INVALID_ARG);
-	e_return_data_book_error_if_fail (E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->remove_sync, E_DATA_BOOK_STATUS_NOT_SUPPORTED);
-
-	(* E_BOOK_BACKEND_SYNC_GET_CLASS (backend)->remove_sync) (backend, book, cancellable, error);
-}
-
-/**
  * e_book_backend_sync_refresh:
  * @backend: An EBookBackendSync object.
  * @book: An EDataBook object.
@@ -400,19 +377,6 @@ book_backend_open (EBookBackend *backend,
 }
 
 static void
-book_backend_remove (EBookBackend *backend,
-                     EDataBook *book,
-                     guint32 opid,
-                     GCancellable *cancellable)
-{
-	GError *error = NULL;
-
-	e_book_backend_sync_remove (E_BOOK_BACKEND_SYNC (backend), book, cancellable, &error);
-
-	e_data_book_respond_remove (book, opid, error);
-}
-
-static void
 book_backend_refresh (EBookBackend *backend,
                       EDataBook *book,
                       guint32 opid,
@@ -601,7 +565,6 @@ e_book_backend_sync_class_init (EBookBackendSyncClass *class)
 	EBookBackendClass *backend_class = E_BOOK_BACKEND_CLASS (class);
 
 	backend_class->open			= book_backend_open;
-	backend_class->remove			= book_backend_remove;
 	backend_class->refresh			= book_backend_refresh;
 	backend_class->get_backend_property	= book_backend_get_backend_property;
 	backend_class->set_backend_property	= book_backend_set_backend_property;
diff --git a/addressbook/libedata-book/e-book-backend-sync.h b/addressbook/libedata-book/e-book-backend-sync.h
index 3fe1112..9d55333 100644
--- a/addressbook/libedata-book/e-book-backend-sync.h
+++ b/addressbook/libedata-book/e-book-backend-sync.h
@@ -50,10 +50,6 @@ struct _EBookBackendSyncClass {
 						 GCancellable *cancellable,
 						 gboolean only_if_exists,
 						 GError **error);
-	void		(*remove_sync)		(EBookBackendSync *backend,
-						 EDataBook *book,
-						 GCancellable *cancellable,
-						 GError **error);
 	void		(*refresh_sync)		(EBookBackendSync *backend,
 						 EDataBook *book,
 						 GCancellable *cancellable,
@@ -121,10 +117,6 @@ void		e_book_backend_sync_open	(EBookBackendSync *backend,
 						 GCancellable *cancellable,
 						 gboolean only_if_exists,
 						 GError **error);
-void		e_book_backend_sync_remove	(EBookBackendSync *backend,
-						 EDataBook *book,
-						 GCancellable *cancellable,
-						 GError **error);
 void		e_book_backend_sync_refresh	(EBookBackendSync *backend,
 						 EDataBook *book,
 						 GCancellable *cancellable,
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index dd91ba3..4a651ba 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -452,33 +452,6 @@ e_book_backend_open (EBookBackend *backend,
 }
 
 /**
- * e_book_backend_remove:
- * @backend: an #EBookBackend
- * @book: an #EDataBook
- * @cancellable: a #GCancellable for the operation
- * @opid: the ID to use for this operation
- *
- * Executes a 'remove' request to remove all of @backend's data,
- * specified by @opid on @book.
- * This might be finished with e_data_book_respond_remove().
- **/
-void
-e_book_backend_remove (EBookBackend *backend,
-                       EDataBook *book,
-                       guint32 opid,
-                       GCancellable *cancellable)
-{
-	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
-	g_return_if_fail (E_IS_DATA_BOOK (book));
-	g_return_if_fail (E_BOOK_BACKEND_GET_CLASS (backend)->remove);
-
-	if (e_book_backend_is_opening (backend))
-		e_data_book_respond_remove (book, opid, EDB_OPENING_ERROR);
-	else
-		(* E_BOOK_BACKEND_GET_CLASS (backend)->remove) (backend, book, opid, cancellable);
-}
-
-/**
  * e_book_backend_refresh:
  * @backend: an #EBookBackend
  * @book: an #EDataBook
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index 3bbeda1..e72dc0d 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -175,10 +175,6 @@ struct _EBookBackendClass {
 						 guint32 opid,
 						 GCancellable *cancellable,
 						 gboolean only_if_exists);
-	void		(*remove)		(EBookBackend *backend,
-						 EDataBook *book,
-						 guint32 opid,
-						 GCancellable *cancellable);
 
 	void		(*refresh)		(EBookBackend *backend,
 						 EDataBook *book,
@@ -265,10 +261,6 @@ void		e_book_backend_open		(EBookBackend *backend,
 						 guint32 opid,
 						 GCancellable *cancellable,
 						 gboolean only_if_exists);
-void		e_book_backend_remove		(EBookBackend *backend,
-						 EDataBook *book,
-						 guint32 opid,
-						 GCancellable *cancellable);
 void		e_book_backend_refresh		(EBookBackend *backend,
 						 EDataBook *book,
 						 guint32 opid,
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 95a5a6e..29cd004 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -58,7 +58,6 @@ static EOperationPool *ops_pool = NULL;
 
 typedef enum {
 	OP_OPEN,
-	OP_REMOVE,
 	OP_REFRESH,
 	OP_GET_CONTACT,
 	OP_GET_CONTACTS,
@@ -104,7 +103,6 @@ typedef struct {
 			gchar *prop_value;
 		} sbp;
 
-		/* OP_REMOVE */
 		/* OP_REFRESH */
 		/* OP_CANCEL_ALL */
 		/* OP_CLOSE */
@@ -172,9 +170,6 @@ operation_thread (gpointer data,
 		e_book_backend_remove_contacts (backend, op->book, op->id, op->cancellable, op->d.ids);
 		e_util_free_string_slist (op->d.ids);
 		break;
-	case OP_REMOVE:
-		e_book_backend_remove (backend, op->book, op->id, op->cancellable);
-		break;
 	case OP_REFRESH:
 		e_book_backend_refresh (backend, op->book, op->id, op->cancellable);
 		break;
@@ -497,21 +492,6 @@ impl_Book_open (EGdbusBook *object,
 }
 
 static gboolean
-impl_Book_remove (EGdbusBook *object,
-                  GDBusMethodInvocation *invocation,
-                  EDataBook *book)
-{
-	OperationData *op;
-
-	op = op_new (OP_REMOVE, book);
-
-	e_gdbus_book_complete_remove (book->priv->gdbus_object, invocation, op->id);
-	e_operation_pool_push (ops_pool, op);
-
-	return TRUE;
-}
-
-static gboolean
 impl_Book_refresh (EGdbusBook *object,
                    GDBusMethodInvocation *invocation,
                    EDataBook *book)
@@ -801,24 +781,6 @@ e_data_book_respond_open (EDataBook *book,
 		g_error_free (error);
 }
 
-void
-e_data_book_respond_remove (EDataBook *book,
-                            guint opid,
-                            GError *error)
-{
-	op_complete (book, opid);
-
-	/* Translators: This is prefix to a detailed error message */
-	g_prefix_error (&error, "%s", _("Cannot remove book: "));
-
-	e_gdbus_book_emit_remove_done (book->priv->gdbus_object, opid, error);
-
-	if (error)
-		g_error_free (error);
-	else
-		e_book_backend_set_is_removed (book->priv->backend, TRUE);
-}
-
 /**
  * e_data_book_respond_refresh:
  * @book: An addressbook client interface.
@@ -1332,9 +1294,6 @@ e_data_book_init (EDataBook *ebook)
 		gdbus_object, "handle-open",
 		G_CALLBACK (impl_Book_open), ebook);
 	g_signal_connect (
-		gdbus_object, "handle-remove",
-		G_CALLBACK (impl_Book_remove), ebook);
-	g_signal_connect (
 		gdbus_object, "handle-refresh",
 		G_CALLBACK (impl_Book_refresh), ebook);
 	g_signal_connect (
diff --git a/addressbook/libedata-book/e-data-book.h b/addressbook/libedata-book/e-data-book.h
index 3fce4c0..e434cdf 100644
--- a/addressbook/libedata-book/e-data-book.h
+++ b/addressbook/libedata-book/e-data-book.h
@@ -155,9 +155,6 @@ guint		e_data_book_register_gdbus_object
 void		e_data_book_respond_open	(EDataBook *book,
 						 guint32 opid,
 						 GError *error);
-void		e_data_book_respond_remove	(EDataBook *book,
-						 guint32 opid,
-						 GError *error);
 void		e_data_book_respond_refresh	(EDataBook *book,
 						 guint32 opid,
 						 GError *error);
diff --git a/addressbook/libegdbus/e-gdbus-book.c b/addressbook/libegdbus/e-gdbus-book.c
index 0018ec8..86779c5 100644
--- a/addressbook/libegdbus/e-gdbus-book.c
+++ b/addressbook/libegdbus/e-gdbus-book.c
@@ -43,7 +43,6 @@ enum
 	__BACKEND_PROPERTY_CHANGED_SIGNAL,
 	__OPEN_METHOD,
 	__OPEN_DONE_SIGNAL,
-	__REMOVE_METHOD,
 	__REMOVE_DONE_SIGNAL,
 	__REFRESH_METHOD,
 	__REFRESH_DONE_SIGNAL,
@@ -127,8 +126,6 @@ E_DECLARE_GDBUS_SIGNAL_EMISSION_HOOK_STRV (GDBUS_BOOK_INTERFACE_NAME,
 E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_VOID (GDBUS_BOOK_INTERFACE_NAME,
                                                       open)
 E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_VOID (GDBUS_BOOK_INTERFACE_NAME,
-                                                      remove)
-E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_VOID (GDBUS_BOOK_INTERFACE_NAME,
                                                       refresh)
 E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_STRING (GDBUS_BOOK_INTERFACE_NAME,
                                                         get_contact)
@@ -194,12 +191,6 @@ e_gdbus_book_default_init (EGdbusBookIface *iface)
 		__OPEN_DONE_SIGNAL)
 	E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
 		EGdbusBookIface,
-		"remove",
-		remove,
-		__REMOVE_METHOD,
-		__REMOVE_DONE_SIGNAL)
-	E_INIT_GDBUS_METHOD_ASYNC_VOID__VOID (
-		EGdbusBookIface,
 		"refresh",
 		refresh,
 		__REFRESH_METHOD,
@@ -305,33 +296,6 @@ e_gdbus_book_call_open_sync (GDBusProxy *proxy,
 }
 
 void
-e_gdbus_book_call_remove (GDBusProxy *proxy,
-                          GCancellable *cancellable,
-                          GAsyncReadyCallback callback,
-                          gpointer user_data)
-{
-	e_gdbus_proxy_call_void ("remove", e_gdbus_book_call_remove, E_GDBUS_ASYNC_OP_KEEPER (proxy), cancellable, callback, user_data);
-}
-
-gboolean
-e_gdbus_book_call_remove_finish (GDBusProxy *proxy,
-                                 GAsyncResult *result,
-                                 GError **error)
-{
-	return e_gdbus_proxy_finish_call_void (E_GDBUS_ASYNC_OP_KEEPER (proxy), result, error, e_gdbus_book_call_remove);
-}
-
-gboolean
-e_gdbus_book_call_remove_sync (GDBusProxy *proxy,
-                               GCancellable *cancellable,
-                               GError **error)
-{
-	return e_gdbus_proxy_call_sync_void__void (proxy, cancellable, error,
-		e_gdbus_book_call_remove,
-		e_gdbus_book_call_remove_finish);
-}
-
-void
 e_gdbus_book_call_refresh (GDBusProxy *proxy,
                            GCancellable *cancellable,
                            GAsyncReadyCallback callback,
@@ -741,8 +705,6 @@ e_gdbus_book_emit_ ## _mname ## _done (EGdbusBook *object, guint arg_opid, const
 
 DECLARE_EMIT_DONE_SIGNAL_0 (open,
                             __OPEN_DONE_SIGNAL)
-DECLARE_EMIT_DONE_SIGNAL_0 (remove,
-                            __REMOVE_DONE_SIGNAL)
 DECLARE_EMIT_DONE_SIGNAL_0 (refresh,
                             __REFRESH_DONE_SIGNAL)
 DECLARE_EMIT_DONE_SIGNAL_1 (get_contact,
@@ -834,8 +796,6 @@ E_DECLARE_GDBUS_ASYNC_METHOD_1 (book,
                                   only_if_exists,
                                   "b")
 E_DECLARE_GDBUS_ASYNC_METHOD_0 (book,
-                                remove)
-E_DECLARE_GDBUS_ASYNC_METHOD_0 (book,
                                 refresh)
 E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (book,
                                             get_contact,
@@ -898,7 +858,6 @@ E_DECLARE_GDBUS_SYNC_METHOD_0 (book,
 static const GDBusMethodInfo * const e_gdbus_book_method_info_pointers[] =
 {
 	&E_DECLARED_GDBUS_METHOD_INFO_NAME (book, open),
-	&E_DECLARED_GDBUS_METHOD_INFO_NAME (book, remove),
 	&E_DECLARED_GDBUS_METHOD_INFO_NAME (book, refresh),
 	&E_DECLARED_GDBUS_METHOD_INFO_NAME (book, get_contact),
 	&E_DECLARED_GDBUS_METHOD_INFO_NAME (book, get_contact_list),
@@ -924,7 +883,6 @@ static const GDBusSignalInfo * const e_gdbus_book_signal_info_pointers[] =
 	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, backend_property_changed),
 
 	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, open_done),
-	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, remove_done),
 	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, refresh_done),
 	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, get_contact_done),
 	&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (book, get_contact_list_done),
@@ -1146,7 +1104,6 @@ e_gdbus_book_proxy_init (EGdbusBookProxy *proxy)
 	proxy->priv->pending_ops = e_gdbus_async_op_keeper_create_pending_ops (E_GDBUS_ASYNC_OP_KEEPER (proxy));
 
 	E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_VOID   (open);
-	E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_VOID   (remove);
 	E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_VOID   (refresh);
 	E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_STRING (get_contact);
 	E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_STRV   (get_contact_list);
diff --git a/addressbook/libegdbus/e-gdbus-book.h b/addressbook/libegdbus/e-gdbus-book.h
index cf96df7..2ee76f5 100644
--- a/addressbook/libegdbus/e-gdbus-book.h
+++ b/addressbook/libegdbus/e-gdbus-book.h
@@ -122,9 +122,6 @@ struct _EGdbusBookIface
 	gboolean (*handle_open)			(EGdbusBook *object, GDBusMethodInvocation *invocation, gboolean in_only_if_exists);
 	void	 (*open_done)			(EGdbusBook *object, guint arg_opid, const GError *arg_error);
 
-	gboolean (*handle_remove)		(EGdbusBook *object, GDBusMethodInvocation *invocation);
-	void	 (*remove_done)			(EGdbusBook *object, guint arg_opid, const GError *arg_error);
-
 	gboolean (*handle_refresh)		(EGdbusBook *object, GDBusMethodInvocation *invocation);
 	void	 (*refresh_done)		(EGdbusBook *object, guint arg_opid, const GError *arg_error);
 
@@ -168,10 +165,6 @@ void		e_gdbus_book_call_open (GDBusProxy *proxy, gboolean in_only_if_exists, GCa
 gboolean	e_gdbus_book_call_open_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error);
 gboolean	e_gdbus_book_call_open_sync (GDBusProxy *proxy, gboolean in_only_if_exists, GCancellable *cancellable, GError **error);
 
-void		e_gdbus_book_call_remove (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
-gboolean	e_gdbus_book_call_remove_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error);
-gboolean	e_gdbus_book_call_remove_sync (GDBusProxy *proxy, GCancellable *cancellable, GError **error);
-
 void		e_gdbus_book_call_refresh (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
 gboolean	e_gdbus_book_call_refresh_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error);
 gboolean	e_gdbus_book_call_refresh_sync (GDBusProxy *proxy, GCancellable *cancellable, GError **error);
@@ -228,7 +221,6 @@ gboolean	e_gdbus_book_call_close_sync (GDBusProxy *proxy, GCancellable *cancella
 
 /* D-Bus Methods Completion Helpers */
 #define e_gdbus_book_complete_open				e_gdbus_complete_async_method
-#define e_gdbus_book_complete_remove				e_gdbus_complete_async_method
 #define e_gdbus_book_complete_refresh				e_gdbus_complete_async_method
 #define e_gdbus_book_complete_get_contact			e_gdbus_complete_async_method
 #define e_gdbus_book_complete_get_contact_list			e_gdbus_complete_async_method
@@ -244,7 +236,6 @@ gboolean	e_gdbus_book_call_close_sync (GDBusProxy *proxy, GCancellable *cancella
 #define e_gdbus_book_complete_close				e_gdbus_complete_sync_method_void
 
 void e_gdbus_book_emit_open_done			(EGdbusBook *object, guint arg_opid, const GError *arg_error);
-void e_gdbus_book_emit_remove_done			(EGdbusBook *object, guint arg_opid, const GError *arg_error);
 void e_gdbus_book_emit_refresh_done			(EGdbusBook *object, guint arg_opid, const GError *arg_error);
 void e_gdbus_book_emit_get_contact_done			(EGdbusBook *object, guint arg_opid, const GError *arg_error, const gchar *out_vcard);
 void e_gdbus_book_emit_get_contact_list_done		(EGdbusBook *object, guint arg_opid, const GError *arg_error, const gchar * const *out_vcards);
diff --git a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
index 28e7c23..ceac2b8 100644
--- a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
+++ b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
@@ -24,7 +24,6 @@ e_book_backend_is_removed
 e_book_backend_get_backend_property
 e_book_backend_set_backend_property
 e_book_backend_open
-e_book_backend_remove
 e_book_backend_refresh
 e_book_backend_create_contacts
 e_book_backend_remove_contacts
@@ -231,7 +230,6 @@ e_book_backend_summary_get_type
 EBookBackendSync
 e_book_backend_sync_construct
 e_book_backend_sync_open
-e_book_backend_sync_remove
 e_book_backend_sync_refresh
 e_book_backend_sync_get_backend_property
 e_book_backend_sync_set_backend_property
@@ -268,7 +266,6 @@ e_data_book_new
 e_data_book_get_backend
 e_data_book_register_gdbus_object
 e_data_book_respond_open
-e_data_book_respond_remove
 e_data_book_respond_refresh
 e_data_book_respond_get_backend_property
 e_data_book_respond_set_backend_property



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