diff options
author | Corey Berla <corey@berla.me> | 2023-04-10 12:56:08 -0700 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2023-04-11 01:28:45 -0400 |
commit | e041f7bf71bff3f100ce56bf991ae7826562649d (patch) | |
tree | 391f24ee0bee4e037e1bce597a807244b9f913ac | |
parent | f15aa82eaf4a8d9498b53e3e416d2ac21d6b24f4 (diff) | |
download | gtk+-e041f7bf71bff3f100ce56bf991ae7826562649d.tar.gz |
filesystemmodel: Notify correct position removed in remove_file()
32247bc50e63b709ae738a95a2ec71345b5fad75 made several changes to account for the
fact that we no longer have a NULL editable at the beginning of the list
model. The commit mistakenly left out one change in remove_file(),
which causes the wrong file to be removed.
(cherry picked from commit faac2f7894608eef7e3884897b6a38da854e0fa8)
-rw-r--r-- | gtk/gtkfilesystemmodel.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index c830751642..2ff527b7b4 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -331,8 +331,6 @@ list_model_get_item (GListModel *list_model, GtkFileSystemModel *model = GTK_FILE_SYSTEM_MODEL (list_model); FileModelNode *node; - /* The first items of GtkFileSystemModel is not really a file, - * so ignore it. */ if (position >= model->files->len) return NULL; @@ -502,7 +500,7 @@ remove_file (GtkFileSystemModel *model, g_array_remove_index (model->files, id); - g_list_model_items_changed (G_LIST_MODEL (model), id - 1, 1, 0); + g_list_model_items_changed (G_LIST_MODEL (model), id, 1, 0); } static void |