summaryrefslogtreecommitdiff
path: root/plugins/filebrowser/gedit-file-browser-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/filebrowser/gedit-file-browser-store.c')
-rw-r--r--plugins/filebrowser/gedit-file-browser-store.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/plugins/filebrowser/gedit-file-browser-store.c b/plugins/filebrowser/gedit-file-browser-store.c
index abb0f7d15..b4050724e 100644
--- a/plugins/filebrowser/gedit-file-browser-store.c
+++ b/plugins/filebrowser/gedit-file-browser-store.c
@@ -1449,6 +1449,7 @@ model_remove_node_children (GeditFileBrowserStore *model,
{
FileBrowserNodeDir *dir;
GtkTreePath *path_child;
+ FileBrowserNode *child;
GSList *list;
if (node == NULL || !NODE_IS_DIR (node))
@@ -1477,10 +1478,19 @@ model_remove_node_children (GeditFileBrowserStore *model,
list = g_slist_copy (dir->children);
- for (GSList *item = list; item; item = item->next)
- model_remove_node (model, (FileBrowserNode *)(item->data), path_child, free_nodes);
+ for (GSList *item = g_slist_next (list); item; item = item->next)
+ {
+ child = item->data;
+ g_assert (!NODE_IS_DUMMY (child));
+ model_remove_node (model, child, path_child, free_nodes);
+ }
g_slist_free (list);
+
+ child = dir->children->data;
+ g_assert (NODE_IS_DUMMY (child));
+ model_remove_node (model, child, path_child, free_nodes);
+
gtk_tree_path_free (path_child);
}
@@ -1555,24 +1565,6 @@ model_clear (GeditFileBrowserStore *model,
model_remove_node_children (model, model->priv->virtual_root, path, free_nodes);
gtk_tree_path_free (path);
-
- /* Remove the dummy if there is one */
- if (model->priv->virtual_root)
- {
- FileBrowserNodeDir *dir = FILE_BROWSER_NODE_DIR (model->priv->virtual_root);
-
- if (dir->children != NULL)
- {
- FileBrowserNode *dummy = (FileBrowserNode *)(dir->children->data);
-
- if (NODE_IS_DUMMY (dummy) && model_node_visibility (model, dummy))
- {
- path = gtk_tree_path_new_first ();
- row_deleted (model, dummy, path);
- gtk_tree_path_free (path);
- }
- }
- }
}
static void