Skip to content

Commit 1ce5c90

Browse files
committed
nemo-list-model: show expander when a previously empty folder gets items
In the same way that we remove the dummy row when we know the folder doesn't have any items in it, do add one when we know that it does have items.
1 parent 0ba73e5 commit 1ce5c90

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/nemo-list-model.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,9 @@ update_dummy_row (NemoListModel *model,
11071107
got_count = nemo_file_get_directory_item_count (file, &count, &unreadable);
11081108

11091109
if ((got_count && count == 0) || (!got_count && unreadable)) {
1110+
/* The directory doesn't have any items in it, so we want to
1111+
* hide the the expander. Check if there is any dummy entry
1112+
* (which would force its appearence) and remove it. */
11101113
files = file_entry->files;
11111114
if (g_sequence_get_length (files) == 1) {
11121115
GSequenceIter *dummy_ptr = g_sequence_get_iter_at_pos (files, 0);
@@ -1129,6 +1132,15 @@ update_dummy_row (NemoListModel *model,
11291132
}
11301133
}
11311134
}
1135+
} else if (got_count && count > 0) {
1136+
/* The directory does have items in it. We want an expander present,
1137+
* so check if there are any entries, and if not add a dummy one. */
1138+
files = file_entry->files;
1139+
1140+
if (g_sequence_get_length (files) == 0) {
1141+
add_dummy_row(model, file_entry);
1142+
changed = TRUE;
1143+
}
11321144
}
11331145

11341146
file_entry->expanding = FALSE;

0 commit comments

Comments
 (0)