[gtk/matthiasc/for-master: 50/50] directorylist: Fix file monitoring implementation



commit 20843ffdf5b0d896cc1be539bf962d5695b97ee5
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 8 13:41:01 2020 -0400

    directorylist: Fix file monitoring implementation
    
    The while loops were never advancing the iterator.
    Oops.

 gtk/gtkdirectorylist.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkdirectorylist.c b/gtk/gtkdirectorylist.c
index b4a0d10014..feb3ed044c 100644
--- a/gtk/gtkdirectorylist.c
+++ b/gtk/gtkdirectorylist.c
@@ -570,8 +570,9 @@ got_existing_file_info_cb (GObject      *source,
 
   g_file_info_set_attribute_object (info, "standard::file", G_OBJECT (file));
 
-  iter = g_sequence_get_begin_iter (self->items);
-  while (!g_sequence_iter_is_end (iter))
+  for (iter = g_sequence_get_begin_iter (self->items);
+       !g_sequence_iter_is_end (iter);
+       iter = g_sequence_iter_next (iter))
     {
       GFileInfo *item = g_sequence_get (iter);
       GFile *f = G_FILE (g_file_info_get_attribute_object (item, "standard::file"));
@@ -591,8 +592,9 @@ gtk_directory_list_remove_file (GtkDirectoryList *self,
 {
   GSequenceIter *iter;
 
-  iter = g_sequence_get_begin_iter (self->items);
-  while (!g_sequence_iter_is_end (iter))
+  for (iter = g_sequence_get_begin_iter (self->items);
+       !g_sequence_iter_is_end (iter);
+       iter = g_sequence_iter_next (iter))
     {
       GFileInfo *item = g_sequence_get (iter);
       GFile *f = G_FILE (g_file_info_get_attribute_object (item, "standard::file"));


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