aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-storage-set-view.c
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2001-08-20 09:22:09 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2001-08-20 09:22:09 +0800
commit6bf0ba97e25261e2efc5c685c08cf52a75816d3b (patch)
tree120c8f1df9cfb71890d4c708a4ba878a8ac35e7f /shell/e-storage-set-view.c
parentee70366b8e7092300fff8a421efa3ff84c5bcf7a (diff)
downloadgsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar.gz
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar.bz2
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar.lz
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar.xz
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.tar.zst
gsoc2013-evolution-6bf0ba97e25261e2efc5c685c08cf52a75816d3b.zip
Use xmlMemStrdup() to override the type as it's expected to be allocated
* e-shortcuts.c (load_shortcuts): Use xmlMemStrdup() to override the type as it's expected to be allocated by libxml later on. Also, get the icon for the storage if the shortcut points to a storage. * e-storage-set-view.c (etree_icon_at): Don't special case the Summary storage. Rather, use `e_storage_get_toplevel_node_type()' for getting the type of the node. * e-shortcuts-view-model.c (get_icon_for_item): New helper function. (shortcuts_update_shortcut_cb): Use it. (shortcuts_new_shortcut_cb): Use it. (load_group_into_model): Use it. svn path=/trunk/; revision=12232
Diffstat (limited to 'shell/e-storage-set-view.c')
-rw-r--r--shell/e-storage-set-view.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c
index 6a6cbd88b7..a49e00f3bb 100644
--- a/shell/e-storage-set-view.c
+++ b/shell/e-storage-set-view.c
@@ -1350,7 +1350,6 @@ etree_icon_at (ETreeModel *etree,
EFolderTypeRegistry *folder_type_registry;
EStorageSetView *storage_set_view;
EStorageSet *storage_set;
- GdkPixbuf *icon_pixbuf;
EFolder *folder;
char *path;
int depth;
@@ -1361,28 +1360,31 @@ etree_icon_at (ETreeModel *etree,
/* Tree depth will indicate storages or folders */
depth = e_tree_model_node_depth (etree, tree_path);
- path = (char*)e_tree_memory_node_get_data (E_TREE_MEMORY(etree), tree_path);
+ path = (char*) e_tree_memory_node_get_data (E_TREE_MEMORY(etree), tree_path);
+
+ /* Is this a storage? */
+
+ if (depth == 1) {
+ EStorage *storage;
+ const char *storage_type;
+
+ storage = e_storage_set_get_storage (storage_set, path + 1);
- /* Storages, Summary (nee My Evolution) is the only special case for now */
- if (depth == 1 && !strcmp (path, "/summary")) { /* Storages */
-
folder_type_registry = e_storage_set_get_folder_type_registry (storage_set);
-
- icon_pixbuf = e_folder_type_registry_get_icon_for_type (folder_type_registry,
- "Summary", TRUE);
- return icon_pixbuf;
- }
- /* Folders */
- else if (depth >= 2) {
-
- folder = e_storage_set_get_folder (storage_set, path);
- if (folder == NULL)
+ storage_type = e_storage_get_toplevel_node_type (storage);
+ if (storage_type != NULL)
+ return e_folder_type_registry_get_icon_for_type (folder_type_registry, storage_type, TRUE);
+ else
return NULL;
-
- return get_pixbuf_for_folder (storage_set_view, folder);
}
- return NULL;
+ /* Folder. */
+
+ folder = e_storage_set_get_folder (storage_set, path);
+ if (folder == NULL)
+ return NULL;
+
+ return get_pixbuf_for_folder (storage_set_view, folder);
}
/* This function returns the number of columns in our ETreeModel. */