diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-07-05 05:40:28 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-07-09 02:37:52 +0800 |
commit | 137b0743ddfbd3bbc01c9813615ede91ddd9b954 (patch) | |
tree | 1d8e09ba0239eff419d432bdd8d5b521fbb727ba /plugins/pst-import | |
parent | 36f1f29b9a42c56a619e031b045db5a18f2b1dd7 (diff) | |
download | gsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.tar.gz gsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.tar.zst gsoc2013-evolution-137b0743ddfbd3bbc01c9813615ede91ddd9b954.zip |
Migrate from CamelException to GError.
Diffstat (limited to 'plugins/pst-import')
-rw-r--r-- | plugins/pst-import/pst-importer.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/plugins/pst-import/pst-importer.c b/plugins/pst-import/pst-importer.c index 84706b783e..13a4868fa9 100644 --- a/plugins/pst-import/pst-importer.c +++ b/plugins/pst-import/pst-importer.c @@ -116,7 +116,6 @@ struct _PstImporter { gint status_pc; gint status_timeout_id; CamelOperation *status; - CamelException ex; pst_file pst; @@ -453,7 +452,7 @@ pst_import_file (PstImporter *m) camel_operation_start (NULL, _("Importing '%s'"), filename); if (GPOINTER_TO_INT (g_datalist_get_data (&m->target->data, "pst-do-mail"))) { - mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.ex); + mail_tool_uri_to_folder (m->parent_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error); } ret = pst_init (&m->pst, filename); @@ -704,7 +703,7 @@ pst_create_folder (PstImporter *m) *pos = '\0'; - folder = mail_tool_uri_to_folder (dest, CAMEL_STORE_FOLDER_CREATE, &m->base.ex); + folder = mail_tool_uri_to_folder (dest, CAMEL_STORE_FOLDER_CREATE, &m->base.error); g_object_unref (folder); *pos = '/'; } @@ -716,7 +715,7 @@ pst_create_folder (PstImporter *m) g_object_unref (m->folder); } - m->folder = mail_tool_uri_to_folder (m->folder_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.ex); + m->folder = mail_tool_uri_to_folder (m->folder_uri, CAMEL_STORE_FOLDER_CREATE, &m->base.error); } @@ -769,6 +768,7 @@ pst_process_email (PstImporter *m, pst_item *item) CamelMimePart *part; CamelMessageInfo *info; pst_item_attach *attach; + gboolean success; if (m->folder == NULL) { pst_create_folder (m); @@ -822,7 +822,7 @@ pst_process_email (PstImporter *m, pst_item *item) /*g_message (" Email headers... %s...", item->email->header);*/ stream = camel_stream_mem_new_with_buffer (item->email->header.str, strlen (item->email->header.str)); - if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)msg, stream) == -1) + if (camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)msg, stream, NULL) == -1) g_warning ("Error reading headers, skipped"); } else { @@ -916,16 +916,16 @@ pst_process_email (PstImporter *m, pst_item *item) if (item->flags & 0x08) camel_message_info_set_flags (info, CAMEL_MESSAGE_DRAFT, ~0); - camel_folder_append_message (m->folder, msg, info, NULL, &m->ex); + success = camel_folder_append_message ( + m->folder, msg, info, NULL, NULL); camel_message_info_free (info); g_object_unref (msg); camel_folder_sync (m->folder, FALSE, NULL); camel_folder_thaw (m->folder); - if (camel_exception_is_set (&m->ex)) { + if (!success) { g_critical ("Exception!"); - camel_exception_clear (&m->ex); return; } @@ -1232,7 +1232,7 @@ set_cal_attachments (ECal *cal, ECalComponent *ec, PstImporter *m, pst_item_atta continue; } - if (!(stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0666))) { + if (!(stream = camel_stream_fs_new_with_name (path, O_WRONLY | O_CREAT | O_TRUNC, 0666, NULL))) { g_warning ("Could not create stream for file %s - %s", path, g_strerror (errno)); attach = attach->next; continue; @@ -1240,8 +1240,8 @@ set_cal_attachments (ECal *cal, ECalComponent *ec, PstImporter *m, pst_item_atta content = camel_medium_get_content (CAMEL_MEDIUM (part)); - if (camel_data_wrapper_decode_to_stream (content, stream) == -1 - || camel_stream_flush (stream) == -1) + if (camel_data_wrapper_decode_to_stream (content, stream, NULL) == -1 + || camel_stream_flush (stream, NULL) == -1) { g_warning ("Could not write attachment to %s: %s", path, g_strerror (errno)); g_object_unref (stream); |