diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-12-05 09:08:18 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-12-05 09:08:18 +0800 |
commit | 9c28295de36c8c18c01c5c7846566526cee7f1ac (patch) | |
tree | 80bdfe6eefc6b8d3c720191029fc7c899d8ec891 /shell/e-storage.c | |
parent | 80445852285529e0d323c8bb076512b69eaf96a3 (diff) | |
download | gsoc2013-evolution-9c28295de36c8c18c01c5c7846566526cee7f1ac.tar.gz gsoc2013-evolution-9c28295de36c8c18c01c5c7846566526cee7f1ac.tar.zst gsoc2013-evolution-9c28295de36c8c18c01c5c7846566526cee7f1ac.zip |
Start implementing a physical URI property for the toplevel nodes in
storages. Also add initial code in the shell to handle that.
svn path=/trunk/; revision=6787
Diffstat (limited to 'shell/e-storage.c')
-rw-r--r-- | shell/e-storage.c | 41 |
1 files changed, 37 insertions, 4 deletions
diff --git a/shell/e-storage.c b/shell/e-storage.c index 3ea687716c..ab07bd13a9 100644 --- a/shell/e-storage.c +++ b/shell/e-storage.c @@ -44,7 +44,11 @@ static GtkObjectClass *parent_class = NULL; E_STORAGE_CLASS (GTK_OBJECT (obj)->klass) struct _EStoragePrivate { + /* The set of folders we have in this storage. */ EFolderTree *folder_tree; + + /* URI for the toplevel node. */ + char *toplevel_node_uri; }; enum { @@ -91,6 +95,8 @@ destroy (GtkObject *object) if (priv->folder_tree != NULL) e_folder_tree_destroy (priv->folder_tree); + g_free (priv->toplevel_node_uri); + (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } @@ -202,7 +208,8 @@ init (EStorage *storage) priv = g_new (EStoragePrivate, 1); - priv->folder_tree = e_folder_tree_new (folder_destroy_notify, NULL); + priv->folder_tree = e_folder_tree_new (folder_destroy_notify, NULL); + priv->toplevel_node_uri = NULL; storage->priv = priv; } @@ -211,22 +218,28 @@ init (EStorage *storage) /* Creation. */ void -e_storage_construct (EStorage *storage) +e_storage_construct (EStorage *storage, + const char *toplevel_node_uri) { + EStoragePrivate *priv; + g_return_if_fail (storage != NULL); g_return_if_fail (E_IS_STORAGE (storage)); + priv = storage->priv; + priv->toplevel_node_uri = g_strdup (toplevel_node_uri); + GTK_OBJECT_UNSET_FLAGS (GTK_OBJECT (storage), GTK_FLOATING); } EStorage * -e_storage_new (void) +e_storage_new (const char *toplevel_node_uri) { EStorage *new; new = gtk_type_new (e_storage_get_type ()); - e_storage_construct (new); + e_storage_construct (new, toplevel_node_uri); return new; } @@ -282,6 +295,26 @@ e_storage_get_name (EStorage *storage) return (* ES_CLASS (storage)->get_name) (storage); } +/** + * e_storage_get_toplevel_node_uri: + * @storage: A pointer to an EStorage object + * + * Get the physical URI for the toplevel node in the storage. + * + * Return value: a pointer to a string representing that URI. + **/ +const char * +e_storage_get_toplevel_node_uri (EStorage *storage) +{ + EStoragePrivate *priv; + + g_return_val_if_fail (storage != NULL, NULL); + g_return_val_if_fail (E_IS_STORAGE (storage), NULL); + + priv = storage->priv; + return priv->toplevel_node_uri; +} + /* Folder operations. */ |