Skip to content

Commit

Permalink
nemo-list-model.c: When the last child of a node is removed, Handle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mtwebster committed Jul 8, 2019
1 parent 8c9baef commit 6f7e492
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/nemo-list-model.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6f7e492

Please sign in to comment.