aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2001-01-08 10:14:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-01-08 10:14:23 +0800
commit35139b298329ba21d3b645aa0891863bc7caaf68 (patch)
tree7ab9fed11b5efc991f6288c860a9bf908b0c963c /mail/mail-config.c
parenta223b88a9034f0c33f2e979403e1352ff822f8a2 (diff)
downloadgsoc2013-evolution-35139b298329ba21d3b645aa0891863bc7caaf68.tar.gz
gsoc2013-evolution-35139b298329ba21d3b645aa0891863bc7caaf68.tar.zst
gsoc2013-evolution-35139b298329ba21d3b645aa0891863bc7caaf68.zip
Updated to reflect changes to the mail-config API.
2001-01-07 Jeffrey Stedfast <fejj@helixcode.com> * mail-tools.c (mail_tool_quote_message): Updated to reflect changes to the mail-config API. * mail-display.c (redisplay): Updated to reflect changes to the mail-config API. * mail-callbacks.c (providers_config): Use the new account dialog. * mail-config-druid.c (druid_finish): Load the new storage into the shell. (mail_config_druid_new): Take a shell argument. * mail-format.c (mail_generate_reply): Updated to reflect changes to the mail-config API. * mail-config-druid.c: Fixed this to build. * mail-callbacks.c (check_send_configuration): Updated to reflect changes to the mail-config API. (create_msg_composer): Same. (forward_get_composer): Same. (send_queued_mail): Same. (composer_send_cb): Same. * mail-account-editor.c: Updated to build cleanly. * mail-config-druid.c: Same. * mail-accounts.c: Same. * folder-browser-factory.c (control_activate): Updated for API changes in mail-config. * folder-browser.c (done_message_selected): Updated for API changed in mail-config. (folder_browser_gui_init): Same. (got_folder): Same. * component-factory.c (owner_set_cb): After using the sources list, free it as it is no longer a const GSList as with the older mail-config code. * mail-config.c: Totally rewritten. svn path=/trunk/; revision=7298
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 5121683bc6..f67d2c7578 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -129,7 +129,7 @@ account_copy (const MailConfigAccount *account)
new = g_new0 (MailConfigAccount, 1);
new->name = g_strdup (account->name);
- new->default = source->default;
+ new->default_account = account->default_account;
new->id = identity_copy (account->id);
new->source = service_copy (account->source);
@@ -183,8 +183,8 @@ mail_config_clear (void)
}
if (config->news) {
- g_list_foreach (config->news, service_destroy_each, NULL);
- g_list_free (config->news);
+ g_slist_foreach (config->news, service_destroy_each, NULL);
+ g_slist_free (config->news);
config->news = NULL;
}
@@ -223,9 +223,9 @@ config_read (void)
path = g_strdup_printf ("account_name_%d", i);
account->name = gnome_config_get_string (path);
g_free (path);
- path = g_strdup_printf ("account_default_%d", i);
- account->default = gnome_config_get_bool (path) && !have_default;
- if (account->default)
+ path = g_strdup_printf ("account_is_default_%d", i);
+ account->default_account = gnome_config_get_bool (path) && !have_default;
+ if (account->default_account)
have_default = TRUE;
g_free (path);
@@ -241,10 +241,10 @@ config_read (void)
id->address = gnome_config_get_string (path);
g_free (path);
path = g_strdup_printf ("identity_organization_%d", i);
- id->org = gnome_config_get_string (path);
+ id->organization = gnome_config_get_string (path);
g_free (path);
path = g_strdup_printf ("identity_signature_%d", i);
- id->sig = gnome_config_get_string (path);
+ id->signature = gnome_config_get_string (path);
g_free (path);
/* get the source */
@@ -350,8 +350,8 @@ mail_config_write (void)
path = g_strdup_printf ("account_name_%d", i);
gnome_config_set_string (path, account->name);
g_free (path);
- path = g_strdup_printf ("account_default_%d", i);
- gnome_config_set_bool (path, account->default);
+ path = g_strdup_printf ("account_is_default_%d", i);
+ gnome_config_set_bool (path, account->default_account);
g_free (path);
/* identity info */
@@ -441,11 +441,13 @@ mail_config_write_on_exit (void)
/* Passwords */
gnome_config_private_clean_section ("/Evolution/Passwords");
- for (sources = config->sources; sources; sources = sources->next) {
+ sources = mail_config_get_sources ();
+ for ( ; sources; sources = sources->next) {
s = sources->data;
if (s->save_passwd)
mail_session_remember_password (s->url);
}
+ g_slist_free (sources);
gnome_config_sync ();
}
@@ -546,11 +548,11 @@ mail_config_get_accounts (void)
}
void
-mail_config_add_accounts (MailConfigAccount *account)
+mail_config_add_account (MailConfigAccount *account)
{
if (account->default_account) {
/* Un-defaultify other accounts */
- GSList *node = accounts;
+ GSList *node = config->accounts;
while (node) {
MailConfigAccount *acnt = node->data;
@@ -567,7 +569,7 @@ mail_config_add_accounts (MailConfigAccount *account)
void
mail_config_set_default_account (const MailConfigAccount *account)
{
- GSList *node = accounts;
+ GSList *node = config->accounts;
while (node) {
MailConfigAccount *acnt = node->data;
@@ -577,7 +579,7 @@ mail_config_set_default_account (const MailConfigAccount *account)
node = node->next;
}
- account->default_account = TRUE;
+ ((MailConfigAccount *) account)->default_account = TRUE;
}
const MailConfigIdentity *
@@ -633,8 +635,10 @@ mail_config_get_sources (void)
accounts = mail_config_get_accounts ();
while (accounts) {
- if (accounts->source)
- sources = g_slist_append (sources, accounts->source);
+ const MailConfigAccount *account = accounts->data;
+
+ if (account->source)
+ sources = g_slist_append (sources, account->source);
accounts = accounts->next;
}