Commit 3fa4dfc5 authored by Matthew Barnes's avatar Matthew Barnes
Browse files

Remove usage of deprecated e_client_is_opened().

e_client_is_opened() always returns TRUE, so skip it.
parent 60c5c717
......@@ -1457,8 +1457,7 @@ ecm_append_row (ETableModel *etm,
if (comp_data->client)
g_object_ref (comp_data->client);
/* guard against saving before the calendar is open */
if (!comp_data->client || !e_client_is_opened (E_CLIENT (comp_data->client))) {
if (!comp_data->client) {
g_object_unref (comp_data);
return;
}
......@@ -2923,10 +2922,6 @@ update_e_cal_view_for_client (ECalModel *model,
priv = model->priv;
/* Skip if this client has not finished loading yet */
if (!e_client_is_opened (E_CLIENT (client_data->client)))
return;
/* free the previous view, if any */
if (client_data->view) {
g_signal_handlers_disconnect_matched (
......@@ -2980,69 +2975,6 @@ backend_died_cb (ECalClient *client,
e_cal_model_remove_client (model, client);
}
static void
cal_model_retrieve_capabilies_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ECalModel *model = user_data;
ECalModelClient *client_data;
gchar *capabilities = NULL;
g_return_if_fail (client != NULL);
g_return_if_fail (model != NULL);
e_client_retrieve_capabilities_finish (
E_CLIENT (client), result, &capabilities, NULL);
g_free (capabilities);
e_cal_model_update_status_message (model, NULL, -1.0);
client_data = find_client_data (model, client);
g_return_if_fail (client_data);
update_e_cal_view_for_client (model, client_data);
}
static void
client_opened_cb (GObject *source_object,
GAsyncResult *result,
gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ECalModel *model = (ECalModel *) user_data;
GError *error = NULL;
e_client_open_finish (E_CLIENT (client), result, &error);
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
g_error_free (error);
return;
}
if (error != NULL) {
ESource *source;
source = e_client_get_source (E_CLIENT (client));
e_cal_model_remove_client (model, client);
g_warning (
"%s: Failed to open '%s': %s",
G_STRFUNC,
e_source_get_display_name (source),
error->message);
g_error_free (error);
e_cal_model_update_status_message (model, NULL, -1.0);
return;
}
/* to have them ready for later use */
e_client_retrieve_capabilities (
E_CLIENT (client), model->priv->loading_clients,
cal_model_retrieve_capabilies_cb, model);
}
static ECalModelClient *
add_new_client (ECalModel *model,
ECalClient *client,
......@@ -3081,23 +3013,7 @@ add_new_client (ECalModel *model,
G_CALLBACK (backend_died_cb), model);
load:
if (e_client_is_opened (E_CLIENT (client))) {
update_e_cal_view_for_client (model, client_data);
} else {
ESource *source;
const gchar *display_name;
gchar *msg;
source = e_client_get_source (E_CLIENT (client));
display_name = e_source_get_display_name (source);
msg = g_strdup_printf (_("Opening %s"), display_name);
e_cal_model_update_status_message (model, msg, -1.0);
g_free (msg);
e_cal_client_set_default_timezone (client, e_cal_model_get_timezone (model));
e_client_open (E_CLIENT (client), TRUE, model->priv->loading_clients, client_opened_cb, model);
}
update_e_cal_view_for_client (model, client_data);
return client_data;
}
......
......@@ -1177,10 +1177,6 @@ update_query_async (struct _date_query_msg *msg)
ECalClient *client = E_CAL_CLIENT (iter->data);
GError *error = NULL;
/* don't create queries for clients not loaded yet */
if (!e_client_is_opened (E_CLIENT (client)))
continue;
new_view = NULL;
if (!e_cal_client_get_view_sync (client, real_sexp, &new_view, NULL, &error)) {
g_warning (G_STRLOC ": Could not create the view: %s ", error->message);
......
......@@ -165,9 +165,6 @@ tag_calendar_by_client (ECalendar *ecal,
if (!gtk_widget_get_visible (GTK_WIDGET (ecal)))
return;
if (!e_client_is_opened (E_CLIENT (client)))
return;
closure = g_new0 (struct calendar_tag_closure, 1);
if (!prepare_tag (ecal, closure, NULL, TRUE)) {
......
......@@ -312,12 +312,7 @@ client_utils_open_new_async_cb (GObject *source_object,
return;
}
if (e_client_is_opened (async_data->client)) {
client_utils_open_new_done (async_data);
return;
}
/* wait for 'opened' signal, which is received in client_utils_opened_cb */
client_utils_open_new_done (async_data);
}
/**
......
......@@ -881,7 +881,7 @@ static void
query_contact_source (EContactStore *contact_store,
ContactSource *source)
{
gboolean is_opened;
gchar *query_str;
g_assert (source->book_client != NULL);
......@@ -890,8 +890,6 @@ query_contact_source (EContactStore *contact_store,
return;
}
is_opened = e_client_is_opened (E_CLIENT (source->book_client));
if (source->client_view) {
if (source->client_view_pending) {
stop_view (contact_store, source->client_view_pending);
......@@ -902,13 +900,9 @@ query_contact_source (EContactStore *contact_store,
}
}
if (is_opened) {
gchar *query_str;
query_str = e_book_query_to_string (contact_store->priv->query);
e_book_client_get_view (source->book_client, query_str, NULL, client_view_ready_cb, g_object_ref (contact_store));
g_free (query_str);
}
query_str = e_book_query_to_string (contact_store->priv->query);
e_book_client_get_view (source->book_client, query_str, NULL, client_view_ready_cb, g_object_ref (contact_store));
g_free (query_str);
}
/* ----------------- *
......
......@@ -1188,8 +1188,7 @@ e_cal_shell_view_update_timezone (ECalShellView *cal_shell_view)
for (iter = clients; iter != NULL; iter = iter->next) {
ECalClient *client = iter->data;
if (e_client_is_opened (E_CLIENT (client)))
e_cal_client_set_default_timezone (client, timezone);
e_cal_client_set_default_timezone (client, timezone);
}
g_list_free (clients);
......
......@@ -456,8 +456,7 @@ e_memo_shell_view_update_timezone (EMemoShellView *memo_shell_view)
for (iter = clients; iter != NULL; iter = iter->next) {
ECalClient *client = iter->data;
if (e_client_is_opened (E_CLIENT (client)))
e_cal_client_set_default_timezone (client, timezone);
e_cal_client_set_default_timezone (client, timezone);
}
g_list_free (clients);
......
......@@ -637,8 +637,7 @@ e_task_shell_view_update_timezone (ETaskShellView *task_shell_view)
for (iter = clients; iter != NULL; iter = iter->next) {
ECalClient *client = iter->data;
if (e_client_is_opened (E_CLIENT (client)))
e_cal_client_set_default_timezone (client, timezone);
e_cal_client_set_default_timezone (client, timezone);
}
g_list_free (clients);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment