aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-05-23 18:15:30 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-05-23 18:15:30 +0800
commitd00e525efc8be034cd2009100258680a62a87202 (patch)
tree7bd885b5dc38cc1ca530f400aa58943ef39a0211 /shell/e-storage.c
parent84844abe322120292b1d2e0e8978046e1c550bfe (diff)
downloadgsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar.gz
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar.bz2
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar.lz
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar.xz
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.tar.zst
gsoc2013-evolution-d00e525efc8be034cd2009100258680a62a87202.zip
Get rid of the old `evolution-service-repository' cruft and start
implementing new CORBA storage interfaces for the shell. svn path=/trunk/; revision=3178
Diffstat (limited to 'shell/e-storage.c')
-rw-r--r--shell/e-storage.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/shell/e-storage.c b/shell/e-storage.c
index 5d5b1dd7a8..974626e7b8 100644
--- a/shell/e-storage.c
+++ b/shell/e-storage.c
@@ -400,7 +400,7 @@ e_storage_get_name (EStorage *storage)
/* These functions are used by subclasses to add and remove folders from the
state stored in the storage object. */
-void
+gboolean
e_storage_new_folder (EStorage *storage,
const char *path,
EFolder *e_folder)
@@ -411,12 +411,12 @@ e_storage_new_folder (EStorage *storage,
const char *name;
char *full_path;
- g_return_if_fail (storage != NULL);
- g_return_if_fail (E_IS_STORAGE (storage));
- g_return_if_fail (path != NULL);
- g_return_if_fail (g_path_is_absolute (path));
- g_return_if_fail (e_folder != NULL);
- g_return_if_fail (E_IS_FOLDER (e_folder));
+ g_return_val_if_fail (storage != NULL, FALSE);
+ g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (g_path_is_absolute (path), FALSE);
+ g_return_val_if_fail (e_folder != NULL, FALSE);
+ g_return_val_if_fail (E_IS_FOLDER (e_folder), FALSE);
priv = storage->priv;
@@ -424,12 +424,12 @@ e_storage_new_folder (EStorage *storage,
if (parent_folder == NULL) {
g_warning ("%s: Trying to add a subfolder to a path that does not exist yet -- %s",
__FUNCTION__, path);
- return;
+ return FALSE;
}
name = e_folder_get_name (e_folder);
g_assert (name != NULL);
- g_return_if_fail (*name != G_DIR_SEPARATOR);
+ g_return_val_if_fail (*name != G_DIR_SEPARATOR, FALSE);
full_path = g_concat_dir_and_file (path, name);
@@ -437,36 +437,40 @@ e_storage_new_folder (EStorage *storage,
if (folder != NULL) {
g_warning ("%s: Trying to add a subfolder for a path that already exists -- %s",
__FUNCTION__, full_path);
- return;
+ return FALSE;
}
folder = folder_new (e_folder);
folder_add_subfolder (parent_folder, folder);
g_hash_table_insert (priv->path_to_folder, full_path, folder);
+
+ return TRUE;
}
-void
+gboolean
e_storage_remove_folder (EStorage *storage,
const char *path)
{
EStoragePrivate *priv;
Folder *folder;
- g_return_if_fail (storage != NULL);
- g_return_if_fail (E_IS_STORAGE (storage));
- g_return_if_fail (path != NULL);
- g_return_if_fail (g_path_is_absolute (path));
+ g_return_val_if_fail (storage != NULL, FALSE);
+ g_return_val_if_fail (E_IS_STORAGE (storage), FALSE);
+ g_return_val_if_fail (path != NULL, FALSE);
+ g_return_val_if_fail (g_path_is_absolute (path), FALSE);
priv = storage->priv;
folder = g_hash_table_lookup (priv->path_to_folder, path);
if (folder == NULL) {
g_warning ("%s: Folder not found -- %s", __FUNCTION__, path);
- return;
+ return FALSE;
}
folder_destroy (folder);
+
+ return TRUE;
}