void feh_filelist_image_remove(winwidget winwid, char do_delete) { if (winwid->type == WIN_TYPE_SLIDESHOW) { char *s; gib_list *doomed; doomed = current_file; slideshow_change_image(winwid, SLIDE_NEXT, 0); if (do_delete) filelist = feh_file_rm_and_free(filelist, doomed); else filelist = feh_file_remove_from_list(filelist, doomed); if (!filelist) { /* No more images. Game over ;-) */ winwidget_destroy(winwid); return; } s = slideshow_create_name(FEH_FILE(winwid->file->data), winwid); winwidget_rename(winwid, s); free(s); winwidget_render_image(winwid, 1, 0); } else if ((winwid->type == WIN_TYPE_SINGLE) || (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) { if (do_delete) filelist = feh_file_rm_and_free(filelist, winwid->file); else filelist = feh_file_remove_from_list(filelist, winwid->file); winwidget_destroy(winwid); } }
void feh_filelist_image_remove(winwidget winwid, char do_delete) { if (winwid->type == WIN_TYPE_SLIDESHOW) { char *s; gib_list *doomed; doomed = current_file; /* * work around feh_list_jump exiting if cycle_once is enabled * and no further files are left (we need to delete first) */ if (opt.cycle_once && ! doomed->next && do_delete) { feh_file_rm_and_free(filelist, doomed); exit(0); } if (doomed->next) { slideshow_change_image(winwid, SLIDE_NEXT, 0); } else { slideshow_change_image(winwid, SLIDE_PREV, 0); } if (do_delete) filelist = feh_file_rm_and_free(filelist, doomed); else filelist = feh_file_remove_from_list(filelist, doomed); if (!filelist) { /* No more images. Game over ;-) */ winwidget_destroy(winwid); return; } s = slideshow_create_name(FEH_FILE(winwid->file->data), winwid); winwidget_rename(winwid, s); free(s); winwidget_render_image(winwid, 1, 0); } else if ((winwid->type == WIN_TYPE_SINGLE) || (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) { if (do_delete) filelist = feh_file_rm_and_free(filelist, winwid->file); else filelist = feh_file_remove_from_list(filelist, winwid->file); winwidget_destroy(winwid); } }
void feh_filelist_image_remove(winwidget winwid, char do_delete) { if (winwid->type == WIN_TYPE_SLIDESHOW) { gib_list *doomed; doomed = current_file; /* * work around feh_list_jump exiting if ON_LAST_SLIDE_QUIT is set * and no further files are left (we need to delete first) */ if (opt.on_last_slide == ON_LAST_SLIDE_QUIT && ! doomed->next && do_delete) { feh_file_rm_and_free(filelist, doomed); exit(0); } if (doomed->next) { slideshow_change_image(winwid, SLIDE_NEXT, 0); } else { slideshow_change_image(winwid, SLIDE_PREV, 0); } if (do_delete) filelist = feh_file_rm_and_free(filelist, doomed); else filelist = feh_file_remove_from_list(filelist, doomed); if (!filelist) { /* No more images. Game over ;-) */ winwidget_destroy(winwid); return; } winwidget_render_image(winwid, 1, 0); } else if ((winwid->type == WIN_TYPE_SINGLE) || (winwid->type == WIN_TYPE_THUMBNAIL_VIEWER)) { if (do_delete) filelist = feh_file_rm_and_free(filelist, winwid->file); else filelist = feh_file_remove_from_list(filelist, winwid->file); winwid->file = NULL; winwidget_destroy(winwid); } }