aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-08-04 02:21:47 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-08-04 02:21:47 +0800
commit49fd4ffbc41c4270efcc28d108b5a66d8773e178 (patch)
tree0c3ee5b15690e5214cf14bcac364cd435e66334a /shell/e-storage-set.c
parentf273b40d5edeb4da6408c265097c44d70ae861eb (diff)
downloadgsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar.gz
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar.bz2
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar.lz
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar.xz
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.tar.zst
gsoc2013-evolution-49fd4ffbc41c4270efcc28d108b5a66d8773e178.zip
Update the ::user_select_folder() interface so that it accepts both a
physical URI or an evolution: one for specifying the default folder. svn path=/trunk/; revision=4508
Diffstat (limited to 'shell/e-storage-set.c')
-rw-r--r--shell/e-storage-set.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c
index 81f97f055c..3a1fbb9b65 100644
--- a/shell/e-storage-set.c
+++ b/shell/e-storage-set.c
@@ -524,4 +524,52 @@ e_storage_set_get_folder_type_registry (EStorageSet *storage_set)
}
+/* Utility functions. */
+
+/**
+ * e_storage_set_get_path_for_physical_uri:
+ * @storage_set: A storage set
+ * @physical_uri: A physical URI
+ *
+ * Retrieve the path of the folder whose physical URI matches @physical_uri.
+ *
+ * Return value:
+ **/
+char *
+e_storage_set_get_path_for_physical_uri (EStorageSet *storage_set,
+ const char *physical_uri)
+{
+ EStorageSetPrivate *priv;
+ GList *p;
+
+ 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 (physical_uri != NULL, NULL);
+
+ priv = storage_set->priv;
+
+ for (p = priv->storages; p != NULL; p = p->next) {
+ EStorage *storage;
+ char *storage_path;
+
+ storage = E_STORAGE (p->data);
+
+ storage_path = e_storage_get_path_for_physical_uri (storage, physical_uri);
+ if (storage_path != NULL) {
+ char *storage_set_path;
+
+ storage_set_path = g_strconcat (G_DIR_SEPARATOR_S,
+ e_storage_get_name (storage),
+ storage_path,
+ NULL);
+ g_free (storage_path);
+
+ return storage_set_path;
+ }
+ }
+
+ return NULL;
+}
+
+
E_MAKE_TYPE (e_storage_set, "EStorageSet", EStorageSet, class_init, init, PARENT_TYPE)