diff options
-rw-r--r-- | mail/ChangeLog | 11 | ||||
-rw-r--r-- | mail/component-factory.c | 34 | ||||
-rw-r--r-- | mail/mail-ops.c | 5 |
3 files changed, 44 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index a769558880..36c7b214e3 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,14 @@ +2000-12-11 Dan Winship <danw@helixcode.com> + + * component-factory.c (create_view): Deal with "mailstorage" type + views (top-level mail storages) by trying to fill the storage's + folder tree again if we failed before. + (add_storage): Create new storages with a URI and type + "mailstorage". + + * mail-ops.c (cleanup_scan_subfolders): On success, mark the + storage as having been loaded, so create_view won't try again. + 2000-12-11 Jeffrey Stedfast <fejj@helixcode.com> * mail-format.c (decode_pgp): Updated to reflect arguments to the diff --git a/mail/component-factory.c b/mail/component-factory.c index 63a1d606a4..e0774b5abd 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -73,17 +73,38 @@ create_view (EvolutionShellComponent *shell_component, GNOME_Evolution_Shell corba_shell; BonoboControl *control; - if (g_strcasecmp (folder_type, "mail") != 0) - return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE; - shell_client = evolution_shell_component_get_owner (shell_component); corba_shell = bonobo_object_corba_objref (BONOBO_OBJECT (shell_client)); - control = folder_browser_factory_new_control (physical_uri, corba_shell); + if (g_strcasecmp (folder_type, "mail") == 0) { + control = folder_browser_factory_new_control (physical_uri, + corba_shell); + } else if (g_strcasecmp (folder_type, "mailstorage") == 0) { + CamelService *store; + EvolutionStorage *storage; + + store = camel_session_get_service (session, physical_uri, + CAMEL_PROVIDER_STORE, NULL); + if (!store) + return EVOLUTION_SHELL_COMPONENT_NOTFOUND; + storage = g_hash_table_lookup (storages_hash, store); + if (!storage) { + camel_object_unref (CAMEL_OBJECT (store)); + return EVOLUTION_SHELL_COMPONENT_NOTFOUND; + } + + if (!gtk_object_get_data (GTK_OBJECT (storage), "connected")) + mail_do_scan_subfolders (store, storage); + camel_object_unref (CAMEL_OBJECT (store)); + + control = folder_browser_factory_new_control ("", corba_shell); + } else + return EVOLUTION_SHELL_COMPONENT_UNSUPPORTEDTYPE; + if (!control) return EVOLUTION_SHELL_COMPONENT_NOTFOUND; - *control_return = control; + *control_return = control; return EVOLUTION_SHELL_COMPONENT_OK; } @@ -163,6 +184,7 @@ owner_unset_cb (EvolutionShellComponent *shell_component, gpointer user_data) static const EvolutionShellComponentFolderType folder_types[] = { { "mail", "evolution-inbox.png" }, + { "mailstorage", "evolution-inbox.png" }, { NULL, NULL } }; @@ -223,7 +245,7 @@ add_storage (const char *uri, CamelService *store, char *name; name = camel_service_get_name (store, TRUE); - storage = evolution_storage_new (name, NULL, NULL); + storage = evolution_storage_new (name, uri, "mailstorage"); g_free (name); res = evolution_storage_register_on_shell (storage, corba_shell); diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 3b23c453a0..baa026acb7 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1373,6 +1373,11 @@ cleanup_scan_subfolders (gpointer in_data, gpointer op_data, } g_ptr_array_free (data->new_folders, TRUE); + if (!camel_exception_is_set (ex)) { + gtk_object_set_data (GTK_OBJECT (input->storage), + "connected", GINT_TO_POINTER (1)); + } + gtk_object_unref (GTK_OBJECT (input->storage)); camel_object_unref (CAMEL_OBJECT (input->store)); } |