aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine/mail-tools.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-13 02:16:04 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-13 02:16:04 +0800
commitcfc8ef4c6ca14603c9ea8dd8429e8297e9c51980 (patch)
tree1624757b388826972c4fc5a47a23e112a02ce203 /libemail-engine/mail-tools.c
parent6be2668e483cfc7a2e75ae2efcd9675388d08601 (diff)
downloadgsoc2013-evolution-cfc8ef4c6ca14603c9ea8dd8429e8297e9c51980.tar.gz
gsoc2013-evolution-cfc8ef4c6ca14603c9ea8dd8429e8297e9c51980.tar.zst
gsoc2013-evolution-cfc8ef4c6ca14603c9ea8dd8429e8297e9c51980.zip
Adapt to CamelService API changes.
camel_service_get_settings() is now camel_service_ref_settings() and it returns a new CamelSettings reference which the caller must release with g_object_unref().
Diffstat (limited to 'libemail-engine/mail-tools.c')
-rw-r--r--libemail-engine/mail-tools.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libemail-engine/mail-tools.c b/libemail-engine/mail-tools.c
index 82b2146b92..29955c73d4 100644
--- a/libemail-engine/mail-tools.c
+++ b/libemail-engine/mail-tools.c
@@ -91,7 +91,7 @@ mail_tool_do_movemail (CamelStore *store,
CamelService *service;
CamelProvider *provider;
CamelSettings *settings;
- const gchar *src_path;
+ gchar *src_path;
gchar *dest_path;
struct stat sb;
gboolean success;
@@ -100,7 +100,6 @@ mail_tool_do_movemail (CamelStore *store,
service = CAMEL_SERVICE (store);
provider = camel_service_get_provider (service);
- settings = camel_service_get_settings (service);
g_return_val_if_fail (provider != NULL, NULL);
@@ -114,9 +113,13 @@ mail_tool_do_movemail (CamelStore *store,
return NULL;
}
- src_path = camel_local_settings_get_path (
+ settings = camel_service_ref_settings (service);
+
+ src_path = camel_local_settings_dup_path (
CAMEL_LOCAL_SETTINGS (settings));
+ g_object_unref (settings);
+
/* Set up our destination. */
dest_path = mail_tool_get_local_movemail_path (store, error);
if (dest_path == NULL)
@@ -125,6 +128,8 @@ mail_tool_do_movemail (CamelStore *store,
/* Movemail from source to dest_path */
success = camel_movemail (src_path, dest_path, error) != -1;
+ g_free (src_path);
+
if (g_stat (dest_path, &sb) < 0 || sb.st_size == 0) {
g_unlink (dest_path); /* Clean up the movemail.foo file. */
g_free (dest_path);