diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2013-01-25 01:02:11 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2013-01-25 01:10:31 +0800 |
commit | 60c5c7170f5642a78a4fd2092e4e78caae8475d6 (patch) | |
tree | 70620e5c6207172473e96d405cfeb90f3eb6a205 | |
parent | f3dfdae8458d08331551ce441be045f4dfaa8b77 (diff) | |
download | gsoc2013-evolution-60c5c7170f5642a78a4fd2092e4e78caae8475d6.tar.gz gsoc2013-evolution-60c5c7170f5642a78a4fd2092e4e78caae8475d6.tar.zst gsoc2013-evolution-60c5c7170f5642a78a4fd2092e4e78caae8475d6.zip |
E_CLIENT_ERROR_BUSY is no longer used.
-rw-r--r-- | calendar/gui/e-cal-model.c | 57 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 12 | ||||
-rw-r--r-- | e-util/e-client-utils.c | 26 | ||||
-rw-r--r-- | modules/calendar/e-cal-shell-sidebar.c | 71 | ||||
-rw-r--r-- | modules/calendar/e-memo-shell-sidebar.c | 71 | ||||
-rw-r--r-- | modules/calendar/e-task-shell-sidebar.c | 71 |
6 files changed, 1 insertions, 307 deletions
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index b7c7145c05..617399b0a5 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -3005,28 +3005,6 @@ cal_model_retrieve_capabilies_cb (GObject *source_object, update_e_cal_view_for_client (model, client_data); } -struct RetryOpenData -{ - EClient *client; - ECalModel *model; - GCancellable *cancellable; -}; - -static void -free_retry_open_data (gpointer data) -{ - struct RetryOpenData *rod = data; - - if (!rod) - return; - - g_object_unref (rod->client); - g_object_unref (rod->cancellable); - g_free (rod); -} - -static gboolean cal_model_retry_open_timeout_cb (gpointer user_data); - static void client_opened_cb (GObject *source_object, GAsyncResult *result, @@ -3044,25 +3022,6 @@ client_opened_cb (GObject *source_object, return; } - if (error && g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { - struct RetryOpenData *rod; - - rod = g_new0 (struct RetryOpenData, 1); - rod->client = g_object_ref (client); - rod->model = model; - rod->cancellable = g_object_ref (model->priv->loading_clients); - - /* postpone for 1/2 of a second, backend is busy now */ - g_timeout_add_full ( - G_PRIORITY_DEFAULT, 500, - cal_model_retry_open_timeout_cb, - rod, free_retry_open_data); - - g_error_free (error); - - return; - } - if (error != NULL) { ESource *source; @@ -3084,22 +3043,6 @@ client_opened_cb (GObject *source_object, cal_model_retrieve_capabilies_cb, model); } -static gboolean -cal_model_retry_open_timeout_cb (gpointer user_data) -{ - struct RetryOpenData *rod = user_data; - - g_return_val_if_fail (rod != NULL, FALSE); - g_return_val_if_fail (rod->client != NULL, FALSE); - g_return_val_if_fail (rod->model != NULL, FALSE); - - e_client_open ( - rod->client, TRUE, rod->cancellable, - client_opened_cb, rod->model); - - return FALSE; -} - static ECalModelClient * add_new_client (ECalModel *model, ECalClient *client, diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8b9b2b3c17..66bb52a0a1 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1176,25 +1176,13 @@ update_query_async (struct _date_query_msg *msg) for (iter = list; iter != NULL; iter = iter->next) { ECalClient *client = E_CAL_CLIENT (iter->data); GError *error = NULL; - gint tries = 0; /* don't create queries for clients not loaded yet */ if (!e_client_is_opened (E_CLIENT (client))) continue; - try_again: new_view = NULL; if (!e_cal_client_get_view_sync (client, real_sexp, &new_view, NULL, &error)) { - /* If calendar is busy try again for 3 times. */ - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY) && tries != 10) { - tries++; - /*TODO chose an optimal value */ - g_usleep (500); - - g_clear_error (&error); - goto try_again; - } - g_warning (G_STRLOC ": Could not create the view: %s ", error->message); g_clear_error (&error); diff --git a/e-util/e-client-utils.c b/e-util/e-client-utils.c index ed0688b637..04efbe8177 100644 --- a/e-util/e-client-utils.c +++ b/e-util/e-client-utils.c @@ -246,7 +246,6 @@ client_utils_open_new_done (EClientUtilsAsyncOpData *async_data) e_client_retrieve_capabilities (async_data->client, async_data->cancellable, client_utils_capabilities_retrieved_cb, async_data); } -static gboolean client_utils_retry_open_timeout_cb (gpointer user_data); static void client_utils_opened_cb (EClient *client, const GError *error, EClientUtilsAsyncOpData *async_data); static void @@ -255,11 +254,7 @@ finish_or_retry_open (EClientUtilsAsyncOpData *async_data, { g_return_if_fail (async_data != NULL); - if (error && g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { - /* postpone for 1/2 of a second, backend is busy now */ - async_data->open_finished = FALSE; - async_data->retry_open_id = g_timeout_add (500, client_utils_retry_open_timeout_cb, async_data); - } else if (error) { + if (error) { return_async_error (error, async_data->callback, async_data->user_data, async_data->source, e_client_utils_open_new); free_client_utils_async_op_data (async_data); } else { @@ -325,25 +320,6 @@ client_utils_open_new_async_cb (GObject *source_object, /* wait for 'opened' signal, which is received in client_utils_opened_cb */ } -static gboolean -client_utils_retry_open_timeout_cb (gpointer user_data) -{ - EClientUtilsAsyncOpData *async_data = user_data; - - g_return_val_if_fail (async_data != NULL, FALSE); - - g_signal_handlers_disconnect_matched (async_data->cancellable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, async_data); - - /* reconnect to the signal */ - g_signal_connect (async_data->client, "opened", G_CALLBACK (client_utils_opened_cb), async_data); - - e_client_open (async_data->client, async_data->only_if_exists, async_data->cancellable, client_utils_open_new_async_cb, async_data); - - async_data->retry_open_id = 0; - - return FALSE; -} - /** * e_client_utils_open_new: * @source: an #ESource to be opened diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 3a870257e7..5f736b088c 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -209,28 +209,6 @@ cal_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL); } -static gboolean cal_shell_sidebar_retry_open_timeout_cb (gpointer user_data); - -struct RetryOpenData -{ - EClient *client; - ECalShellSidebar *cal_shell_sidebar; - GCancellable *cancellable; -}; - -static void -free_retry_open_data (gpointer data) -{ - struct RetryOpenData *rod = data; - - if (!rod) - return; - - g_object_unref (rod->client); - g_object_unref (rod->cancellable); - g_free (rod); -} - static void cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, @@ -255,24 +233,6 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, return; } - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { - struct RetryOpenData *rod; - - rod = g_new0 (struct RetryOpenData, 1); - rod->client = g_object_ref (client); - rod->cal_shell_sidebar = cal_shell_sidebar; - rod->cancellable = g_object_ref (cal_shell_sidebar->priv->loading_clients); - - /* postpone for 1/2 of a second, backend is busy now */ - g_timeout_add_full ( - G_PRIORITY_DEFAULT, 500, - cal_shell_sidebar_retry_open_timeout_cb, - rod, free_retry_open_data); - - g_clear_error (&error); - return; - } - shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -284,15 +244,6 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, case -1: break; - case E_CLIENT_ERROR_BUSY: - g_warning ( - "%s: Cannot open '%s', it's busy (%s)", - G_STRFUNC, e_source_get_display_name (source), - error->message); - g_clear_error (&error); - g_object_unref (parent); - return; - case E_CLIENT_ERROR_REPOSITORY_OFFLINE: e_alert_submit ( E_ALERT_SINK (shell_content), @@ -329,28 +280,6 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, cal_shell_sidebar); } -static gboolean -cal_shell_sidebar_retry_open_timeout_cb (gpointer user_data) -{ - struct RetryOpenData *rod = user_data; - - g_return_val_if_fail (rod != NULL, FALSE); - g_return_val_if_fail (rod->client != NULL, FALSE); - g_return_val_if_fail (rod->cal_shell_sidebar != NULL, FALSE); - g_return_val_if_fail (rod->cancellable != NULL, FALSE); - - if (g_cancellable_is_cancelled (rod->cancellable)) - return FALSE; - - e_client_open ( - rod->client, FALSE, - rod->cal_shell_sidebar->priv->loading_clients, - cal_shell_sidebar_client_opened_cb, - rod->cal_shell_sidebar); - - return FALSE; -} - static void cal_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *result, diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 64e74663c1..5251763944 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -206,28 +206,6 @@ memo_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL); } -static gboolean memo_shell_sidebar_retry_open_timeout_cb (gpointer user_data); - -struct RetryOpenData -{ - EClient *client; - EMemoShellSidebar *memo_shell_sidebar; - GCancellable *cancellable; -}; - -static void -free_retry_open_data (gpointer data) -{ - struct RetryOpenData *rod = data; - - if (!rod) - return; - - g_object_unref (rod->client); - g_object_unref (rod->cancellable); - g_free (rod); -} - static void memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, @@ -252,24 +230,6 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, return; } - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { - struct RetryOpenData *rod; - - rod = g_new0 (struct RetryOpenData, 1); - rod->client = g_object_ref (client); - rod->memo_shell_sidebar = memo_shell_sidebar; - rod->cancellable = g_object_ref (memo_shell_sidebar->priv->loading_clients); - - /* postpone for 1/2 of a second, backend is busy now */ - g_timeout_add_full ( - G_PRIORITY_DEFAULT, 500, - memo_shell_sidebar_retry_open_timeout_cb, - rod, free_retry_open_data); - - g_clear_error (&error); - return; - } - shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -281,15 +241,6 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, case -1: break; - case E_CLIENT_ERROR_BUSY: - g_warning ( - "%s: Cannot open '%s', it's busy (%s)", - G_STRFUNC, e_source_get_display_name (source), - error->message); - g_clear_error (&error); - g_object_unref (parent); - return; - case E_CLIENT_ERROR_REPOSITORY_OFFLINE: e_alert_submit ( E_ALERT_SINK (shell_content), @@ -326,28 +277,6 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, memo_shell_sidebar); } -static gboolean -memo_shell_sidebar_retry_open_timeout_cb (gpointer user_data) -{ - struct RetryOpenData *rod = user_data; - - g_return_val_if_fail (rod != NULL, FALSE); - g_return_val_if_fail (rod->client != NULL, FALSE); - g_return_val_if_fail (rod->memo_shell_sidebar != NULL, FALSE); - g_return_val_if_fail (rod->cancellable != NULL, FALSE); - - if (g_cancellable_is_cancelled (rod->cancellable)) - return FALSE; - - e_client_open ( - rod->client, FALSE, - rod->memo_shell_sidebar->priv->loading_clients, - memo_shell_sidebar_client_opened_cb, - rod->memo_shell_sidebar); - - return FALSE; -} - static void memo_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *result, diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 1f46e2932e..7c7742e295 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -206,28 +206,6 @@ task_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL); } -static gboolean task_shell_sidebar_retry_open_timeout_cb (gpointer user_data); - -struct RetryOpenData -{ - EClient *client; - ETaskShellSidebar *task_shell_sidebar; - GCancellable *cancellable; -}; - -static void -free_retry_open_data (gpointer data) -{ - struct RetryOpenData *rod = data; - - if (!rod) - return; - - g_object_unref (rod->client); - g_object_unref (rod->cancellable); - g_free (rod); -} - static void task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, @@ -252,24 +230,6 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, return; } - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { - struct RetryOpenData *rod; - - rod = g_new0 (struct RetryOpenData, 1); - rod->client = g_object_ref (client); - rod->task_shell_sidebar = task_shell_sidebar; - rod->cancellable = g_object_ref (task_shell_sidebar->priv->loading_clients); - - /* postpone for 1/2 of a second, backend is busy now */ - g_timeout_add_full ( - G_PRIORITY_DEFAULT, 500, - task_shell_sidebar_retry_open_timeout_cb, - rod, free_retry_open_data); - - g_clear_error (&error); - return; - } - shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); shell_content = e_shell_view_get_shell_content (shell_view); @@ -281,15 +241,6 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, case -1: break; - case E_CLIENT_ERROR_BUSY: - g_warning ( - "%s: Cannot open '%s', it's busy (%s)", - G_STRFUNC, e_source_get_display_name (source), - error->message); - g_clear_error (&error); - g_object_unref (parent); - return; - case E_CLIENT_ERROR_REPOSITORY_OFFLINE: e_alert_submit ( E_ALERT_SINK (shell_content), @@ -326,28 +277,6 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, task_shell_sidebar); } -static gboolean -task_shell_sidebar_retry_open_timeout_cb (gpointer user_data) -{ - struct RetryOpenData *rod = user_data; - - g_return_val_if_fail (rod != NULL, FALSE); - g_return_val_if_fail (rod->client != NULL, FALSE); - g_return_val_if_fail (rod->task_shell_sidebar != NULL, FALSE); - g_return_val_if_fail (rod->cancellable != NULL, FALSE); - - if (g_cancellable_is_cancelled (rod->cancellable)) - return FALSE; - - e_client_open ( - rod->client, FALSE, - rod->task_shell_sidebar->priv->loading_clients, - task_shell_sidebar_client_opened_cb, - rod->task_shell_sidebar); - - return FALSE; -} - static void task_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *result, |