diff options
author | Corey Berla <corey@berla.me> | 2023-01-23 07:41:45 -0800 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2023-03-01 09:22:41 +0000 |
commit | 27448259def187391ecad0eb739a72fd797167bc (patch) | |
tree | 47021c41554606ac661864ac25ee6405ff482f7a /src | |
parent | cf0f4245173111bb1a6daa814e53ac970479f607 (diff) | |
download | nautilus-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
Diffstat (limited to 'src')
-rw-r--r-- | src/nautilus-list-base.c | 4 |
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 |