Created attachment 23850 [details] [review] improves error reporting in poppler-glib I modified poppler so that if 'ErrOpenFile' occurs from running poppler_document_new_from_file(uri, password, error), the resulting GError will be a G_FILE_ERROR with the appropriate code and message for the circumstances. It is now possible, for instance, for a program using poppler-glib to distinguish 'file not found', 'no permission', 'is a directory', etc. errors. I started from the git repository today and I've come up with the attached patch.
This patch also gets rid of what I think many would consider undesirable behaviour allowing, to some extent, case-insensitive matching of file names. It used to try opening, for example, "fileName.Pdf", then failing that try opening "filename.pdf", then failing that try opening "FILENAME.PDF". This attempt at matching the case doesn't make sense in a case-sensitive file system. Also, it would try to open "filename.pdf" without even checking the reason why opening "fileName.Pdf" had failed in the first place, meaning that it could have initially been a problem with file permissions.
Do not remove the multicase behaviour, if you want to propose that, send a separate patch in a separate bug.
Created attachment 23865 [details] [review] this version leaves the multicase behaviour alone for the most part (see comment). This one is the same as the last one but with the asinine multicase behaviour reincorporated and made somewhat more sane. This time, it only tries a different name if the error returned is ENOENT (no such file or directory).
Carlos what do you say about the glib side of the patch? I'm thinking of commiting it to trunk only btw
Created attachment 24125 [details] [review] minor adjustments, added commentary This patch follows immediately after the patch that leaves the multicase behaviour alone. I made some minor adjustments and added some commentary. By the way, Albert, what do you mean by 'trunk'. I thought that was a subversion thing.
I'm a subversion man ;-) s/trunk/master, that is the development branch, not the stable (0.10.x) one BTW the patch is a bit wrong, the error line should be filename->getCString and not fn->getCString() but no need to post a new patch i'll fix it when commiting once Carlos says the glib part is ok.
(In reply to comment #4) > Carlos what do you say about the glib side of the patch? I'm thinking of > commiting it to trunk only btw > looks good to me.
Commited
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.