From 5b9b2f83d39d01a0c45988df58c93e27f5ab8352 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 10 Aug 2001 04:34:11 +0000 Subject: [Fix #6787, Removing a storage with children and then re-adding it causes a crash.] * e-storage-set-view.c (convert_corba_drag_action_set_to_gdk): Removed `#if 0'ed function. (etree_node_destroy_func): New destroy function. (e_storage_set_view_construct): Set this as the new destroy function on the ETreeMemory. svn path=/trunk/; revision=11869 --- shell/e-storage-set-view.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) (limited to 'shell/e-storage-set-view.c') diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 23e97ece8c..461b05411d 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -352,28 +352,6 @@ convert_gdk_drag_action_set_to_corba (GdkDragAction action) return retval; } -#if 0 -static GdkDragAction -convert_corba_drag_action_set_to_gdk (GNOME_Evolution_ShellComponentDnd_ActionSet action) -{ - GdkDragAction retval; - - retval = GDK_ACTION_DEFAULT; - - if (action & GNOME_Evolution_ShellComponentDnd_ACTION_COPY) - retval |= GDK_ACTION_COPY; - if (action & GNOME_Evolution_ShellComponentDnd_ACTION_MOVE) - retval |= GDK_ACTION_MOVE; - if (action & GNOME_Evolution_ShellComponentDnd_ACTION_LINK) - retval |= GDK_ACTION_LINK; - if (action & GNOME_Evolution_ShellComponentDnd_ACTION_ASK) - retval |= GDK_ACTION_ASK; - - return retval; -} -#endif - - static GNOME_Evolution_ShellComponentDnd_ActionSet convert_gdk_drag_action_to_corba (GdkDragAction action) { @@ -1549,6 +1527,20 @@ etree_value_to_string (ETreeModel *etc, int col, const void *value, void *data) return g_strdup(value ? "Yes" : "No"); } +static void +etree_node_destroy_func (void *data, + void *user_data) +{ + EStorageSetView *storage_set_view; + char *path; + + path = (char *) data; + storage_set_view = E_STORAGE_SET_VIEW (user_data); + + remove_node_from_hash (storage_set_view, path); + g_free (path); +} + /* StorageSet signal handling. */ @@ -1942,7 +1934,8 @@ e_storage_set_view_construct (EStorageSetView *storage_set_view, storage_set_view); - e_tree_memory_set_node_destroy_func (E_TREE_MEMORY (priv->etree_model), (GFunc) g_free, NULL); + e_tree_memory_set_node_destroy_func (E_TREE_MEMORY (priv->etree_model), + etree_node_destroy_func, storage_set_view); e_tree_memory_set_expanded_default (E_TREE_MEMORY (priv->etree_model), TRUE); priv->root_node = e_tree_memory_node_insert (E_TREE_MEMORY(priv->etree_model), NULL, -1, -- cgit