FL-PicSee update to "Open another..." on multiple files

Post date: Sep 13, 2010 3:54:23 AM

TinyCore Linux forum member Jur noticed that the "Open another..." command seemed to allow the user to select multiple files, but did not actually add more than one to the current display set, although it did if the user starts FL-PicSee with no arguments. Up to version 1.2.6, there is a while loop in the startup code for when the user starts FL-PicSee with no arguments and selects one or more files in the File Chooser dialog box. However, there is no while loop in the "Open another..." handling code. So I decided to add a while loop to add multiple files to the viewing list if the user selects multiple files. Not a lot of new code, but makes FL-PicSee more friendly.

There is almost enough commonality between these two while loops I should be able to generalize and factor them out to a separate helper function or member function of the main window, but I held off for now. Jur was urging me to change the code to automatically allow the user to page through all image files in the current directory like many other image viewers. I may add that in the next major release, but doing it intelligently and not keep too many images loaded into memory will take a bit more code than I want to write at this point, so I think the next public release will be based on this new 1.2.7 version, and the "view all files in dir" be done in the next major release.

Edit: I should have also said while working and testing the above enhancement, I found an outright bug in the "Open another..." feature when FL-PicSee is built for the "nopaging" target. In version 1.2.6, a call to delete_image() is made, but some of the objects deleted are not later re-instantiated, so there was a segfault. I'm not sure when this regression snuck in. I'm pretty sure back in the 1.0 days, I could build the "nopaging" version and use the "Open another" command, where the first image is deleted and another is loaded. Anyway, the posted 1.2.7 code should have a valid fix for that configuration too.

Discuss the FL-PicSee beta 1.2.x at the Tiny Core Linux Forum.