diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-09-08 16:34:35 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-09-08 16:34:35 +0800 |
commit | aa20072666850291f8a00dec148df5d58991ae60 (patch) | |
tree | 299882862d2b7710c62915bd78c03d5f4c9648d0 /shell/e-local-storage.c | |
parent | a38d76bc2e91964b73ffac3efcb043db54bf2189 (diff) | |
download | gsoc2013-evolution-aa20072666850291f8a00dec148df5d58991ae60.tar.gz gsoc2013-evolution-aa20072666850291f8a00dec148df5d58991ae60.tar.zst gsoc2013-evolution-aa20072666850291f8a00dec148df5d58991ae60.zip |
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
Diffstat (limited to 'shell/e-local-storage.c')
-rw-r--r-- | shell/e-local-storage.c | 40 |
1 files changed, 36 insertions, 4 deletions
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 <gnome.h> +#include <bonobo.h> + #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); } @@ -586,4 +602,20 @@ e_local_storage_get_base_path (ELocalStorage *local_storage) } +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) |