summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorey Berla <corey@berla.me>2023-01-23 07:41:45 -0800
committerOndrej Holy <oholy@redhat.com>2023-03-01 09:22:41 +0000
commit27448259def187391ecad0eb739a72fd797167bc (patch)
tree47021c41554606ac661864ac25ee6405ff482f7a
parentcf0f4245173111bb1a6daa814e53ac970479f607 (diff)
downloadnautilus-27448259def187391ecad0eb739a72fd797167bc.tar.gz
list-base: Sort after file-changes
When renaming a file in list-view or grid-view, the renamed file keeps its position (i.e. it isn't re-positioned into the new proper position) until a refresh). There is actually a more generalized problem where file changes on all attributes fail to cause the sort positions to be updated. For example, sorting by date modified and touching a file doesn't cause a re-sort. The file-changes signal from nautilus-directory, simply gives us the changed files for a given directory, without telling us what was changed so there's not an efficient way of detecting this. We do have a ::end-file-changes signal, that is only emitted once every batch of changes, so let's call nautilus_view_model_sort() then. If no sort changes are required, this will finish quite fast, so it seems like the best alternative. Fixes: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2568
-rw-r--r--src/nautilus-list-base.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c
index 5bd797a36..9965d2e36 100644
--- a/src/nautilus-list-base.c
+++ b/src/nautilus-list-base.c
@@ -1112,6 +1112,10 @@ real_is_empty (NautilusFilesView *files_view)
static void
real_end_file_changes (NautilusFilesView *files_view)
{
+ NautilusListBase *self = NAUTILUS_LIST_BASE (files_view);
+ NautilusListBasePrivate *priv = nautilus_list_base_get_instance_private (self);
+
+ nautilus_view_model_sort (priv->model);
}
static void