diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-12-09 08:55:57 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-12-09 08:55:57 +0800 |
commit | a66eae167484718678ceae7368c167aacb322b38 (patch) | |
tree | 109b1873d637de6411d3aa1bb67fab865ecc2e08 /shell/evolution-storage.c | |
parent | 25ad3092eb60a6dcdbb810cf684ce6dc8715ac4c (diff) | |
download | gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar.gz gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar.bz2 gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar.lz gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar.xz gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.tar.zst gsoc2013-evolution-a66eae167484718678ceae7368c167aacb322b38.zip |
Complete the code to associate a URI and a folder type to the toplevel
node in a storage. It sucks a bit and needs a little more
refactoring.
svn path=/trunk/; revision=6878
Diffstat (limited to 'shell/evolution-storage.c')
-rw-r--r-- | shell/evolution-storage.c | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/shell/evolution-storage.c b/shell/evolution-storage.c index 81d923b803..5ad51472a3 100644 --- a/shell/evolution-storage.c +++ b/shell/evolution-storage.c @@ -48,6 +48,9 @@ struct _EvolutionStoragePrivate { /* URI for the toplevel node of the storage. */ char *toplevel_node_uri; + /* Type for the toplevel node of the storage. */ + char *toplevel_node_type; + /* The set of folders we have in this storage. */ EFolderTree *folder_tree; @@ -280,7 +283,7 @@ destroy (GtkObject *object) g_free (priv->name); g_free (priv->toplevel_node_uri); - + g_free (priv->toplevel_node_type); if (priv->folder_tree != NULL) e_folder_tree_destroy (priv->folder_tree); @@ -346,6 +349,7 @@ init (EvolutionStorage *storage) priv = g_new (EvolutionStoragePrivate, 1); priv->name = NULL; priv->toplevel_node_uri = NULL; + priv->toplevel_node_type = NULL; priv->folder_tree = e_folder_tree_new (folder_destroy_notify, storage); priv->corba_storage_listeners = NULL; @@ -370,9 +374,11 @@ void evolution_storage_construct (EvolutionStorage *storage, GNOME_Evolution_Storage corba_object, const char *name, - const char *toplevel_node_uri) + const char *toplevel_node_uri, + const char *toplevel_node_type) { EvolutionStoragePrivate *priv; + CORBA_Environment ev; g_return_if_fail (storage != NULL); g_return_if_fail (EVOLUTION_IS_STORAGE (storage)); @@ -380,16 +386,22 @@ evolution_storage_construct (EvolutionStorage *storage, g_return_if_fail (name != NULL); g_return_if_fail (name[0] != '\0'); + CORBA_exception_init (&ev); + bonobo_object_construct (BONOBO_OBJECT (storage), corba_object); priv = storage->priv; - priv->name = g_strdup (name); - priv->toplevel_node_uri = g_strdup (toplevel_node_uri); + priv->name = g_strdup (name); + priv->toplevel_node_uri = g_strdup (toplevel_node_uri); + priv->toplevel_node_type = g_strdup (toplevel_node_type); + + CORBA_exception_free (&ev); } EvolutionStorage * evolution_storage_new (const char *name, - const char *toplevel_node_uri) + const char *toplevel_node_uri, + const char *toplevel_node_type) { EvolutionStorage *new; POA_GNOME_Evolution_Storage *servant; @@ -405,7 +417,7 @@ evolution_storage_new (const char *name, new = gtk_type_new (evolution_storage_get_type ()); corba_object = bonobo_object_activate_servant (BONOBO_OBJECT (new), servant); - evolution_storage_construct (new, corba_object, name, toplevel_node_uri); + evolution_storage_construct (new, corba_object, name, toplevel_node_uri, toplevel_node_type); return new; } @@ -439,6 +451,7 @@ evolution_storage_register (EvolutionStorage *evolution_storage, corba_storage, priv->name, e_safe_corba_string (priv->toplevel_node_uri), + e_safe_corba_string (priv->toplevel_node_type), &ev); if (ev._major == CORBA_NO_EXCEPTION) { |