[Xfce4-commits] <ristretto:master> Move the iterators forward when removing an image.

Stephan Arts noreply at xfce.org
Sun Sep 18 19:34:01 CEST 2011


Updating branch refs/heads/master
         to 17a69b951475e968b19f298e1ec4ed6625c17d1c (commit)
       from 126a21a62582cc454e844ec271de45f1001ebd83 (commit)

commit 17a69b951475e968b19f298e1ec4ed6625c17d1c
Author: Stephan Arts <stephan at xfce.org>
Date:   Sun Sep 18 19:32:27 2011 +0200

    Move the iterators forward when removing an image.

 src/image_list.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/image_list.c b/src/image_list.c
index b6d3e10..e86d9ed 100644
--- a/src/image_list.c
+++ b/src/image_list.c
@@ -260,13 +260,13 @@ rstto_image_list_remove_file (RsttoImageList *image_list, GFile *file)
         {
             if (g_file_equal(rstto_image_list_iter_get_file (iter->data), file))
             {
-                if (0 == rstto_image_list_iter_get_position (iter->data))
+                if (rstto_image_list_iter_get_position (iter->data) == rstto_image_list_get_n_images (image_list)-1)
                 {
-                    rstto_image_list_iter_next (iter->data);
+                    rstto_image_list_iter_previous (iter->data);
                 }
                 else
                 {
-                    rstto_image_list_iter_previous (iter->data);
+                    rstto_image_list_iter_next (iter->data);
                 }
                 /* If the image is still the same, 
                  * it's a single item list,
@@ -291,7 +291,7 @@ rstto_image_list_remove_file (RsttoImageList *image_list, GFile *file)
             {
                 if (g_file_equal(afile, file))
                 {
-                    rstto_image_list_iter_previous (iter->data);
+                    rstto_image_list_iter_next (iter->data);
                 }
             }
             iter = g_slist_next (iter);


More information about the Xfce4-commits mailing list