Revision: 1328
          http://geeqie.svn.sourceforge.net/geeqie/?rev=1328&view=rev
Author:   nadvornik
Date:     2009-01-02 23:14:01 +0000 (Fri, 02 Jan 2009)

Log Message:
-----------
fixed updating of selection after deleting the last image from the list

Modified Paths:
--------------
    trunk/src/view_file_icon.c
    trunk/src/view_file_list.c

Modified: trunk/src/view_file_icon.c
===================================================================
--- trunk/src/view_file_icon.c  2009-01-02 22:57:09 UTC (rev 1327)
+++ trunk/src/view_file_icon.c  2009-01-02 23:14:01 UTC (rev 1328)
@@ -1036,6 +1036,7 @@
 static void vficon_select_closest(ViewFile *vf, FileData *sel_fd)
 {
        GList *work;
+       IconData *id = NULL;
        
        if (sel_fd->parent) sel_fd = sel_fd->parent;
        work = vf->list;
@@ -1043,21 +1044,22 @@
        while (work)
                {
                gint match;
-               IconData *id = work->data;
-               FileData *fd = id->fd;
+               FileData *fd;
+               
+               id = work->data;
+               fd = id->fd;
                work = work->next;
-               
 
                match = filelist_sort_compare_filedata_full(fd, sel_fd, 
vf->sort_method, vf->sort_ascend);
                
-               if (match >= 0)
-                       {
-                       vficon_select(vf, id);
-                       vficon_send_layout_select(vf, id);
-                       break;
-                       }
+               if (match >= 0) break;
                }
-
+       
+       if (id)
+               {
+               vficon_select(vf, id);
+               vficon_send_layout_select(vf, id);
+               }
 }
 
 

Modified: trunk/src/view_file_list.c
===================================================================
--- trunk/src/view_file_list.c  2009-01-02 22:57:09 UTC (rev 1327)
+++ trunk/src/view_file_list.c  2009-01-02 23:14:01 UTC (rev 1328)
@@ -1518,6 +1518,7 @@
 static void vflist_select_closest(ViewFile *vf, FileData *sel_fd)
 {
        GList *work;
+       FileData *fd = NULL;
        
        if (sel_fd->parent) sel_fd = sel_fd->parent;
        work = vf->list;
@@ -1525,19 +1526,16 @@
        while (work)
                {
                gint match;
-               FileData *fd = work->data;
+               fd = work->data;
                work = work->next;
-               
 
                match = filelist_sort_compare_filedata_full(fd, sel_fd, 
vf->sort_method, vf->sort_ascend);
                
-               if (match >= 0)
-                       {
-                       vflist_select_by_fd(vf, fd);
-                       break;
-                       }
+               if (match >= 0) break;
                }
 
+       if (fd) vflist_select_by_fd(vf, fd);
+
 }
 
 void vflist_mark_to_selection(ViewFile *vf, gint mark, MarkToSelectionMode 
mode)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Geeqie-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geeqie-svn

Reply via email to