From aa20072666850291f8a00dec148df5d58991ae60 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 8 Sep 2000 08:34:35 +0000 Subject: Added new interfaces to be exposed by the local storage, so that components can get a list of all the folders and specify the display name for them. (Unfinished and untested.) svn path=/trunk/; revision=5256 --- shell/e-local-storage.c | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) (limited to 'shell/e-local-storage.c') diff --git a/shell/e-local-storage.c b/shell/e-local-storage.c index a66990f03a..5e78f05b9a 100644 --- a/shell/e-local-storage.c +++ b/shell/e-local-storage.c @@ -44,9 +44,13 @@ #include +#include + #include "e-util/e-util.h" #include "e-local-folder.h" +#include "evolution-local-storage.h" + #include "e-local-storage.h" @@ -59,6 +63,7 @@ static EStorageClass *parent_class = NULL; struct _ELocalStoragePrivate { EFolderTypeRegistry *folder_type_registry; char *base_path; + EvolutionLocalStorage *bonobo_interface; }; @@ -362,17 +367,25 @@ impl_destroy (GtkObject *object) { ELocalStorage *local_storage; ELocalStoragePrivate *priv; + CORBA_Environment ev; local_storage = E_LOCAL_STORAGE (object); priv = local_storage->priv; + CORBA_exception_init (&ev); + g_free (priv->base_path); if (priv->folder_type_registry != NULL) gtk_object_unref (GTK_OBJECT (priv->folder_type_registry)); - + + if (priv->bonobo_interface != NULL) + bonobo_object_unref (BONOBO_OBJECT (priv->bonobo_interface)); + g_free (priv); + CORBA_exception_free (&ev); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -382,8 +395,7 @@ impl_destroy (GtkObject *object) static const char * impl_get_name (EStorage *storage) { - /* FIXME this sucks. */ - return "local"; + return E_LOCAL_STORAGE_NAME; } static void @@ -521,8 +533,9 @@ init (ELocalStorage *local_storage) priv = g_new (ELocalStoragePrivate, 1); - priv->base_path = NULL; + priv->base_path = NULL; priv->folder_type_registry = NULL; + priv->bonobo_interface = NULL; local_storage->priv = priv; } @@ -553,6 +566,9 @@ construct (ELocalStorage *local_storage, g_assert (priv->base_path == NULL); priv->base_path = g_strndup (base_path, base_path_len); + g_assert (priv->bonobo_interface == NULL); + priv->bonobo_interface = evolution_local_storage_new (E_LOCAL_STORAGE_NAME); + return load_all_folders (local_storage); } @@ -585,5 +601,21 @@ e_local_storage_get_base_path (ELocalStorage *local_storage) return local_storage->priv->base_path; } + +const Evolution_LocalStorage +e_local_storage_get_corba_interface (ELocalStorage *local_storage) +{ + ELocalStoragePrivate *priv; + Evolution_LocalStorage corba_interface; + + g_return_val_if_fail (local_storage != NULL, NULL); + g_return_val_if_fail (E_IS_LOCAL_STORAGE (local_storage), NULL); + + priv = local_storage->priv; + corba_interface = bonobo_object_corba_objref (BONOBO_OBJECT (priv->bonobo_interface)); + + return corba_interface; +} + E_MAKE_TYPE (e_local_storage, "ELocalStorage", ELocalStorage, class_init, init, PARENT_TYPE) -- cgit