View Single Post
Old 06-06-2025, 10:56 PM   #44
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,915
Karma: 6120478
Join Date: Nov 2009
Device: many
I do not quite understand. Note that getOpenFileNames is a different routine from getOpenFileName. The former crashes and the latter you showed does not.

So we need the QFileDialog::getOpenFileNames to get a selection of one or more files. On Windows before we get access to what the user entered (or browsed and selected) in that one routine, it crashes if any external url was input by the user.

So there is no way to check if the file is readable until the user enters the file name, right?

If the crash happens after that method returns (and not during), then yes we could check if the file was readable and prevent the error.

I have no access to test Windows myself until I rebuild my Windows 11 virtual machine.

So does the input of an external url in the getOpenFileNames method cause the crash before that routine exits when open is selected, or does the crash happen only after that routine returns and it gives us the url the user entered?

My understanding is that it is the getOpenGpFileNames routine that is somehow crashing before it returns. Is that correct?


Quote:
Originally Posted by BeckyEbook View Post
I have to go to bed because it's almost 3 a.m. here.

But...
When trying to open an EPUB file from the web, e.g. https://github.com/Sigil-Ebook/Sigil...ork_rev15.epub, the file is first checked by the Utility::IsFileReadable function, which prevents a crash.

I suspect that this allows us to use the native window without any problems if we add this check to the BookBrowser::AddExisting() function as well.

I can only check it myself on Sunday, because tomorrow I have a day trip.

Last edited by KevinH; 06-06-2025 at 11:01 PM.
KevinH is offline   Reply With Quote