aboutsummaryrefslogtreecommitdiffstats
path: root/modules/calendar/e-cal-attachment-handler.c
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/calendar/e-cal-attachment-handler.c
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/calendar/e-cal-attachment-handler.c')
-rw-r--r--modules/calendar/e-cal-attachment-handler.c56
1 files changed, 41 insertions, 15 deletions
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;
}