On Wed, 2003-03-26 at 11:40, Dave Lopata wrote:
> ...
> 
>       While Tuxpaint seems to find the last saved file just fine (so that
> when I launch TuxPaint, the last image I was working on gets loaded),
> when I use the "Open" button, it always pops up an error dialog saying
> "There are no saved files!".

Well, loading the last saved file calls tuxpaint.c:load_current() which
only needs to be able to read the file indicated in
~/.tuxpaint/current_id.txt.  But when you press the "Open" button, a
fair amount more work is done by tuxpaint.c:do_open(), starting with
reading in the entire directory.  If for any reason the readdir() fails,
it is not error checked, and will simply result in the number of files
being zero.  Subsequently, do_open() checks for zero files and pops up
the error dialog that you are seeing.

It would be nice if the readdir fails (as opposed to no files are found)
a different error message would be displayed: "The saved files directory
is unreadable!"

I don't know if readdir() failing is really your problem.  It is
followed by a qsort(), but I doubt if that is failing.  Then it is
followed by a loop which processes all files, updating the progress bar
as it goes, and producing thumbnails.  If this loop encounters SDL
errors loading the files, it should output error messages to stderr, so
if that's what's happening, you should run tuxpaint from a terminal
window so that you can see what's going on.  I haven't looked carefully
to see under what circumstances num_files might not be incremented in
this loop.  But if it ends up being 0, again the error message you're
seeing would appear.

Ben
-- 
Ben Armstrong <[EMAIL PROTECTED]>

_______________________________________________
Tuxpaint-dev mailing list
[EMAIL PROTECTED]
http://tux4kids.net/mailman/listinfo/tuxpaint-dev

Reply via email to