[nautilus] file: create filtered file lists in correct order



commit 87d4cbfcbef5c83319b9f4569cd36d7c1b2e14c2
Author: Ernestas Kulik <ernestask src gnome org>
Date:   Sat Nov 5 21:08:36 2016 +0200

    file: create filtered file lists in correct order
    
    nautilus_file_list_filter() creates lists in the wrong order, causing
    files activation to occur in the same fashion. This is caused by double
    reversal of the file list when filtering files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773988

 src/nautilus-file.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-file.c b/src/nautilus-file.c
index 4f63e39..f72645a 100644
--- a/src/nautilus-file.c
+++ b/src/nautilus-file.c
@@ -4121,15 +4121,13 @@ nautilus_file_list_filter (GList                   *files,
 {
     GList *filtered = NULL;
     GList *l;
-    GList *last;
     GList *reversed;
 
     *failed = NULL;
     /* Avoid using g_list_append since it's O(n) */
     reversed = g_list_copy (files);
     reversed = g_list_reverse (reversed);
-    last = g_list_last (reversed);
-    for (l = last; l != NULL; l = l->prev)
+    for (l = reversed; l != NULL; l = l->next)
     {
         if (filter_function (l->data, user_data))
         {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]