From 49fd4ffbc41c4270efcc28d108b5a66d8773e178 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Thu, 3 Aug 2000 18:21:47 +0000 Subject: 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 --- shell/e-storage-set.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'shell/e-storage-set.c') 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 @@ -523,5 +523,53 @@ e_storage_set_get_folder_type_registry (EStorageSet *storage_set) return storage_set->priv->folder_type_registry; } + +/* 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) -- cgit v1.2.3