diff options
author | Ettore Perazzoli <ettore@src.gnome.org> | 2000-09-10 05:43:46 +0800 |
---|---|---|
committer | Ettore Perazzoli <ettore@src.gnome.org> | 2000-09-10 05:43:46 +0800 |
commit | 3d7fc19a83c4c3835e2c5c6821b45f4a27dcae73 (patch) | |
tree | dd0ff4f52e31599ba8190d85d0f1ab2932784bf3 /shell | |
parent | 93ce4979954074c5f7d6061958e523efb7bfb356 (diff) | |
download | gsoc2013-evolution-3d7fc19a83c4c3835e2c5c6821b45f4a27dcae73.tar.gz gsoc2013-evolution-3d7fc19a83c4c3835e2c5c6821b45f4a27dcae73.tar.zst gsoc2013-evolution-3d7fc19a83c4c3835e2c5c6821b45f4a27dcae73.zip |
Use the name of the storage or the folder in the storage set view,
instead of just the last segment of the path, so that we can support
display names correctly.
svn path=/trunk/; revision=5296
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ChangeLog | 9 | ||||
-rw-r--r-- | shell/e-storage-set-view.c | 20 | ||||
-rw-r--r-- | shell/e-storage-set.c | 2 |
3 files changed, 26 insertions, 5 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog index 73fa911dea..634c6ea9dd 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,12 @@ +2000-09-09 Ettore Perazzoli <ettore@helixcode.com> + + * e-storage-set-view.c (etree_value_at): Return the name of the + folder or the storage instead of just returning the last segment + of the path. + + * e-storage-set.c (e_storage_set_get_folder): If the storage is + not found, just return NULL to avoid a g_warning. + 2000-09-09 Christopher James Lahey <clahey@helixcode.com> * e-shell-view.c: Fixed some warnings. diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index b90f556286..670df6f920 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -489,16 +489,26 @@ etree_icon_at (ETreeModel *etree, ETreePath *tree_path, void *model_data) static void* etree_value_at (ETreeModel *etree, ETreePath *tree_path, int col, void *model_data) { + EStorageSetView *storage_set_view; + EStorageSet *storage_set; + EStorage *storage; + EFolder *folder; char *path; - char *last_separator; - path = (char*)e_tree_model_node_get_data (etree, tree_path); + storage_set_view = E_STORAGE_SET_VIEW (model_data); + storage_set = storage_set_view->priv->storage_set; - last_separator = strrchr (path, G_DIR_SEPARATOR); + path = (char *) e_tree_model_node_get_data (etree, tree_path); + + folder = e_storage_set_get_folder (storage_set, path); + if (folder != NULL) + return (void *) e_folder_get_name (folder); - g_return_val_if_fail (last_separator != NULL, NULL); + storage = e_storage_set_get_storage (storage_set, path + 1); + if (storage != NULL) + return (void *) e_storage_get_name (storage); - return last_separator + 1; + return NULL; } static void diff --git a/shell/e-storage-set.c b/shell/e-storage-set.c index 7b18d93c1c..405c3e2c61 100644 --- a/shell/e-storage-set.c +++ b/shell/e-storage-set.c @@ -452,6 +452,8 @@ e_storage_set_get_folder (EStorageSet *storage_set, g_return_val_if_fail (g_path_is_absolute (path), NULL); storage = get_storage_for_path (storage_set, path, &subpath); + if (storage == NULL) + return NULL; return e_storage_get_folder (storage, subpath); } |