int gui_vfslist_searchnext ( struct gui_vfslist gv,
const struct vfsmatch vm 
)

Change the selection to the first item that matches the globally defined search string gui_input_cursearch.

Definition at line 564 of file gui_vfslist.c.

00565 {
00566         struct vfsref *vr;
00567         unsigned int idx;
00568 
00569         g_assert(vm != NULL);
00570 
00571         if (gv->vr_selected == NULL)
00572                 return (-1);
00573 
00574         /* Step 1: search from selection to end */
00575         for (vr = vfs_list_next(gv->vr_selected), idx = gv->idx_selected + 1;
00576             vr != NULL; vr = vfs_list_next(vr), idx++) {
00577                 if (vfs_match_compare(vm, vfs_name(vr))) {
00578                         gui_msgbar_flush();
00579                         goto found;
00580                 }
00581         }
00582 
00583         /* Step 2: search from beginning to selection */
00584         for (vr = vfs_list_first(gv->list), idx = 1;
00585             vr != vfs_list_next(gv->vr_selected);
00586             vr = vfs_list_next(vr), idx++) {
00587                 if (vfs_match_compare(vm, vfs_name(vr))) {
00588                         gui_msgbar_warn(_("Search wrapped to top."));
00589                         goto found;
00590                 }
00591         }
00592 
00593         return (-1);
00594 
00595 found:  /* Select our found item */
00596         gv->vr_selected = vr;
00597         gv->idx_selected = idx;
00598 
00599         /* No need to redraw, as window switching is performed */
00600         return (0);
00601 }

Here is the call graph for this function:

Here is the caller graph for this function:

 All Data Structures Files Functions Variables Defines
Generated on Mon Mar 15 04:45:36 2010 for herrie by  doxygen 1.6.3