aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-tools.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@src.gnome.org>2000-08-23 04:09:11 +0800
committerPeter Williams <peterw@src.gnome.org>2000-08-23 04:09:11 +0800
commit130bb0e5710983ce14d1151f2611beaff6891379 (patch)
treeb54b0a4141379ea553cdad8b7ac6d80a5fba2acb /mail/mail-tools.c
parentdcc47cc15f6ff1e1cb866495625006e5481f85a6 (diff)
downloadgsoc2013-evolution-130bb0e5710983ce14d1151f2611beaff6891379.tar.gz
gsoc2013-evolution-130bb0e5710983ce14d1151f2611beaff6891379.tar.zst
gsoc2013-evolution-130bb0e5710983ce14d1151f2611beaff6891379.zip
Automatically connect services when given a valid URL (should hopefully disconnect, too); remove the old movemail folder correctly.
svn path=/trunk/; revision=4965
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r--mail/mail-tools.c64
1 files changed, 28 insertions, 36 deletions
diff --git a/mail/mail-tools.c b/mail/mail-tools.c
index 2d10411f91..97bc4259af 100644
--- a/mail/mail-tools.c
+++ b/mail/mail-tools.c
@@ -101,12 +101,13 @@ mail_tool_get_folder_from_urlname (const gchar *url, const gchar *name,
return NULL;
}
- camel_service_connect (CAMEL_SERVICE (store), ex);
- if (camel_exception_is_set (ex)) {
- camel_object_unref (CAMEL_OBJECT (store));
- mail_tool_camel_lock_down();
- return NULL;
- }
+ /*camel_service_connect (CAMEL_SERVICE (store), ex);
+ *if (camel_exception_is_set (ex)) {
+ * camel_object_unref (CAMEL_OBJECT (store));
+ * mail_tool_camel_lock_down();
+ * return NULL;
+ *}
+ */
folder = camel_store_get_folder (store, name, create, ex);
camel_object_unref (CAMEL_OBJECT (store));
@@ -392,14 +393,16 @@ mail_tool_send_via_transport (CamelTransport *transport, CamelMedium *medium, Ca
{
mail_tool_camel_lock_up();
- camel_service_connect (CAMEL_SERVICE (transport), ex);
+ /*camel_service_connect (CAMEL_SERVICE (transport), ex);*/
+
if (camel_exception_is_set (ex))
goto cleanup;
camel_transport_send (transport, medium, ex);
- camel_service_disconnect (CAMEL_SERVICE (transport),
- camel_exception_is_set (ex) ? NULL : ex);
+ /*camel_service_disconnect (CAMEL_SERVICE (transport),
+ *camel_exception_is_set (ex) ? NULL : ex);*/
+
cleanup:
mail_tool_camel_lock_down();
}
@@ -503,6 +506,7 @@ mail_tool_filter_contents_into (CamelFolder *source, CamelFolder *dest,
gchar *systemrules;
FilterContext *fc;
FilterDriver *filter;
+ gchar *unlink;
userrules = g_strdup_printf ("%s/filters.xml", evolution_dir);
systemrules = g_strdup_printf ("%s/evolution/filtertypes.xml", EVOLUTION_DATADIR);
@@ -517,29 +521,16 @@ mail_tool_filter_contents_into (CamelFolder *source, CamelFolder *dest,
camel_object_hook_event (CAMEL_OBJECT (dest), "folder_changed",
hook_func, hook_data);
- filter_driver_run (filter, source, dest, FILTER_SOURCE_INCOMING,
- TRUE, hook_func, hook_data);
-
- camel_folder_sync (CAMEL_FOLDER (source), TRUE, ex);
- camel_folder_sync (CAMEL_FOLDER (dest), TRUE, ex);
-
- if (delete_source) {
- gchar *path = mail_tool_get_local_movemail_path();
- struct stat sb;
-
- if (stat (path, &sb) < 0) {
- camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Couldn't stat(2) movemail folder %s"),
- path);
- g_free (path);
- return;
- }
+ if (delete_source)
+ unlink = mail_tool_get_local_movemail_path();
+ else
+ unlink = NULL;
- if (sb.st_size == 0)
- unlink (path);
+ filter_driver_run (filter, source, dest, FILTER_SOURCE_INCOMING,
+ TRUE, hook_func, hook_data, unlink);
- g_free (path);
- }
+ if (unlink)
+ g_free (unlink);
}
CamelFolder *
@@ -556,12 +547,13 @@ mail_tool_get_root_of_store (const char *source_uri, CamelException *ex)
return NULL;
}
- camel_service_connect (CAMEL_SERVICE (store), ex);
- if (camel_exception_is_set (ex)) {
- camel_object_unref (CAMEL_OBJECT (store));
- mail_tool_camel_lock_down();
- return NULL;
- }
+ /*camel_service_connect (CAMEL_SERVICE (store), ex);
+ *if (camel_exception_is_set (ex)) {
+ * camel_object_unref (CAMEL_OBJECT (store));
+ * mail_tool_camel_lock_down();
+ * return NULL;
+ *}
+ */
folder = camel_store_get_root_folder (store, ex);
camel_object_unref (CAMEL_OBJECT (store));