From 2fba11c88fa90dc7b34a1b191ca327f942c47150 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 24 Aug 2001 19:01:59 +0000 Subject: Instead of using the length of the shortcuts list as the index for the 2001-08-24 Peter Williams * mail-config.c (add_shortcut_entry): Instead of using the length of the shortcuts list as the index for the shortcut, use -1, which means "last". * mail-config-druid.c (druid_finish): Remove the account adding stuff since that happens in wizard_finish now. * mail-config.c (add_new_storage): New function. Add a MailConfigAccount to the shell as a storage. (maybe_add_shortcut): Renamed to new_source_created. (new_source_created): Call add_new_storage here. * component-factory.c (mail_remove_storage_by_uri): Don't warn if the storage isn't remote... no point in making the caller do extra work. svn path=/trunk/; revision=12445 --- mail/mail-config.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'mail/mail-config.c') diff --git a/mail/mail-config.c b/mail/mail-config.c index 89bc55f5ef..1ae74ae0e8 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -1531,7 +1531,7 @@ add_shortcut_entry (const char *name, const char *uri, const char *type) GNOME_Evolution_Shortcuts_add (shortcuts_interface, group_num, - the_group->shortcuts._length, + -1, /* "end of list" */ the_shortcut, &ev); @@ -1549,7 +1549,17 @@ add_shortcut_entry (const char *name, const char *uri, const char *type) } static void -maybe_add_shortcut (MailConfigAccount *account) +add_new_storage (const char *url, const char *name) +{ + extern EvolutionShellClient *global_shell_client; + GNOME_Evolution_Shell corba_shell; + + corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (global_shell_client)); + mail_load_storage_by_uri (corba_shell, url, name); +} + +static void +new_source_created (MailConfigAccount *account) { CamelProvider *prov; gchar *name; @@ -1577,6 +1587,10 @@ maybe_add_shortcut (MailConfigAccount *account) add_shortcut_entry (name, url, "mail"); g_free (name); g_free (url); + + /* while we're here, add the storage to the folder tree */ + + add_new_storage (account->source->url, account->name); } void @@ -1585,7 +1599,7 @@ mail_config_add_account (MailConfigAccount *account) config->accounts = g_slist_append (config->accounts, account); if (account->source && account->source->url) - maybe_add_shortcut (account); + new_source_created (account); } static void -- cgit v1.2.3