e_client_remove_sync() merely calls e_source_remove_sync() now.
Similarly for e_client_remove() / e_client_remove_finish().
}
static void
-book_client_remove (EClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- e_client_proxy_call_void (client, cancellable, callback, user_data, book_client_remove,
- e_gdbus_book_call_remove,
- e_gdbus_book_call_remove_finish, NULL, NULL, NULL, NULL);
-}
-
-static gboolean
-book_client_remove_finish (EClient *client,
- GAsyncResult *result,
- GError **error)
-{
- return e_client_proxy_call_finish_void (client, result, error, book_client_remove);
-}
-
-static gboolean
-book_client_remove_sync (EClient *client,
- GCancellable *cancellable,
- GError **error)
-{
- EBookClient *book_client;
-
- g_return_val_if_fail (E_IS_BOOK_CLIENT (client), FALSE);
-
- book_client = E_BOOK_CLIENT (client);
-
- if (!book_client->priv->gdbus_book) {
- set_proxy_gone_error (error);
- return FALSE;
- }
-
- return e_client_proxy_call_sync_void__void (client, cancellable, error, e_gdbus_book_call_remove_sync);
-}
-
-static void
book_client_refresh (EClient *client,
GCancellable *cancellable,
GAsyncReadyCallback callback,
client_class->open = book_client_open;
client_class->open_finish = book_client_open_finish;
client_class->open_sync = book_client_open_sync;
- client_class->remove = book_client_remove;
- client_class->remove_finish = book_client_remove_finish;
- client_class->remove_sync = book_client_remove_sync;
client_class->refresh = book_client_refresh;
client_class->refresh_finish = book_client_refresh_finish;
client_class->refresh_sync = book_client_refresh_sync;
}
static void
-cal_client_remove (EClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- e_client_proxy_call_void (client, cancellable, callback, user_data, cal_client_remove,
- e_gdbus_cal_call_remove,
- e_gdbus_cal_call_remove_finish, NULL, NULL, NULL, NULL);
-}
-
-static gboolean
-cal_client_remove_finish (EClient *client,
- GAsyncResult *result,
- GError **error)
-{
- return e_client_proxy_call_finish_void (client, result, error, cal_client_remove);
-}
-
-static gboolean
-cal_client_remove_sync (EClient *client,
- GCancellable *cancellable,
- GError **error)
-{
- ECalClient *cal_client;
-
- g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
-
- cal_client = E_CAL_CLIENT (client);
-
- if (!cal_client->priv->gdbus_cal) {
- set_proxy_gone_error (error);
- return FALSE;
- }
-
- return e_client_proxy_call_sync_void__void (client, cancellable, error, e_gdbus_cal_call_remove_sync);
-}
-
-static void
cal_client_refresh (EClient *client,
GCancellable *cancellable,
GAsyncReadyCallback callback,
client_class->open = cal_client_open;
client_class->open_finish = cal_client_open_finish;
client_class->open_sync = cal_client_open_sync;
- client_class->remove = cal_client_remove;
- client_class->remove_finish = cal_client_remove_finish;
- client_class->remove_sync = cal_client_remove_sync;
client_class->refresh = cal_client_refresh;
client_class->refresh_finish = cal_client_refresh_finish;
client_class->refresh_sync = cal_client_refresh_sync;
e_client_open
e_client_open_finish
e_client_open_sync
-e_client_remove
-e_client_remove_finish
-e_client_remove_sync
e_client_refresh
e_client_refresh_finish
e_client_refresh_sync
e_client_util_parse_comma_strings
EClientErrorsList
e_client_util_unwrap_dbus_error
+e_client_remove
+e_client_remove_finish
+e_client_remove_sync
<SUBSECTION Standard>
E_CLIENT
E_IS_CLIENT
}
static void
+client_remove_thread (GSimpleAsyncResult *simple,
+ GObject *object,
+ GCancellable *cancellable)
+{
+ GError *error = NULL;
+
+ e_client_remove_sync (E_CLIENT (object), cancellable, &error);
+
+ if (error != NULL)
+ g_simple_async_result_take_error (simple, error);
+}
+
+static void
+client_remove (EClient *client,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GSimpleAsyncResult *simple;
+
+ simple = g_simple_async_result_new (
+ G_OBJECT (client), callback, user_data, client_remove);
+
+ g_simple_async_result_set_check_cancellable (simple, cancellable);
+
+ g_simple_async_result_run_in_thread (
+ simple, client_remove_thread,
+ G_PRIORITY_DEFAULT, cancellable);
+
+ g_object_unref (simple);
+}
+
+static gboolean
+client_remove_finish (EClient *client,
+ GAsyncResult *result,
+ GError **error)
+{
+ GSimpleAsyncResult *simple;
+
+ g_return_val_if_fail (
+ g_simple_async_result_is_valid (
+ result, G_OBJECT (client), client_remove), FALSE);
+
+ simple = G_SIMPLE_ASYNC_RESULT (result);
+
+ /* Assume success unless a GError is set. */
+ return !g_simple_async_result_propagate_error (simple, error);
+}
+
+static gboolean
+client_remove_sync (EClient *client,
+ GCancellable *cancellable,
+ GError **error)
+{
+ ESource *source;
+
+ source = e_client_get_source (client);
+
+ return e_source_remove_sync (source, cancellable, error);
+}
+
+static void
e_client_class_init (EClientClass *class)
{
GObjectClass *object_class;
object_class->dispose = client_dispose;
object_class->finalize = client_finalize;
+ class->remove = client_remove;
+ class->remove_finish = client_remove_finish;
+ class->remove_sync = client_remove_sync;
+
g_object_class_install_property (
object_class,
PROP_SOURCE,
* The call is finished by e_client_remove_finish() from the @callback.
*
* Since: 3.2
+ *
+ * Deprecated: 3.6: Use e_source_remove() instead.
**/
void
e_client_remove (EClient *client,
* Returns: %TRUE if successful, %FALSE otherwise.
*
* Since: 3.2
+ *
+ * Deprecated: 3.6: Use e_source_remove_finish() instead.
**/
gboolean
e_client_remove_finish (EClient *client,
* Returns: %TRUE if successful, %FALSE otherwise.
*
* Since: 3.2
+ *
+ * Deprecated: 3.6: Use e_source_remove_sync() instead.
**/
gboolean
e_client_remove_sync (EClient *client,
gboolean e_client_open_finish (EClient *client, GAsyncResult *result, GError **error);
gboolean e_client_open_sync (EClient *client, gboolean only_if_exists, GCancellable *cancellable, GError **error);
-void e_client_remove (EClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
-gboolean e_client_remove_finish (EClient *client, GAsyncResult *result, GError **error);
-gboolean e_client_remove_sync (EClient *client, GCancellable *cancellable, GError **error);
-
void e_client_refresh (EClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
gboolean e_client_refresh_finish (EClient *client, GAsyncResult *result, GError **error);
gboolean e_client_refresh_sync (EClient *client, GCancellable *cancellable, GError **error);
void e_client_util_free_object_slist (GSList *objects);
GSList * e_client_util_parse_comma_strings (const gchar *strings);
+#ifndef EDS_DISABLE_DEPRECATED
+void e_client_remove (EClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
+gboolean e_client_remove_finish (EClient *client, GAsyncResult *result, GError **error);
+gboolean e_client_remove_sync (EClient *client, GCancellable *cancellable, GError **error);
+#endif /* EDS_DISABLE_DEPRECATED */
+
typedef struct _EClientErrorsList EClientErrorsList;
/**