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()
}
/**
- * 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.
}
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,
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;
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,
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,
}
/**
- * 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
guint32 opid,
GCancellable *cancellable,
gboolean only_if_exists);
- void (*remove) (EBookBackend *backend,
- EDataBook *book,
- guint32 opid,
- GCancellable *cancellable);
void (*refresh) (EBookBackend *backend,
EDataBook *book,
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,
typedef enum {
OP_OPEN,
- OP_REMOVE,
OP_REFRESH,
OP_GET_CONTACT,
OP_GET_CONTACTS,
gchar *prop_value;
} sbp;
- /* OP_REMOVE */
/* OP_REFRESH */
/* OP_CANCEL_ALL */
/* OP_CLOSE */
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;
}
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)
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.
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 (
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);
__BACKEND_PROPERTY_CHANGED_SIGNAL,
__OPEN_METHOD,
__OPEN_DONE_SIGNAL,
- __REMOVE_METHOD,
__REMOVE_DONE_SIGNAL,
__REFRESH_METHOD,
__REFRESH_DONE_SIGNAL,
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)
__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,
}
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,
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,
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,
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),
&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),
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);
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);
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);
/* 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
#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);
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
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
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