}
static gboolean
-book_client_retrieve_capabilities_sync (EClient *client,
- gchar **capabilities,
- GCancellable *cancellable,
- GError **error)
-{
- return e_client_get_backend_property_sync (
- client, CLIENT_BACKEND_PROPERTY_CAPABILITIES,
- capabilities, cancellable, error);
-}
-
-static gboolean
book_client_get_backend_property_sync (EClient *client,
const gchar *prop_name,
gchar **prop_value,
client_class = E_CLIENT_CLASS (class);
client_class->get_dbus_proxy = book_client_get_dbus_proxy;
client_class->unwrap_dbus_error = book_client_unwrap_dbus_error;
- client_class->retrieve_capabilities_sync = book_client_retrieve_capabilities_sync;
client_class->get_backend_property_sync = book_client_get_backend_property_sync;
client_class->set_backend_property_sync = book_client_set_backend_property_sync;
client_class->open_sync = book_client_open_sync;
}
static gboolean
-cal_client_retrieve_capabilities_sync (EClient *client,
- gchar **capabilities,
- GCancellable *cancellable,
- GError **error)
-{
- return e_client_get_backend_property_sync (
- client, CLIENT_BACKEND_PROPERTY_CAPABILITIES,
- capabilities, cancellable, error);
-}
-
-static gboolean
cal_client_get_backend_property_sync (EClient *client,
const gchar *prop_name,
gchar **prop_value,
client_class = E_CLIENT_CLASS (class);
client_class->get_dbus_proxy = cal_client_get_dbus_proxy;
client_class->unwrap_dbus_error = cal_client_unwrap_dbus_error;
- client_class->retrieve_capabilities_sync = cal_client_retrieve_capabilities_sync;
client_class->get_backend_property_sync = cal_client_get_backend_property_sync;
client_class->set_backend_property_sync = cal_client_set_backend_property_sync;
client_class->open_sync = cal_client_open_sync;
e_client_refresh
e_client_refresh_finish
e_client_refresh_sync
-e_client_retrieve_capabilities
-e_client_retrieve_capabilities_finish
-e_client_retrieve_capabilities_sync
e_client_util_parse_comma_strings
EClientErrorsList
e_client_util_unwrap_dbus_error
CLIENT_BACKEND_PROPERTY_OPENED
CLIENT_BACKEND_PROPERTY_OPENING
e_client_is_opened
+e_client_retrieve_capabilities
+e_client_retrieve_capabilities_finish
+e_client_retrieve_capabilities_sync
e_client_set_backend_property
e_client_set_backend_property_finish
e_client_set_backend_property_sync
ESource *source;
gboolean online;
gboolean readonly;
- gboolean capabilities_retrieved;
GSList *capabilities;
GRecMutex ops_mutex;
return TRUE;
}
+static gboolean
+client_retrieve_capabilities_sync (EClient *client,
+ gchar **capabilities,
+ GCancellable *cancellable,
+ GError **error)
+{
+ return e_client_get_backend_property_sync (
+ client, CLIENT_BACKEND_PROPERTY_CAPABILITIES,
+ capabilities, cancellable, error);
+}
+
/* Helper for client_get_backend_property() */
static void
client_get_backend_property_thread (GSimpleAsyncResult *simple,
class->retrieve_capabilities = client_retrieve_capabilities;
class->retrieve_capabilities_finish = client_retrieve_capabilities_finish;
+ class->retrieve_capabilities_sync = client_retrieve_capabilities_sync;
class->get_backend_property = client_get_backend_property;
class->get_backend_property_finish = client_get_backend_property_finish;
class->set_backend_property = client_set_backend_property;
static void
client_ensure_capabilities (EClient *client)
{
- gchar *capabilities;
+ gchar *capabilities = NULL;
g_return_if_fail (E_IS_CLIENT (client));
- if (client->priv->capabilities_retrieved || client->priv->capabilities)
+ if (client->priv->capabilities != NULL)
return;
- g_rec_mutex_lock (&client->priv->prop_mutex);
-
- capabilities = NULL;
- e_client_retrieve_capabilities_sync (client, &capabilities, NULL, NULL);
- /* e_client_set_capabilities is called inside the previous function */
+ /* Despite appearances this function does not actually block. */
+ e_client_get_backend_property_sync (
+ client, CLIENT_BACKEND_PROPERTY_CAPABILITIES,
+ &capabilities, NULL, NULL);
+ e_client_set_capabilities (client, capabilities);
g_free (capabilities);
-
- client->priv->capabilities_retrieved = TRUE;
-
- g_rec_mutex_unlock (&client->priv->prop_mutex);
}
/**
g_rec_mutex_lock (&client->priv->prop_mutex);
- if (!capabilities)
- client->priv->capabilities_retrieved = FALSE;
-
g_slist_foreach (client->priv->capabilities, (GFunc) g_free, NULL);
g_slist_free (client->priv->capabilities);
client->priv->capabilities = e_client_util_parse_comma_strings (capabilities);
* from the @callback.
*
* Since: 3.2
+ *
+ * Deprecated: 3.8: Use e_client_get_capabilities() instead.
**/
void
e_client_retrieve_capabilities (EClient *client,
* Returns: %TRUE if successful, %FALSE otherwise.
*
* Since: 3.2
+ *
+ * Deprecated: 3.8: Use e_client_get_capabilities() instead.
**/
gboolean
e_client_retrieve_capabilities_finish (EClient *client,
* Returns: %TRUE if successful, %FALSE otherwise.
*
* Since: 3.2
+ *
+ * Deprecated: 3.8: Use e_client_get_capabilities() instead.
**/
gboolean
e_client_retrieve_capabilities_sync (EClient *client,
GError *dbus_error,
GError **out_error);
+ /* This method is deprecated. */
void (*retrieve_capabilities)
(EClient *client,
GCancellable *cancellable,
GCancellable *cancellable,
GError **error);
-void e_client_retrieve_capabilities (EClient *client,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-gboolean e_client_retrieve_capabilities_finish
- (EClient *client,
- GAsyncResult *result,
- gchar **capabilities,
- GError **error);
-gboolean e_client_retrieve_capabilities_sync
- (EClient *client,
- gchar **capabilities,
- GCancellable *cancellable,
- GError **error);
-
GSList * e_client_util_parse_comma_strings
(const gchar *strings);
#define CLIENT_BACKEND_PROPERTY_OPENING "opening"
gboolean e_client_is_opened (EClient *client);
+void e_client_retrieve_capabilities (EClient *client,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+gboolean e_client_retrieve_capabilities_finish
+ (EClient *client,
+ GAsyncResult *result,
+ gchar **capabilities,
+ GError **error);
+gboolean e_client_retrieve_capabilities_sync
+ (EClient *client,
+ gchar **capabilities,
+ GCancellable *cancellable,
+ GError **error);
void e_client_set_backend_property (EClient *client,
const gchar *prop_name,
const gchar *prop_value,