From 27448259def187391ecad0eb739a72fd797167bc Mon Sep 17 00:00:00 2001 From: Corey Berla Date: Mon, 23 Jan 2023 07:41:45 -0800 Subject: [PATCH] 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 --- src/nautilus-list-base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/nautilus-list-base.c b/src/nautilus-list-base.c index 5bd797a36e..9965d2e36b 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 -- GitLab