aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r--e-util/e-util.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c
index d213296041..5d854e0d51 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -1187,4 +1187,45 @@ get_font_options ()
return font_options;
}
+/**
+ * e_file_update_save_path:
+ * @uri: URI to store
+ * @free: If TRUE, free uri
+ *
+ * Save the save_dir path for evolution. If free is TRUE, uri gets freed when
+ * done. Genearally, this should be called with the output of
+ * gtk_file_chooser_get_current_folder_uri() The URI must be a path URI, not a
+ * file URI.
+ **/
+void
+e_file_update_save_path(char *uri, gboolean free)
+{
+ GConfClient *gconf = gconf_client_get_default();
+
+ gconf_client_set_string(gconf, "/apps/evolution/mail/save_dir", uri, NULL);
+ g_object_unref(gconf);
+ if (free)
+ g_free(uri);
+}
+
+/**
+ * e_file_get_save_path:
+ *
+ * Return the save_dir path for evolution. If there isn't a save_dir, returns
+ * the users home directory. Returns an allocated URI that should be freed by
+ * the caller.
+ **/
+char *
+e_file_get_save_path(void)
+{
+ GConfClient *gconf = gconf_client_get_default();
+ char *uri;
+
+ uri = gconf_client_get_string(gconf, "/apps/evolution/mail/save_dir", NULL);
+ g_object_unref(gconf);
+
+ if (uri == NULL)
+ uri = gnome_vfs_get_uri_from_local_path(g_get_home_dir());
+ return (uri);
+}