aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-07-01 12:07:26 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-08-13 23:27:51 +0800
commitf59681796df8fe0138a1754abbe8ec781bc1535e (patch)
tree0ced0c119ffed095713d7f64732686df9b2d9152 /modules
parentbf4a1a13e3295deefc4031a446627ff9b1c95c7a (diff)
downloadgsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.gz
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.bz2
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.lz
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.xz
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.tar.zst
gsoc2013-evolution-f59681796df8fe0138a1754abbe8ec781bc1535e.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'modules')
-rw-r--r--modules/addressbook/e-book-shell-backend.c92
-rw-r--r--modules/addressbook/e-book-shell-view-private.c52
-rw-r--r--modules/calendar/e-cal-attachment-handler.c56
-rw-r--r--modules/calendar/e-cal-shell-backend.c87
-rw-r--r--modules/calendar/e-cal-shell-sidebar.c90
-rw-r--r--modules/calendar/e-cal-shell-view-actions.c76
-rw-r--r--modules/calendar/e-cal-shell-view-private.c18
-rw-r--r--modules/calendar/e-cal-shell-view.c10
-rw-r--r--modules/calendar/e-memo-shell-backend.c77
-rw-r--r--modules/calendar/e-memo-shell-sidebar.c90
-rw-r--r--modules/calendar/e-memo-shell-view-actions.c34
-rw-r--r--modules/calendar/e-task-shell-backend.c77
-rw-r--r--modules/calendar/e-task-shell-sidebar.c97
-rw-r--r--modules/calendar/e-task-shell-view-actions.c34
-rw-r--r--modules/calendar/e-task-shell-view-private.c20
-rw-r--r--modules/mail/em-account-prefs.c9
-rw-r--r--modules/online-accounts/camel-sasl-xoauth.c10
17 files changed, 643 insertions, 286 deletions
diff --git a/modules/addressbook/e-book-shell-backend.c b/modules/addressbook/e-book-shell-backend.c
index d80d9554a0..c52b39b9fa 100644
--- a/modules/addressbook/e-book-shell-backend.c
+++ b/modules/addressbook/e-book-shell-backend.c
@@ -86,9 +86,13 @@ book_shell_backend_ensure_sources (EShellBackend *shell_backend)
priv = E_BOOK_SHELL_BACKEND (shell_backend)->priv;
- if (!e_book_client_get_sources (&priv->source_list, &error)) {
- g_warning ("Could not get addressbook sources: %s", error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_book_client_get_sources (&priv->source_list, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "Could not get addressbook sources: %s",
+ error->message);
+ g_error_free (error);
return;
}
@@ -156,68 +160,82 @@ book_shell_backend_init_importers (void)
}
static void
-book_shell_backend_new_contact_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+book_shell_backend_new_contact_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EShell *shell = user_data;
EClient *client = NULL;
+ EContact *contact;
+ EABEditor *editor;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
/* XXX Handle errors better. */
- if (client == NULL) {
- g_debug ("%s: Failed to open book: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
- } else {
- EBookClient *book_client = E_BOOK_CLIENT (client);
- EContact *contact;
- EABEditor *editor;
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open book: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
+ goto exit;
+ }
- contact = e_contact_new ();
+ g_return_if_fail (E_IS_CLIENT (client));
- editor = e_contact_editor_new (
- shell, book_client, contact, TRUE, TRUE);
+ contact = e_contact_new ();
- eab_editor_show (editor);
+ editor = e_contact_editor_new (
+ shell, E_BOOK_CLIENT (client), contact, TRUE, TRUE);
- g_object_unref (contact);
- g_object_unref (book_client);
- }
+ eab_editor_show (editor);
+
+ g_object_unref (contact);
+ g_object_unref (client);
+exit:
g_object_unref (shell);
}
static void
-book_shell_backend_new_contact_list_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+book_shell_backend_new_contact_list_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EShell *shell = user_data;
EClient *client = NULL;
+ EContact *contact;
+ EABEditor *editor;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
/* XXX Handle errors better. */
- if (client == NULL) {
- g_debug ("%s: Failed to open book: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
- } else {
- EBookClient *book_client = E_BOOK_CLIENT (client);
- EContact *contact;
- EABEditor *editor;
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open book: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
+ goto exit;
+ }
- contact = e_contact_new ();
+ g_return_if_fail (E_IS_CLIENT (client));
- editor = e_contact_list_editor_new (
- shell, book_client, contact, TRUE, TRUE);
+ contact = e_contact_new ();
- eab_editor_show (editor);
+ editor = e_contact_list_editor_new (
+ shell, E_BOOK_CLIENT (client), contact, TRUE, TRUE);
- g_object_unref (contact);
- g_object_unref (book_client);
- }
+ eab_editor_show (editor);
+
+ g_object_unref (contact);
+ g_object_unref (client);
+exit:
g_object_unref (shell);
}
diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c
index c9a233df9f..20fd278f66 100644
--- a/modules/addressbook/e-book-shell-view-private.c
+++ b/modules/addressbook/e-book-shell-view-private.c
@@ -184,40 +184,48 @@ contacts_removed (EBookShellView *book_shell_view,
}
static void
-book_shell_view_loaded_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+book_shell_view_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ESource *source = E_SOURCE (source_object);
EAddressbookView *view = user_data;
EClient *client = NULL;
- EBookClient *book;
+ EAddressbookModel *model;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, &error))
- client = NULL;
-
- book = client ? E_BOOK_CLIENT (client) : NULL;
-
- if (book != NULL) {
- EAddressbookModel *model;
+ e_client_utils_open_new_finish (source, result, &client, &error);
- g_warn_if_fail (error == NULL);
- model = e_addressbook_view_get_model (view);
- e_addressbook_model_set_client (model, book);
- e_addressbook_model_force_folder_bar_message (model);
+ /* Ignore cancellations. */
+ if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warn_if_fail (client == NULL);
+ g_error_free (error);
+ goto exit;
- } else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ } else if (error != NULL) {
EShellView *shell_view;
+ EShellContent *shell_content;
EAlertSink *alert_sink;
+ g_warn_if_fail (client == NULL);
+
shell_view = e_addressbook_view_get_shell_view (view);
- alert_sink = E_ALERT_SINK (e_shell_view_get_shell_content (shell_view));
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ alert_sink = E_ALERT_SINK (shell_content);
eab_load_error_dialog (NULL, alert_sink, source, error);
- }
- if (error != NULL)
g_error_free (error);
+ goto exit;
+ }
+
+ g_return_if_fail (E_IS_CLIENT (client));
+
+ model = e_addressbook_view_get_model (view);
+ e_addressbook_model_set_client (model, E_BOOK_CLIENT (client));
+ e_addressbook_model_force_folder_bar_message (model);
+exit:
g_object_unref (view);
}
@@ -260,9 +268,13 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view,
if (e_addressbook_model_get_client (model) == NULL)
/* XXX No way to cancel this? */
- e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_CONTACTS, FALSE, NULL,
- e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
- book_shell_view_loaded_cb, g_object_ref (view));
+ e_client_utils_open_new (
+ source, E_CLIENT_SOURCE_TYPE_CONTACTS,
+ FALSE, NULL,
+ e_client_utils_authenticate_handler,
+ GTK_WINDOW (shell_window),
+ book_shell_view_loaded_cb,
+ g_object_ref (view));
} else {
/* Create a view for this UID. */
diff --git a/modules/calendar/e-cal-attachment-handler.c b/modules/calendar/e-cal-attachment-handler.c
index a2932a0d17..24a73f6d1a 100644
--- a/modules/calendar/e-cal-attachment-handler.c
+++ b/modules/calendar/e-cal-attachment-handler.c
@@ -141,10 +141,15 @@ attachment_handler_update_objects (ECalClient *client,
return FALSE;
}
- success = e_cal_client_receive_objects_sync (client, vcalendar, NULL, &error);
- if (error)
- g_debug ("%s: Failed to receive objects: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ success = e_cal_client_receive_objects_sync (
+ client, vcalendar, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to receive objects: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
+ }
icalcomponent_free (vcalendar);
@@ -152,8 +157,11 @@ attachment_handler_update_objects (ECalClient *client,
}
static void
-attachment_handler_import_event (GObject *source_object, GAsyncResult *result, gpointer user_data)
+attachment_handler_import_event (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EAttachment *attachment = user_data;
EClient *client = NULL;
GError *error = NULL;
@@ -161,15 +169,21 @@ attachment_handler_import_event (GObject *source_object, GAsyncResult *result, g
icalcomponent *subcomponent;
icalcompiter iter;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
- if (!client) {
- g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (E_SOURCE (source_object)), error ? error->message : "Unknown error");
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_object_unref (attachment);
+ g_error_free (error);
return;
}
+ g_return_if_fail (E_IS_CLIENT (client));
+
component = attachment_handler_get_component (attachment);
g_return_if_fail (component != NULL);
@@ -199,8 +213,11 @@ attachment_handler_import_event (GObject *source_object, GAsyncResult *result, g
}
static void
-attachment_handler_import_todo (GObject *source_object, GAsyncResult *result, gpointer user_data)
+attachment_handler_import_todo (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EAttachment *attachment = user_data;
EClient *client = NULL;
GError *error = NULL;
@@ -208,15 +225,21 @@ attachment_handler_import_todo (GObject *source_object, GAsyncResult *result, gp
icalcomponent *subcomponent;
icalcompiter iter;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
- if (!client) {
- g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (E_SOURCE (source_object)), error ? error->message : "Unknown error");
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_object_unref (attachment);
+ g_error_free (error);
return;
}
+ g_return_if_fail (E_IS_CLIENT (client));
+
component = attachment_handler_get_component (attachment);
g_return_if_fail (component != NULL);
@@ -270,8 +293,11 @@ attachment_handler_run_dialog (GtkWindow *parent,
g_return_if_fail (component != NULL);
e_cal_client_get_sources (&source_list, source_type, &error);
+
if (error != NULL) {
- g_debug ("%s: Faield to get cal sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ g_warning (
+ "%s: Failed to get cal sources: %s",
+ G_STRFUNC, error->message);
g_clear_error (&error);
return;
}
diff --git a/modules/calendar/e-cal-shell-backend.c b/modules/calendar/e-cal-shell-backend.c
index 744cd60b18..96077cf19e 100644
--- a/modules/calendar/e-cal-shell-backend.c
+++ b/modules/calendar/e-cal-shell-backend.c
@@ -95,11 +95,15 @@ cal_shell_backend_ensure_sources (EShellBackend *shell_backend)
shell = e_shell_backend_get_shell (shell_backend);
shell_settings = e_shell_get_shell_settings (shell);
- if (!e_cal_client_get_sources (
+ e_cal_client_get_sources (
&cal_shell_backend->priv->source_list,
- E_CAL_CLIENT_SOURCE_TYPE_EVENTS, &error)) {
- g_debug ("%s: Could not get calendar sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ E_CAL_CLIENT_SOURCE_TYPE_EVENTS, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get calendar sources: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -244,12 +248,15 @@ cal_shell_backend_new_event (ESource *source,
GError *error = NULL;
/* XXX Handle errors better. */
- if (!e_client_utils_open_new_finish (source, result, &client, &error))
- client = NULL;
-
- if (!client) {
- g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_utils_open_new_finish (source, result, &client, &error);
+
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
return;
}
@@ -279,7 +286,9 @@ cal_shell_backend_new_event (ESource *source,
}
static void
-cal_shell_backend_event_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+cal_shell_backend_event_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
gboolean all_day = FALSE;
@@ -287,13 +296,16 @@ cal_shell_backend_event_new_cb (GObject *source_object, GAsyncResult *result, gp
flags |= COMP_EDITOR_NEW_ITEM;
flags |= COMP_EDITOR_USER_ORG;
- cal_shell_backend_new_event (E_SOURCE (source_object), result, shell, flags, all_day);
+ cal_shell_backend_new_event (
+ E_SOURCE (source_object), result, shell, flags, all_day);
g_object_unref (shell);
}
static void
-cal_shell_backend_event_all_day_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+cal_shell_backend_event_all_day_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
gboolean all_day = TRUE;
@@ -301,13 +313,16 @@ cal_shell_backend_event_all_day_new_cb (GObject *source_object, GAsyncResult *re
flags |= COMP_EDITOR_NEW_ITEM;
flags |= COMP_EDITOR_USER_ORG;
- cal_shell_backend_new_event (E_SOURCE (source_object), result, shell, flags, all_day);
+ cal_shell_backend_new_event (
+ E_SOURCE (source_object), result, shell, flags, all_day);
g_object_unref (shell);
}
static void
-cal_shell_backend_event_meeting_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+cal_shell_backend_event_meeting_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
gboolean all_day = FALSE;
@@ -316,7 +331,8 @@ cal_shell_backend_event_meeting_new_cb (GObject *source_object, GAsyncResult *re
flags |= COMP_EDITOR_USER_ORG;
flags |= COMP_EDITOR_MEETING;
- cal_shell_backend_new_event (E_SOURCE (source_object), result, shell, flags, all_day);
+ cal_shell_backend_new_event (
+ E_SOURCE (source_object), result, shell, flags, all_day);
g_object_unref (shell);
}
@@ -587,24 +603,36 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
* we successfully open it is another matter... */
handled = TRUE;
- if (!e_cal_client_get_sources (&source_list, source_type, &error)) {
- g_debug ("%s: Could not get calendar sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_cal_client_get_sources (&source_list, source_type, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get calendar sources: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
goto exit;
}
source = e_source_list_peek_source_by_uid (source_list, source_uid);
+
if (source == NULL) {
- g_debug ("%s: No source for UID '%s'", G_STRFUNC, source_uid);
+ g_warning ("%s: No source for UID '%s'", G_STRFUNC, source_uid);
g_object_unref (source_list);
goto exit;
}
client = e_cal_client_new (source, source_type, &error);
- if (client == NULL || !e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error)) {
- g_debug ("%s: Failed to create/open client '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+
+ if (client != NULL)
+ e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to create/open client '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_object_unref (source_list);
+ g_error_free (error);
goto exit;
}
@@ -616,16 +644,21 @@ cal_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
if (editor != NULL)
goto present;
- if (!e_cal_client_get_object_sync (client, comp_uid, comp_rid, &icalcomp, NULL, &error)) {
- g_debug ("%s: Failed to get object from client: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ e_cal_client_get_object_sync (
+ client, comp_uid, comp_rid, &icalcomp, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to get object from client: %s",
+ G_STRFUNC, error->message);
g_object_unref (source_list);
- g_clear_error (&error);
+ g_error_free (error);
goto exit;
}
comp = e_cal_component_new ();
if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_debug ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
+ g_warning ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
icalcomponent_free (icalcomp);
icalcomp = NULL;
}
diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c
index e296f6ff31..77c5639a78 100644
--- a/modules/calendar/e-cal-shell-sidebar.c
+++ b/modules/calendar/e-cal-shell-sidebar.c
@@ -165,7 +165,9 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar,
}
static void
-cal_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+cal_shell_sidebar_retrieve_capabilies_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ECalShellSidebar *cal_shell_sidebar = user_data;
@@ -174,10 +176,12 @@ cal_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *
g_return_if_fail (client != NULL);
g_return_if_fail (cal_shell_sidebar != NULL);
- e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ e_client_retrieve_capabilities_finish (
+ E_CLIENT (client), result, &capabilities, NULL);
g_free (capabilities);
- cal_shell_sidebar_emit_status_message (cal_shell_sidebar, _("Loading calendars"));
+ cal_shell_sidebar_emit_status_message (
+ cal_shell_sidebar, _("Loading calendars"));
cal_shell_sidebar_emit_client_added (cal_shell_sidebar, client);
cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL);
}
@@ -205,15 +209,20 @@ free_retry_open_data (gpointer data)
}
static void
-cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+cal_shell_sidebar_client_opened_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ECalShellSidebar *cal_shell_sidebar = user_data;
+ ESource *source;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GError *error = NULL;
+ source = e_client_get_source (E_CLIENT (client));
+
e_client_open_finish (E_CLIENT (client), result, &error);
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
@@ -227,7 +236,10 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
e_client_utils_forget_password (E_CLIENT (client));
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
- e_client_open (E_CLIENT (client), FALSE, cal_shell_sidebar->priv->loading_clients, cal_shell_sidebar_client_opened_cb, user_data);
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ cal_shell_sidebar->priv->loading_clients,
+ cal_shell_sidebar_client_opened_cb, user_data);
g_clear_error (&error);
return;
@@ -242,7 +254,10 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
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_timeout_add_full (
+ G_PRIORITY_DEFAULT, 500,
+ cal_shell_sidebar_retry_open_timeout_cb,
+ rod, free_retry_open_data);
g_clear_error (&error);
return;
@@ -258,7 +273,10 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
break;
case E_CLIENT_ERROR_BUSY:
- g_debug ("%s: Cannot open '%s', it's busy (%s)", G_STRFUNC, e_source_peek_name (e_client_get_source (E_CLIENT (client))), error->message);
+ g_warning (
+ "%s: Cannot open '%s', it's busy (%s)",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_clear_error (&error);
return;
@@ -287,7 +305,10 @@ cal_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result
g_clear_error (&error);
/* to have them ready for later use */
- e_client_retrieve_capabilities (E_CLIENT (client), NULL, cal_shell_sidebar_retrieve_capabilies_cb, cal_shell_sidebar);
+ e_client_retrieve_capabilities (
+ E_CLIENT (client), NULL,
+ cal_shell_sidebar_retrieve_capabilies_cb,
+ cal_shell_sidebar);
}
static gboolean
@@ -303,14 +324,21 @@ cal_shell_sidebar_retry_open_timeout_cb (gpointer user_data)
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);
+ 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, gpointer user_data)
+cal_shell_sidebar_default_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EShellSidebar *shell_sidebar = user_data;
ECalShellSidebarPrivate *priv;
EShellContent *shell_content;
@@ -322,21 +350,22 @@ cal_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resul
priv = E_CAL_SHELL_SIDEBAR (shell_sidebar)->priv;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
+ model = e_cal_shell_content_get_model (cal_shell_content);
+
+ e_client_utils_open_new_finish (source, result, &client, &error);
+ /* Ignore cancellations. */
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warn_if_fail (client == NULL);
g_error_free (error);
goto exit;
- }
-
- shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- shell_content = e_shell_view_get_shell_content (shell_view);
- cal_shell_content = E_CAL_SHELL_CONTENT (shell_content);
- model = e_cal_shell_content_get_model (cal_shell_content);
- if (error != NULL) {
+ } else if (error != NULL) {
+ g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-calendar",
@@ -352,7 +381,8 @@ cal_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resul
priv->default_client = E_CAL_CLIENT (client);
- e_cal_client_set_default_timezone (priv->default_client, e_cal_model_get_timezone (model));
+ e_cal_client_set_default_timezone (
+ priv->default_client, e_cal_model_get_timezone (model));
g_object_notify (G_OBJECT (shell_sidebar), "default-client");
@@ -401,9 +431,13 @@ cal_shell_sidebar_set_default (ECalShellSidebar *cal_shell_sidebar,
priv->loading_default_client = g_cancellable_new ();
- e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_EVENTS, FALSE, priv->loading_default_client,
- e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
- cal_shell_sidebar_default_loaded_cb, g_object_ref (shell_sidebar));
+ e_client_utils_open_new (
+ source, E_CLIENT_SOURCE_TYPE_EVENTS,
+ FALSE, priv->loading_default_client,
+ e_client_utils_authenticate_handler,
+ GTK_WINDOW (shell_window),
+ cal_shell_sidebar_default_loaded_cb,
+ g_object_ref (shell_sidebar));
}
static void
@@ -1064,7 +1098,9 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
if (client == NULL) {
client = e_cal_client_new (source, source_type, NULL);
if (client)
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
}
g_return_if_fail (client != NULL);
@@ -1099,7 +1135,11 @@ e_cal_shell_sidebar_add_source (ECalShellSidebar *cal_shell_sidebar,
timezone = e_cal_model_get_timezone (model);
e_cal_client_set_default_timezone (client, timezone);
- e_client_open (E_CLIENT (client), FALSE, cal_shell_sidebar->priv->loading_clients, cal_shell_sidebar_client_opened_cb, cal_shell_sidebar);
+
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ cal_shell_sidebar->priv->loading_clients,
+ cal_shell_sidebar_client_opened_cb, cal_shell_sidebar);
}
void
diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c
index 6537cde8b4..f8b426c6f2 100644
--- a/modules/calendar/e-cal-shell-view-actions.c
+++ b/modules/calendar/e-cal-shell-view-actions.c
@@ -102,14 +102,19 @@ action_calendar_delete_cb (GtkAction *action,
uri = e_source_get_uri (source);
client = e_cal_model_get_client_for_uri (model, uri);
if (client == NULL)
- client = e_cal_client_new_from_uri (uri, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
+ client = e_cal_client_new_from_uri (
+ uri, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
g_free (uri);
g_return_if_fail (client != NULL);
- if (!e_client_remove_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to remove client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_remove_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to remove client: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -124,9 +129,14 @@ action_calendar_delete_cb (GtkAction *action,
source_list = e_cal_shell_backend_get_source_list (
E_CAL_SHELL_BACKEND (shell_backend));
- if (!e_source_list_sync (source_list, &error)) {
- g_debug ("%s: Failed to sync source list: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+
+ e_source_list_sync (source_list, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to sync source list: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
}
}
@@ -386,9 +396,14 @@ action_calendar_refresh_cb (GtkAction *action,
g_return_if_fail (e_client_check_refresh_supported (E_CLIENT (client)));
- if (!e_client_refresh_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_refresh_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to refresh '%s', %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
}
}
@@ -515,12 +530,14 @@ action_event_copy_cb (GtkAction *action,
ECalendarViewEvent *event = selected->data;
if (is_comp_data_valid (event) && event->comp_data->client)
- source_source = e_client_get_source (E_CLIENT (event->comp_data->client));
+ source_source = e_client_get_source (
+ E_CLIENT (event->comp_data->client));
}
/* Get a destination source from the user. */
destination_source = select_source_dialog (
- GTK_WINDOW (shell_window), E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
+ GTK_WINDOW (shell_window),
+ E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
if (destination_source == NULL)
return;
@@ -529,11 +546,17 @@ action_event_copy_cb (GtkAction *action,
destination_source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
if (destination_client == NULL)
goto exit;
- g_signal_connect (destination_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ destination_client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
- if (!e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error)) {
- g_debug ("%s: Failed to open destination client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to open destination client: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
goto exit;
}
@@ -791,23 +814,32 @@ action_event_move_cb (GtkAction *action,
ECalendarViewEvent *event = selected->data;
if (is_comp_data_valid (event) && event->comp_data->client)
- source_source = e_client_get_source (E_CLIENT (event->comp_data->client));
+ source_source = e_client_get_source (
+ E_CLIENT (event->comp_data->client));
}
/* Get a destination source from the user. */
destination_source = select_source_dialog (
- GTK_WINDOW (shell_window), E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
+ GTK_WINDOW (shell_window),
+ E_CAL_CLIENT_SOURCE_TYPE_EVENTS, source_source);
if (destination_source == NULL)
return;
/* Open the destination calendar. */
- destination_client = e_cal_client_new (destination_source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
+ destination_client = e_cal_client_new (
+ destination_source, E_CAL_CLIENT_SOURCE_TYPE_EVENTS, NULL);
if (destination_client == NULL)
goto exit;
- g_signal_connect (destination_client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ destination_client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+
+ e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error);
- if (!e_client_open_sync (E_CLIENT (destination_client), FALSE, NULL, &error)) {
- g_debug ("%s: Failed to open destination client: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to open destination client: %s",
+ G_STRFUNC, error->message);
g_clear_error (&error);
goto exit;
}
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index 01ae23cc1c..7a9fdaac69 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -933,12 +933,17 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view,
}
new_uid = NULL;
- icalcomponent_foreach_tzid (icalcomp_clone, add_timezone_to_cal_cb, &ftd);
+ icalcomponent_foreach_tzid (
+ icalcomp_clone, add_timezone_to_cal_cb, &ftd);
success = e_cal_client_create_object_sync (
- destination_client, icalcomp_clone, &new_uid, NULL, &error);
+ destination_client, icalcomp_clone,
+ &new_uid, NULL, &error);
if (!success) {
icalcomponent_free (icalcomp_clone);
- g_debug ("%s: Failed to create object: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ g_warning (
+ "%s: Failed to create object: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -962,10 +967,13 @@ e_cal_shell_view_transfer_item_to (ECalShellView *cal_shell_view,
else
rid = NULL;
e_cal_client_remove_object_sync (
- source_client, uid, rid, CALOBJ_MOD_ALL, NULL, NULL);
+ source_client, uid, rid,
+ CALOBJ_MOD_ALL, NULL, NULL);
g_free (rid);
} else
- e_cal_client_remove_object_sync (source_client, uid, NULL, CALOBJ_MOD_THIS, NULL, NULL);
+ e_cal_client_remove_object_sync (
+ source_client, uid, NULL,
+ CALOBJ_MOD_THIS, NULL, NULL);
}
}
diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c
index 2249bf96e4..03914f1793 100644
--- a/modules/calendar/e-cal-shell-view.c
+++ b/modules/calendar/e-cal-shell-view.c
@@ -391,9 +391,13 @@ cal_shell_view_update_actions (EShellView *shell_view)
itip_organizer_is_user (comp, client);
is_delegatable =
- e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED) &&
- (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY) ||
- (!user_org && !is_delegated (icalcomp, user_email)));
+ e_client_check_capability (
+ E_CLIENT (client),
+ CAL_STATIC_CAPABILITY_DELEGATE_SUPPORTED) &&
+ (e_client_check_capability (
+ E_CLIENT (client),
+ CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY) ||
+ (!user_org && !is_delegated (icalcomp, user_email)));
g_free (user_email);
g_object_unref (comp);
diff --git a/modules/calendar/e-memo-shell-backend.c b/modules/calendar/e-memo-shell-backend.c
index 2be78895f6..6f8070094e 100644
--- a/modules/calendar/e-memo-shell-backend.c
+++ b/modules/calendar/e-memo-shell-backend.c
@@ -84,11 +84,15 @@ memo_shell_backend_ensure_sources (EShellBackend *shell_backend)
shell = e_shell_backend_get_shell (shell_backend);
shell_settings = e_shell_get_shell_settings (shell);
- if (!e_cal_client_get_sources (
+ e_cal_client_get_sources (
&memo_shell_backend->priv->source_list,
- E_CAL_CLIENT_SOURCE_TYPE_MEMOS, &error)) {
- g_debug ("%s: Could not get memo sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ E_CAL_CLIENT_SOURCE_TYPE_MEMOS, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get memo sources: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -172,13 +176,16 @@ memo_shell_backend_new_memo (ESource *source,
CompEditor *editor;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
/* XXX Handle errors better. */
- if (!client) {
- g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
return;
}
@@ -197,19 +204,24 @@ memo_shell_backend_new_memo (ESource *source,
}
static void
-memo_shell_backend_memo_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+memo_shell_backend_memo_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
flags |= COMP_EDITOR_NEW_ITEM;
- memo_shell_backend_new_memo (E_SOURCE (source_object), result, shell, flags);
+ memo_shell_backend_new_memo (
+ E_SOURCE (source_object), result, shell, flags);
g_object_unref (shell);
}
static void
-memo_shell_backend_memo_shared_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+memo_shell_backend_memo_shared_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
@@ -217,7 +229,8 @@ memo_shell_backend_memo_shared_new_cb (GObject *source_object, GAsyncResult *res
flags |= COMP_EDITOR_IS_SHARED;
flags |= COMP_EDITOR_USER_ORG;
- memo_shell_backend_new_memo (E_SOURCE (source_object), result, shell, flags);
+ memo_shell_backend_new_memo (
+ E_SOURCE (source_object), result, shell, flags);
g_object_unref (shell);
}
@@ -379,8 +392,12 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
* we successfully open it is another matter... */
handled = TRUE;
- if (!e_cal_client_get_sources (&source_list, source_type, &error)) {
- g_debug ("%s: Could not get memo sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ e_cal_client_get_sources (&source_list, source_type, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get memo sources: %s",
+ G_STRFUNC, error->message);
g_clear_error (&error);
goto exit;
}
@@ -393,13 +410,20 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
}
client = e_cal_client_new (source, source_type, &error);
- if (client)
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
- if (client == NULL || !e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error)) {
- g_debug ("%s: Failed to create/open client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ if (client != NULL) {
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
+ }
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to create/open client: %s",
+ G_STRFUNC, error->message);
g_object_unref (source_list);
+ g_error_free (error);
goto exit;
}
@@ -411,16 +435,21 @@ memo_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
if (editor != NULL)
goto present;
- if (!e_cal_client_get_object_sync (client, comp_uid, comp_rid, &icalcomp, NULL, &error)) {
- g_debug ("%s: Failed to get object: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ e_cal_client_get_object_sync (
+ client, comp_uid, comp_rid, &icalcomp, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to get object: %s",
+ G_STRFUNC, error->message);
g_object_unref (source_list);
- g_clear_error (&error);
+ g_error_free (error);
goto exit;
}
comp = e_cal_component_new ();
if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_debug ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
+ g_warning ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
icalcomponent_free (icalcomp);
icalcomp = NULL;
}
diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c
index cf38c219b5..df9ea9a59a 100644
--- a/modules/calendar/e-memo-shell-sidebar.c
+++ b/modules/calendar/e-memo-shell-sidebar.c
@@ -160,7 +160,9 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar,
}
static void
-memo_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+memo_shell_sidebar_retrieve_capabilies_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
EMemoShellSidebar *memo_shell_sidebar = user_data;
@@ -169,10 +171,12 @@ memo_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult
g_return_if_fail (client != NULL);
g_return_if_fail (memo_shell_sidebar != NULL);
- e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ e_client_retrieve_capabilities_finish (
+ E_CLIENT (client), result, &capabilities, NULL);
g_free (capabilities);
- memo_shell_sidebar_emit_status_message (memo_shell_sidebar, _("Loading memos"));
+ memo_shell_sidebar_emit_status_message (
+ memo_shell_sidebar, _("Loading memos"));
memo_shell_sidebar_emit_client_added (memo_shell_sidebar, client);
memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL);
}
@@ -200,15 +204,20 @@ free_retry_open_data (gpointer data)
}
static void
-memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+memo_shell_sidebar_client_opened_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
EMemoShellSidebar *memo_shell_sidebar = user_data;
+ ESource *source;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GError *error = NULL;
+ source = e_client_get_source (E_CLIENT (client));
+
e_client_open_finish (E_CLIENT (client), result, &error);
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
@@ -222,7 +231,10 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
e_client_utils_forget_password (E_CLIENT (client));
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
- e_client_open (E_CLIENT (client), FALSE, memo_shell_sidebar->priv->loading_clients, memo_shell_sidebar_client_opened_cb, user_data);
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ memo_shell_sidebar->priv->loading_clients,
+ memo_shell_sidebar_client_opened_cb, user_data);
g_clear_error (&error);
return;
}
@@ -236,7 +248,10 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
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_timeout_add_full (
+ G_PRIORITY_DEFAULT, 500,
+ memo_shell_sidebar_retry_open_timeout_cb,
+ rod, free_retry_open_data);
g_clear_error (&error);
return;
@@ -252,7 +267,10 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
break;
case E_CLIENT_ERROR_BUSY:
- g_debug ("%s: Cannot open '%s', it's busy (%s)", G_STRFUNC, e_source_peek_name (e_client_get_source (E_CLIENT (client))), error->message);
+ g_warning (
+ "%s: Cannot open '%s', it's busy (%s)",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_clear_error (&error);
return;
@@ -281,7 +299,10 @@ memo_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
g_clear_error (&error);
/* to have them ready for later use */
- e_client_retrieve_capabilities (E_CLIENT (client), NULL, memo_shell_sidebar_retrieve_capabilies_cb, memo_shell_sidebar);
+ e_client_retrieve_capabilities (
+ E_CLIENT (client), NULL,
+ memo_shell_sidebar_retrieve_capabilies_cb,
+ memo_shell_sidebar);
}
static gboolean
@@ -297,14 +318,21 @@ memo_shell_sidebar_retry_open_timeout_cb (gpointer user_data)
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);
+ 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, gpointer user_data)
+memo_shell_sidebar_default_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EShellSidebar *shell_sidebar = user_data;
EMemoShellSidebarPrivate *priv;
EShellContent *shell_content;
@@ -316,21 +344,22 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
priv = E_MEMO_SHELL_SIDEBAR (shell_sidebar)->priv;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
+ model = e_memo_shell_content_get_memo_model (memo_shell_content);
+
+ e_client_utils_open_new_finish (source, result, &client, &error);
+ /* Ignore cancellations. */
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warn_if_fail (client == NULL);
g_error_free (error);
goto exit;
- }
-
- shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- shell_content = e_shell_view_get_shell_content (shell_view);
- memo_shell_content = E_MEMO_SHELL_CONTENT (shell_content);
- model = e_memo_shell_content_get_memo_model (memo_shell_content);
- if (error != NULL) {
+ } else if (error != NULL) {
+ g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-memos",
@@ -346,7 +375,8 @@ memo_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
priv->default_client = E_CAL_CLIENT (client);
- e_cal_client_set_default_timezone (priv->default_client, e_cal_model_get_timezone (model));
+ e_cal_client_set_default_timezone (
+ priv->default_client, e_cal_model_get_timezone (model));
g_object_notify (G_OBJECT (shell_sidebar), "default-client");
@@ -395,9 +425,13 @@ memo_shell_sidebar_set_default (EMemoShellSidebar *memo_shell_sidebar,
priv->loading_default_client = g_cancellable_new ();
- e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_MEMOS, FALSE, priv->loading_default_client,
- e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
- memo_shell_sidebar_default_loaded_cb, g_object_ref (shell_sidebar));
+ e_client_utils_open_new (
+ source, E_CLIENT_SOURCE_TYPE_MEMOS,
+ FALSE, priv->loading_default_client,
+ e_client_utils_authenticate_handler,
+ GTK_WINDOW (shell_window),
+ memo_shell_sidebar_default_loaded_cb,
+ g_object_ref (shell_sidebar));
}
static void
@@ -950,7 +984,9 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
if (client == NULL) {
client = e_cal_client_new (source, source_type, NULL);
if (client)
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
}
g_return_if_fail (client != NULL);
@@ -985,7 +1021,11 @@ e_memo_shell_sidebar_add_source (EMemoShellSidebar *memo_shell_sidebar,
timezone = e_cal_model_get_timezone (model);
e_cal_client_set_default_timezone (client, timezone);
- e_client_open (E_CLIENT (client), FALSE, memo_shell_sidebar->priv->loading_clients, memo_shell_sidebar_client_opened_cb, memo_shell_sidebar);
+
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ memo_shell_sidebar->priv->loading_clients,
+ memo_shell_sidebar_client_opened_cb, memo_shell_sidebar);
}
void
diff --git a/modules/calendar/e-memo-shell-view-actions.c b/modules/calendar/e-memo-shell-view-actions.c
index 75d957c684..eacb5c1da7 100644
--- a/modules/calendar/e-memo-shell-view-actions.c
+++ b/modules/calendar/e-memo-shell-view-actions.c
@@ -170,14 +170,19 @@ action_memo_list_delete_cb (GtkAction *action,
uri = e_source_get_uri (source);
client = e_cal_model_get_client_for_uri (model, uri);
if (client == NULL)
- client = e_cal_client_new_from_uri (uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
+ client = e_cal_client_new_from_uri (
+ uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
g_free (uri);
g_return_if_fail (client != NULL);
- if (!e_client_remove_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to remove client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_remove_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to remove client: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -190,9 +195,13 @@ action_memo_list_delete_cb (GtkAction *action,
source_group = e_source_peek_group (source);
e_source_group_remove_source (source_group, source);
- if (!e_source_list_sync (source_list, &error)) {
- g_debug ("%s: Failed to sync source list: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_source_list_sync (source_list, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to sync source list: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
}
}
@@ -290,9 +299,14 @@ action_memo_list_refresh_cb (GtkAction *action,
g_return_if_fail (e_client_check_refresh_supported (E_CLIENT (client)));
- if (!e_client_refresh_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to refresh '%s', %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_refresh_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to refresh '%s', %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
}
}
diff --git a/modules/calendar/e-task-shell-backend.c b/modules/calendar/e-task-shell-backend.c
index ebee92479b..bb296fd5c2 100644
--- a/modules/calendar/e-task-shell-backend.c
+++ b/modules/calendar/e-task-shell-backend.c
@@ -84,11 +84,15 @@ task_shell_backend_ensure_sources (EShellBackend *shell_backend)
shell = e_shell_backend_get_shell (shell_backend);
shell_settings = e_shell_get_shell_settings (shell);
- if (!e_cal_client_get_sources (
+ e_cal_client_get_sources (
&task_shell_backend->priv->source_list,
- E_CAL_CLIENT_SOURCE_TYPE_TASKS, &error)) {
- g_debug ("%s: Could not get task sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ E_CAL_CLIENT_SOURCE_TYPE_TASKS, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get task sources: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -172,13 +176,16 @@ task_shell_backend_new_task (ESource *source,
CompEditor *editor;
GError *error = NULL;
- if (!e_client_utils_open_new_finish (source, result, &client, &error))
- client = NULL;
+ e_client_utils_open_new_finish (source, result, &client, &error);
/* XXX Handle errors better. */
- if (!client) {
- g_debug ("%s: Failed to open '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ if (error != NULL) {
+ g_warn_if_fail (client == NULL);
+ g_warning (
+ "%s: Failed to open '%s': %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
return;
}
@@ -196,19 +203,24 @@ task_shell_backend_new_task (ESource *source,
}
static void
-task_shell_backend_task_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+task_shell_backend_task_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
flags |= COMP_EDITOR_NEW_ITEM;
- task_shell_backend_new_task (E_SOURCE (source_object), result, shell, flags);
+ task_shell_backend_new_task (
+ E_SOURCE (source_object), result, shell, flags);
g_object_unref (shell);
}
static void
-task_shell_backend_task_assigned_new_cb (GObject *source_object, GAsyncResult *result, gpointer shell)
+task_shell_backend_task_assigned_new_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer shell)
{
CompEditorFlags flags = 0;
@@ -216,7 +228,8 @@ task_shell_backend_task_assigned_new_cb (GObject *source_object, GAsyncResult *r
flags |= COMP_EDITOR_IS_ASSIGNED;
flags |= COMP_EDITOR_USER_ORG;
- task_shell_backend_new_task (E_SOURCE (source_object), result, shell, flags);
+ task_shell_backend_new_task (
+ E_SOURCE (source_object), result, shell, flags);
g_object_unref (shell);
}
@@ -379,9 +392,13 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
* we successfully open it is another matter... */
handled = TRUE;
- if (!e_cal_client_get_sources (&source_list, source_type, &error)) {
- g_debug ("%s: Could not get task sources: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_cal_client_get_sources (&source_list, source_type, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Could not get task sources: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
goto exit;
}
@@ -393,13 +410,20 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
}
client = e_cal_client_new (source, source_type, &error);
- if (client)
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
- if (client == NULL || !e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error)) {
- g_debug ("%s: Failed to create/open client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ if (client != NULL) {
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ e_client_open_sync (E_CLIENT (client), TRUE, NULL, &error);
+ }
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to create/open client: %s",
+ G_STRFUNC, error->message);
g_object_unref (source_list);
+ g_error_free (error);
goto exit;
}
@@ -411,8 +435,13 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
if (editor != NULL)
goto present;
- if (!e_cal_client_get_object_sync (client, comp_uid, comp_rid, &icalcomp, NULL, &error)) {
- g_debug ("%s: Failed to get object: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ e_cal_client_get_object_sync (
+ client, comp_uid, comp_rid, &icalcomp, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to get object: %s",
+ G_STRFUNC, error->message);
g_object_unref (source_list);
g_error_free (error);
goto exit;
@@ -420,7 +449,7 @@ task_shell_backend_handle_uri_cb (EShellBackend *shell_backend,
comp = e_cal_component_new ();
if (!e_cal_component_set_icalcomponent (comp, icalcomp)) {
- g_debug ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
+ g_warning ("%s: Failed to set icalcomp to comp\n", G_STRFUNC);
icalcomponent_free (icalcomp);
icalcomp = NULL;
}
diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c
index 3e693afd7e..7987071eb8 100644
--- a/modules/calendar/e-task-shell-sidebar.c
+++ b/modules/calendar/e-task-shell-sidebar.c
@@ -160,7 +160,9 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar,
}
static void
-task_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+task_shell_sidebar_retrieve_capabilies_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ETaskShellSidebar *task_shell_sidebar = user_data;
@@ -169,10 +171,12 @@ task_shell_sidebar_retrieve_capabilies_cb (GObject *source_object, GAsyncResult
g_return_if_fail (client != NULL);
g_return_if_fail (task_shell_sidebar != NULL);
- e_client_retrieve_capabilities_finish (E_CLIENT (client), result, &capabilities, NULL);
+ e_client_retrieve_capabilities_finish (
+ E_CLIENT (client), result, &capabilities, NULL);
g_free (capabilities);
- task_shell_sidebar_emit_status_message (task_shell_sidebar, _("Loading tasks"));
+ task_shell_sidebar_emit_status_message (
+ task_shell_sidebar, _("Loading tasks"));
task_shell_sidebar_emit_client_added (task_shell_sidebar, client);
task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL);
}
@@ -200,15 +204,20 @@ free_retry_open_data (gpointer data)
}
static void
-task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *result, gpointer user_data)
+task_shell_sidebar_client_opened_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
ECalClient *client = E_CAL_CLIENT (source_object);
ETaskShellSidebar *task_shell_sidebar = user_data;
+ ESource *source;
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
GError *error = NULL;
+ source = e_client_get_source (E_CLIENT (client));
+
e_client_open_finish (E_CLIENT (client), result, &error);
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
@@ -222,7 +231,10 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
e_client_utils_forget_password (E_CLIENT (client));
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_AUTHENTICATION_FAILED)) {
- e_client_open (E_CLIENT (client), FALSE, task_shell_sidebar->priv->loading_clients, task_shell_sidebar_client_opened_cb, user_data);
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ task_shell_sidebar->priv->loading_clients,
+ task_shell_sidebar_client_opened_cb, user_data);
g_clear_error (&error);
return;
}
@@ -236,7 +248,10 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
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_timeout_add_full (
+ G_PRIORITY_DEFAULT, 500,
+ task_shell_sidebar_retry_open_timeout_cb,
+ rod, free_retry_open_data);
g_clear_error (&error);
return;
@@ -252,7 +267,10 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
break;
case E_CLIENT_ERROR_BUSY:
- g_debug ("%s: Cannot open '%s', it's busy (%s)", G_STRFUNC, e_source_peek_name (e_client_get_source (E_CLIENT (client))), error->message);
+ g_warning (
+ "%s: Cannot open '%s', it's busy (%s)",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
g_clear_error (&error);
return;
@@ -281,7 +299,10 @@ task_shell_sidebar_client_opened_cb (GObject *source_object, GAsyncResult *resul
g_clear_error (&error);
/* to have them ready for later use */
- e_client_retrieve_capabilities (E_CLIENT (client), NULL, task_shell_sidebar_retrieve_capabilies_cb, task_shell_sidebar);
+ e_client_retrieve_capabilities (
+ E_CLIENT (client), NULL,
+ task_shell_sidebar_retrieve_capabilies_cb,
+ task_shell_sidebar);
}
static gboolean
@@ -297,14 +318,21 @@ task_shell_sidebar_retry_open_timeout_cb (gpointer user_data)
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);
+ 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, gpointer user_data)
+task_shell_sidebar_default_loaded_cb (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
+ ESource *source = E_SOURCE (source_object);
EShellSidebar *shell_sidebar = user_data;
ETaskShellSidebarPrivate *priv;
EShellContent *shell_content;
@@ -316,21 +344,22 @@ task_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
priv = E_TASK_SHELL_SIDEBAR (shell_sidebar)->priv;
- if (!e_client_utils_open_new_finish (E_SOURCE (source_object), result, &client, &error))
- client = NULL;
+ shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
+ shell_content = e_shell_view_get_shell_content (shell_view);
+ task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
+ model = e_task_shell_content_get_task_model (task_shell_content);
+
+ e_client_utils_open_new_finish (source, result, &client, &error);
+ /* Ignore cancellations. */
if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) ||
g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) {
+ g_warn_if_fail (client == NULL);
g_error_free (error);
goto exit;
- }
-
- shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
- shell_content = e_shell_view_get_shell_content (shell_view);
- task_shell_content = E_TASK_SHELL_CONTENT (shell_content);
- model = e_task_shell_content_get_task_model (task_shell_content);
- if (error != NULL) {
+ } else if (error != NULL) {
+ g_warn_if_fail (client == NULL);
e_alert_submit (
E_ALERT_SINK (shell_content),
"calendar:failed-open-tasks",
@@ -346,7 +375,8 @@ task_shell_sidebar_default_loaded_cb (GObject *source_object, GAsyncResult *resu
priv->default_client = E_CAL_CLIENT (client);
- e_cal_client_set_default_timezone (priv->default_client, e_cal_model_get_timezone (model));
+ e_cal_client_set_default_timezone (
+ priv->default_client, e_cal_model_get_timezone (model));
g_object_notify (G_OBJECT (shell_sidebar), "default-client");
@@ -395,9 +425,13 @@ task_shell_sidebar_set_default (ETaskShellSidebar *task_shell_sidebar,
priv->loading_default_client = g_cancellable_new ();
- e_client_utils_open_new (source, E_CLIENT_SOURCE_TYPE_TASKS, FALSE, priv->loading_default_client,
- e_client_utils_authenticate_handler, GTK_WINDOW (shell_window),
- task_shell_sidebar_default_loaded_cb, g_object_ref (shell_sidebar));
+ e_client_utils_open_new (
+ source, E_CLIENT_SOURCE_TYPE_TASKS,
+ FALSE, priv->loading_default_client,
+ e_client_utils_authenticate_handler,
+ GTK_WINDOW (shell_window),
+ task_shell_sidebar_default_loaded_cb,
+ g_object_ref (shell_sidebar));
}
static void
@@ -696,13 +730,14 @@ task_shell_sidebar_check_state (EShellSidebar *shell_sidebar)
can_delete = !is_system;
delete_prop = e_source_get_property (source, "delete");
- can_delete = can_delete && (delete_prop == NULL || strcmp (delete_prop, "no") != 0);
+ can_delete = can_delete &&
+ (delete_prop == NULL || strcmp (delete_prop, "no") != 0);
client = g_hash_table_lookup (
task_shell_sidebar->priv->client_table,
e_source_peek_uid (source));
- refresh_supported =
- client && e_client_check_refresh_supported (E_CLIENT (client));
+ refresh_supported = client &&
+ e_client_check_refresh_supported (E_CLIENT (client));
}
if (source != NULL)
@@ -950,7 +985,9 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
if (client == NULL) {
client = e_cal_client_new (source, source_type, NULL);
if (client)
- g_signal_connect (client, "authenticate", G_CALLBACK (e_client_utils_authenticate_handler), NULL);
+ g_signal_connect (
+ client, "authenticate",
+ G_CALLBACK (e_client_utils_authenticate_handler), NULL);
}
g_return_if_fail (client != NULL);
@@ -985,7 +1022,11 @@ e_task_shell_sidebar_add_source (ETaskShellSidebar *task_shell_sidebar,
timezone = e_cal_model_get_timezone (model);
e_cal_client_set_default_timezone (client, timezone);
- e_client_open (E_CLIENT (client), FALSE, task_shell_sidebar->priv->loading_clients, task_shell_sidebar_client_opened_cb, task_shell_sidebar);
+
+ e_client_open (
+ E_CLIENT (client), FALSE,
+ task_shell_sidebar->priv->loading_clients,
+ task_shell_sidebar_client_opened_cb, task_shell_sidebar);
}
void
diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c
index 4938452309..1fb4867205 100644
--- a/modules/calendar/e-task-shell-view-actions.c
+++ b/modules/calendar/e-task-shell-view-actions.c
@@ -193,14 +193,19 @@ action_task_list_delete_cb (GtkAction *action,
uri = e_source_get_uri (source);
client = e_cal_model_get_client_for_uri (model, uri);
if (client == NULL)
- client = e_cal_client_new_from_uri (uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
+ client = e_cal_client_new_from_uri (
+ uri, E_CAL_CLIENT_SOURCE_TYPE_MEMOS, NULL);
g_free (uri);
g_return_if_fail (client != NULL);
- if (!e_client_remove_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to remove client: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_remove_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to remove client: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
return;
}
@@ -213,9 +218,13 @@ action_task_list_delete_cb (GtkAction *action,
source_group = e_source_peek_group (source);
e_source_group_remove_source (source_group, source);
- if (!e_source_list_sync (source_list, &error)) {
- g_debug ("%s: Failed to sync srouce list: %s", G_STRFUNC, error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_source_list_sync (source_list, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to sync srouce list: %s",
+ G_STRFUNC, error->message);
+ g_error_free (error);
}
}
@@ -313,9 +322,14 @@ action_task_list_refresh_cb (GtkAction *action,
g_return_if_fail (e_client_check_refresh_supported (E_CLIENT (client)));
- if (!e_client_refresh_sync (E_CLIENT (client), NULL, &error)) {
- g_debug ("%s: Failed to refresh '%s', %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_client_refresh_sync (E_CLIENT (client), NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to refresh '%s', %s",
+ G_STRFUNC, e_source_peek_name (source),
+ error->message);
+ g_error_free (error);
}
}
diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c
index 77e4beae1e..b8122786f2 100644
--- a/modules/calendar/e-task-shell-view-private.c
+++ b/modules/calendar/e-task-shell-view-private.c
@@ -479,8 +479,13 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view)
if (e_client_is_readonly (E_CLIENT (client)))
continue;
- if (!e_cal_client_get_object_list_sync (client, sexp, &objects, NULL, &error)) {
- g_debug ("%s: Failed to get object list: %s", G_STRFUNC, error ? error->message : "Unknown error");
+ e_cal_client_get_object_list_sync (
+ client, sexp, &objects, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to get object list: %s",
+ G_STRFUNC, error->message);
g_clear_error (&error);
continue;
}
@@ -490,8 +495,15 @@ e_task_shell_view_delete_completed (ETaskShellView *task_shell_view)
const gchar *uid;
uid = icalcomponent_get_uid (component);
- if (!e_cal_client_remove_object_sync (client, uid, NULL, CALOBJ_MOD_THIS, NULL, &error)) {
- g_debug ("%s: Failed to remove object: %s", G_STRFUNC, error ? error->message : "Unknown error");
+
+ e_cal_client_remove_object_sync (
+ client, uid, NULL,
+ CALOBJ_MOD_THIS, NULL, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "%s: Failed to remove object: %s",
+ G_STRFUNC, error->message);
g_clear_error (&error);
}
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index 9a89cae1ee..b43f1fbe35 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -386,6 +386,8 @@ em_account_prefs_new (EPreferencesWindow *window)
EShell *shell;
EShellBackend *shell_backend;
EAccountList *account_list;
+ EMailSession *session;
+ const gchar *data_dir;
account_list = e_get_account_list ();
g_return_val_if_fail (E_IS_ACCOUNT_LIST (account_list), NULL);
@@ -394,8 +396,11 @@ em_account_prefs_new (EPreferencesWindow *window)
shell = e_preferences_window_get_shell (window);
shell_backend = e_shell_get_backend_by_name (shell, "mail");
- /* make sure the e-mail-local is initialized */
- e_mail_local_init (e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)), e_shell_backend_get_data_dir (shell_backend));
+ session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend));
+ data_dir = e_shell_backend_get_data_dir (shell_backend);
+
+ /* Make sure the e-mail-local is initialized. */
+ e_mail_local_init (session, data_dir);
return g_object_new (
EM_TYPE_ACCOUNT_PREFS,
diff --git a/modules/online-accounts/camel-sasl-xoauth.c b/modules/online-accounts/camel-sasl-xoauth.c
index 9ce391214d..14ecb29bc4 100644
--- a/modules/online-accounts/camel-sasl-xoauth.c
+++ b/modules/online-accounts/camel-sasl-xoauth.c
@@ -73,7 +73,7 @@ hmac_sha1 (const gchar *key,
guchar inner[SHA1_LENGTH];
guchar digest[SHA1_LENGTH];
gsize key_length, inner_length, digest_length;
- int i;
+ gint i;
g_return_val_if_fail (key, NULL);
g_return_val_if_fail (message, NULL);
@@ -86,7 +86,7 @@ hmac_sha1 (const gchar *key,
key_length = sizeof (new_key);
- g_checksum_update (checksum, (guchar*)key, strlen (key));
+ g_checksum_update (checksum, (guchar *) key, strlen (key));
g_checksum_get_digest (checksum, new_key, &key_length);
g_checksum_reset (checksum);
@@ -117,7 +117,7 @@ hmac_sha1 (const gchar *key,
/* Stage 3 and 4 */
g_checksum_update (checksum, ipad, sizeof (ipad));
- g_checksum_update (checksum, (guchar*)message, strlen (message));
+ g_checksum_update (checksum, (guchar *) message, strlen (message));
inner_length = sizeof (inner);
g_checksum_get_digest (checksum, inner, &inner_length);
g_checksum_reset (checksum);
@@ -135,7 +135,7 @@ hmac_sha1 (const gchar *key,
return g_base64_encode (digest, digest_length);
}
-static char *
+static gchar *
sign_plaintext (const gchar *consumer_secret,
const gchar *token_secret)
{
@@ -153,7 +153,7 @@ sign_plaintext (const gchar *consumer_secret,
return rv;
}
-static char *
+static gchar *
sign_hmac (const gchar *consumer_secret,
const gchar *token_secret,
const gchar *http_method,