aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-06-11 01:56:46 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-06-11 01:56:46 +0800
commitbbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2 (patch)
treeedcd34154f3281bd860ce40f67d7fc736d340e75 /shell/e-storage-set.c
parente8e0d04d0c8a5eb18a62d98e5a62d126756fa79f (diff)
downloadgsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.gz
gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.tar.zst
gsoc2013-evolution-bbb6a6942fdfbb2684c37ee6aa55f8c6e5b5a9f2.zip
Implemented folder creation dialog (File -> New -> Folder). To make
it really work though, the components should implement creation functionality by passing an appropriate function pointer in `e_shell_component_new()' for @create_folder_fn. svn path=/trunk/; revision=3504
Diffstat (limited to 'shell/e-storage-set.c')
-rw-r--r--shell/e-storage-set.c95
1 files changed, 78 insertions, 17 deletions
diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c
index 33dc366afe..a779023bab 100644
--- a/shell/e-storage-set.c
+++ b/shell/e-storage-set.c
@@ -153,6 +153,37 @@ storage_removed_folder_cb (EStorage *storage,
}
+static EStorage *
+get_storage_for_path (EStorageSet *storage_set,
+ const char *path,
+ const char **subpath_return)
+{
+ EStorage *storage;
+ char *storage_name;
+ const char *first_separator;
+
+ g_return_val_if_fail (g_path_is_absolute (path), NULL);
+
+ /* Skip initial separator. */
+ path++;
+
+ first_separator = strchr (path, G_DIR_SEPARATOR);
+
+ if (first_separator == NULL || first_separator == path || first_separator[1] == 0) {
+ *subpath_return = NULL;
+ return NULL;
+ }
+
+ storage_name = g_strndup (path, first_separator - path);
+ storage = e_storage_set_get_storage (storage_set, storage_name);
+ g_free (storage_name);
+
+ *subpath_return = first_separator;
+
+ return storage;
+}
+
+
/* GtkObject methods. */
static void
@@ -412,30 +443,16 @@ e_storage_set_get_folder (EStorageSet *storage_set,
const char *path)
{
EStorage *storage;
- const char *first_separator;
- char *storage_name;
+ const char *subpath;
g_return_val_if_fail (storage_set != NULL, NULL);
g_return_val_if_fail (E_IS_STORAGE_SET (storage_set), NULL);
g_return_val_if_fail (path != NULL, NULL);
g_return_val_if_fail (g_path_is_absolute (path), NULL);
- /* Skip initial separator. */
- path++;
-
- first_separator = strchr (path, G_DIR_SEPARATOR);
-
- if (first_separator == NULL || first_separator == path || first_separator[1] == 0)
- return NULL;
-
- storage_name = g_strndup (path, first_separator - path);
- storage = e_storage_set_get_storage (storage_set, storage_name);
- g_free (storage_name);
-
- if (storage == NULL)
- return NULL;
+ storage = get_storage_for_path (storage_set, path, &subpath);
- return e_storage_get_folder (storage, first_separator);
+ return e_storage_get_folder (storage, subpath);
}
@@ -453,6 +470,50 @@ e_storage_set_new_view (EStorageSet *storage_set)
}
+void
+e_storage_set_async_create_folder (EStorageSet *storage_set,
+ const char *path,
+ const char *type,
+ const char *description,
+ EStorageResultCallback callback,
+ void *data)
+{
+ EStorage *storage;
+ const char *subpath;
+
+ g_return_if_fail (storage_set != NULL);
+ g_return_if_fail (E_IS_STORAGE_SET (storage_set));
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (g_path_is_absolute (path));
+ g_return_if_fail (type != NULL);
+ g_return_if_fail (callback != NULL);
+
+ storage = get_storage_for_path (storage_set, path, &subpath);
+
+ e_storage_async_create_folder (storage, subpath, type, description, callback, data);
+}
+
+void
+e_storage_set_async_remove_folder (EStorageSet *storage_set,
+ const char *path,
+ EStorageResultCallback callback,
+ void *data)
+{
+ EStorage *storage;
+ const char *subpath;
+
+ g_return_if_fail (storage_set != NULL);
+ g_return_if_fail (E_IS_STORAGE_SET (storage_set));
+ g_return_if_fail (path != NULL);
+ g_return_if_fail (g_path_is_absolute (path));
+ g_return_if_fail (callback != NULL);
+
+ storage = get_storage_for_path (storage_set, path, &subpath);
+
+ e_storage_async_remove_folder (storage, path, callback, data);
+}
+
+
EFolderTypeRegistry *
e_storage_set_get_folder_type_registry (EStorageSet *storage_set)
{
an class='insertions'>+1 * After upgrade to 0.99.19 jed was freezing when called with -c, fix it now.garga2009-12-212-1/+26 * Update to 0.99.19garga2009-12-154-11/+11 * - Mark it as MAKE_JOBS_UNSAFE, i did it wrong on last commitgarga2009-03-291-1/+1 * Mark all my ports as MAKE_JOBS_SAFE and MAKE_JOBS_UNSAFEgarga2009-03-291-0/+1 * - devel/libslang2 has completely replaced devel/libslang which has not beenpgollucci2009-02-081-7/+4 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0 * - Fix installation when NOPORTDOCS is set, preventing it to create doc dirs.garga2008-06-021-1/+6 * - Remove unneeded dependency from gtk12/gtk20 [1]miwi2008-04-201-2/+2 * - Add more MASTER_SITESgarga2007-09-011-0/+1 * - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1 * Add one new master site and remove an old one that's not working anymore.garga2006-05-311-1/+1 * Update to 0.99.18garga2006-04-034-20/+43 * - Fix PLISTgarga2005-11-091-0/+1 * - Add SHA256garga2005-11-081-0/+1 * - info files are really old and out of date, so, do not install it anymoregarga2005-11-075-65/+2 * - Respect CFLAGS/LDFLAGSgarga2005-10-281-3/+1 * - Remove some patches and use REINPLACE_CMD, *_ARGS and *_ENV insteadgarga2005-10-286-194/+33 * - Add more MASTER_SITESgarga2005-10-281-1/+5 * - Register CONFLICTS with jed-develgarga2005-10-271-10/+16 * Change MAINTAINER to my @FreeBSD.org accountgarga2005-07-121-1/+1 * - Sort the packing listjylefort2005-05-1610-107/+239 * - Fix losing setuid/setgid bits on files when savingpav2004-11-023-1/+33 * Trim whitespace.trevor2004-04-111-1/+1 * SIZEify (maintainer timeout)trevor2004-03-311-0/+1 * Make portlint(1) happy by changing strip to ${STRIP_CMD}osa2003-09-24