From dafc74eeaf244b39d1fd0f8498d50d2535ca8bd9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 3 Jul 2001 01:45:41 +0000 Subject: Setup the Empty Trash On Exit widgets. 2001-07-02 Jeffrey Stedfast * mail-accounts.c (construct): Setup the Empty Trash On Exit widgets. * mail-config.c (config_read): Option to emtpy trash on exit. (mail_config_write_on_exit): Same. (mail_config_set_empty_trash_on_exit): Set the option. (mail_config_get_empty_trash_on_exit): Get the option. * component-factory.c (owner_unset_cb): Empty the trash folders if the user set the "empty trash on exit" option. svn path=/trunk/; revision=10711 --- mail/mail-config.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index c1b6f884f4..0a7fb4fbb5 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -61,6 +61,7 @@ typedef struct { gboolean prompt_empty_subject; gboolean prompt_only_bcc; gint seen_timeout; + gboolean empty_trash_on_exit; GSList *accounts; GSList *news; @@ -563,6 +564,14 @@ config_read (void) config->default_charset = g_strdup (config->default_charset); } + /* Trash folders */ + str = g_strdup_printf ("=%s/config/Mail=/Trash/empty_on_exit", + evolution_dir); + config->empty_trash_on_exit = gnome_config_get_bool_with_default (str, &def); + if (def) + config->empty_trash_on_exit = FALSE; + g_free (str); + gnome_config_sync (); } @@ -807,6 +816,11 @@ mail_config_write_on_exit (void) gnome_config_set_string (str, config->default_charset); g_free (str); + /* Trash folders */ + str = g_strdup_printf ("=%s/config/Mail=/Trash/empty_on_exit", evolution_dir); + gnome_config_set_bool (str, config->empty_trash_on_exit); + g_free (str); + /* Passwords */ gnome_config_private_clean_section ("/Evolution/Passwords"); sources = mail_config_get_sources (); @@ -846,6 +860,18 @@ mail_config_is_configured (void) return config->accounts != NULL; } +gboolean +mail_config_get_empty_trash_on_exit (void) +{ + return config->empty_trash_on_exit; +} + +void +mail_config_set_empty_trash_on_exit (gboolean value) +{ + config->empty_trash_on_exit = value; +} + gboolean mail_config_get_show_preview (const char *uri) { -- cgit v1.2.3