From 22e539d53689ac5a9efce0cc360987923d54d6ba Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 25 Jan 2002 19:32:27 +0000 Subject: Save the pathname. (save_part): Use the new mail_config cruft to get the 2002-01-25 Jeffrey Stedfast * mail-display.c (save_data_cb): Save the pathname. (save_part): Use the new mail_config cruft to get the last used save pathname. * mail-config.c (config_read): Read in last_filesel_dir string. (mail_config_write_on_exit): Save the last_filesel_dir setting. (mail_config_get_last_filesel_dir): New (mail_config_set_last_filesel_dir): New svn path=/trunk/; revision=15474 --- mail/mail-config.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index d1e322bb0b..d56e42cbae 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -109,6 +109,8 @@ typedef struct { MailConfigNewMailNotify notify; char *notify_filename; + + char *last_filesel_dir; } MailConfig; static MailConfig *config = NULL; @@ -307,6 +309,21 @@ mail_config_clear (void) g_slist_free (config->news); config->news = NULL; } + + g_free (config->pgp_path); + config->pgp_path = NULL; + + g_free (config->default_charset); + config->default_charset = NULL; + + g_free (config->filter_log_path); + config->filter_log_path = NULL; + + g_free (config->notify_filename); + config->notify_filename = NULL; + + g_free (config->last_filesel_dir); + config->last_filesel_dir = NULL; } static void @@ -652,6 +669,10 @@ config_read (void) config->notify_filename = bonobo_config_get_string ( config->db, "/Mail/Notify/new_mail_notification_sound_file", NULL); + + /* last filesel dir */ + config->last_filesel_dir = bonobo_config_get_string ( + config->db, "/Mail/Filesel/last_filesel_dir", NULL); } #define bonobo_config_set_string_wrapper(db, path, val, ev) bonobo_config_set_string (db, path, val ? val : "", ev) @@ -957,6 +978,10 @@ mail_config_write_on_exit (void) bonobo_config_set_string_wrapper (config->db, "/Mail/Notify/new_mail_notification_sound_file", config->notify_filename, NULL); + /* last filesel dir */ + bonobo_config_set_string_wrapper (config->db, "/Mail/Filesel/last_filesel_dir", + config->last_filesel_dir, NULL); + if (config->threaded_hash) g_hash_table_foreach_remove (config->threaded_hash, hash_save_state, "Threads"); @@ -1189,6 +1214,22 @@ mail_config_set_filter_log_path (const char *path) config->filter_log_path = g_strdup (path); } +const char * +mail_config_get_last_filesel_dir (void) +{ + if (config->last_filesel_dir) + return config->last_filesel_dir; + else + return g_get_home_dir (); +} + +void +mail_config_set_last_filesel_dir (const char *path) +{ + g_free (config->last_filesel_dir); + config->last_filesel_dir = g_strdup (path); +} + gboolean mail_config_get_hide_deleted (void) { -- cgit v1.2.3