![]() |
#31 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,550
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm guessing it starts to go sideways when the code after the getOpenFileName tries to extract directory information from the url with QFileInfo. One of the tree views in the SelectFiles.cpp dialog turns grey just before Sigil crashes. That could still all point to a bug in Qt6 related to native windows filedialogs, though. I'll try to do some testing this weekend.
|
![]() |
![]() |
![]() |
#32 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
|
|
![]() |
![]() |
Advert | |
|
![]() |
#33 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,550
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I haven't had a chance to try it yet. I'm away from my development machine and just walking the code to try and familiarize myself with what's happening where.
Last edited by KevinH; 06-06-2025 at 12:41 PM. |
![]() |
![]() |
![]() |
#34 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Both the Mac non-native and the kde plasma supplied QFileDialog box handle the case of attempting an external file via a url while inside that QFileDialog static method. I would think the Windows version should do the same.
I have my fingers crossed! Last edited by KevinH; 06-06-2025 at 01:33 PM. |
![]() |
![]() |
![]() |
#35 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 839
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
I checked it.
Indeed, when changing the fragment in the BookBrowser::AddExisting() function: Code:
#if defined(Q_OS_WIN32) || defined(Q_OS_MAC) options = options | QFileDialog::DontUseNativeDialog; #endif |
![]() |
![]() |
Advert | |
|
![]() |
#36 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Perfect. That is the right thing to have happen here. So whatever bug is present is inside Qt6 where should properly handle excluding external file urls here. A user can of course use any web browser to download and store locally any number of files if they so desire.
Thank you! |
![]() |
![]() |
![]() |
#37 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,550
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Great. Thanks Becky! Now I can return to my plan to watch baseball all weekend.
![]() |
![]() |
![]() |
![]() |
#38 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,725
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
![]() It didn't work for the fish image though, but it worked with pretty much any other Internet image. |
|
![]() |
![]() |
![]() |
#39 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,961
Karma: 168961900
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Thanks @BeckyEbook! That modification works here. I did notice the Open stays greyed out and I had to hit enter to try to load the file and get the error message.
|
![]() |
![]() |
![]() |
#40 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
Join Date: Nov 2009
Device: many
|
I am wondering is this is the only file dialog that has the bug that causes a crash when hand entering an external url.
I grepped the Sigil source for "getOpenFileNames" and only found this routine in BookBrowser that BeckyEbook provided a fix for above. But if I instead grep "getOpenFileName" I get the following long list of places it is used in Sigil Code:
kbhend@MacBook-Pro src % grep getOpenFileName `find ./ -name "*.cpp"` .//Misc/OpenExternally.cpp: const QString selectedFile = QFileDialog::getOpenFileName(parent, .//MainUI/MainWindow.cpp: QString filename = QFileDialog::getOpenFileName(this, .//Dialogs/SearchEditor.cpp: QString filename = QFileDialog::getOpenFileName(this, .//Dialogs/IndexEditor.cpp: QString filename = QFileDialog::getOpenFileName(this, .//Dialogs/ClipEditor.cpp: QString filename = QFileDialog::getOpenFileName(this, .//Dialogs/PreferenceWidgets/PluginWidget.cpp: QString zippath = QFileDialog::getOpenFileName(this, .//Dialogs/PreferenceWidgets/PluginWidget.cpp: QString name = QFileDialog::getOpenFileName(this, .//Dialogs/PreferenceWidgets/GeneralSettingsWidget.cpp: QString xeditorPath = QFileDialog::getOpenFileName(this, .//Dialogs/EmptyLayout.cpp: QString inipath = QFileDialog::getOpenFileName(this, .//main.cpp: QString filename = QFileDialog::getOpenFileName(0, Looking at that list, the easiest one to test might be to open Sigil Preferences and try typing in an external url to the xeditor path where typically a path to PageEdit is put and see what happens. Thanks! Last edited by KevinH; 06-06-2025 at 07:26 PM. |
![]() |
![]() |
![]() |
#41 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 839
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
No crash, the link to the jpg file is inserted as a path.
|
![]() |
![]() |
![]() |
#42 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 839
Karma: 2657572
Join Date: Jan 2017
Location: Poland
Device: Various
|
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. |
![]() |
![]() |
![]() |
#43 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,472
Karma: 78880114
Join Date: Nov 2007
Location: Toronto
Device: Libra H2O, Libra Colour
|
I realize that this might be unimportant in the discussions of this particular URL but when I try a simple wget https://www.adfg.alaska.gov/static/f...ort_Fish.1.jpg I receive back a
Quote:
|
|
![]() |
![]() |
![]() |
#44 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
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:
Last edited by KevinH; 06-06-2025 at 11:01 PM. |
|
![]() |
![]() |
![]() |
#45 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,745
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Quote:
It is my understanding the error in question happens when the user types in any external url, not just that particular one. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
error from Sigil when loading particular epub file | JohnNC | Sigil | 15 | 08-08-2017 04:52 AM |
Sigil crashes when trying to add existing file | holdit | Sigil | 18 | 07-16-2013 06:59 AM |
Sigil Crashes on Win7 v0.6.2 When loading image | lissie | Sigil | 7 | 01-24-2013 05:05 AM |
Sigil file crashes Sony software | Quiss | Sigil | 12 | 08-14-2012 08:04 PM |