From 6f7e492210bce877fa06f88d99b09d97958959b3 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Sun, 7 Jul 2019 18:58:57 -0400 Subject: [PATCH] nemo-list-model.c: When the last child of a node is removed, Handle re-adding a dummy row (or not) in the file removed handler, instead of always adding one, then removing it on parent's subsequent changed call. Fixes #2150 --- src/nemo-list-model.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/nemo-list-model.c b/src/nemo-list-model.c index 6254e7fd3..8b1896bd0 100644 --- a/src/nemo-list-model.c +++ b/src/nemo-list-model.c @@ -1225,8 +1225,16 @@ nemo_list_model_remove (NemoListModel *model, GtkTreeIter *iter) /* We need to do this before removing the last file to avoid * collapsing the row. */ - add_dummy_row (model, parent_file_entry); - } + + guint count; + gboolean got_count, unreadable; + + got_count = nemo_file_get_directory_item_count (parent_file_entry->file, &count, &unreadable); + + if ((!got_count && !unreadable) || count > 0) { + add_dummy_row (model, parent_file_entry); + } + } if (file_entry->subdirectory != NULL) { g_signal_emit (model,