Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-06-2025, 12:14 PM   #31
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,570
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.
DiapDealer is offline   Reply With Quote
Old 06-06-2025, 12:17 PM   #32
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,763
Karma: 5706256
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by DiapDealer View Post
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.
So using a non-native QFileDialog box did not help?
KevinH is online now   Reply With Quote
Advert
Old 06-06-2025, 12:25 PM   #33
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,570
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
So using a non-native QFileDialog box did not help?
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.
DiapDealer is offline   Reply With Quote
Old 06-06-2025, 12:44 PM   #34
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,763
Karma: 5706256
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.
KevinH is online now   Reply With Quote
Old 06-06-2025, 01:16 PM   #35
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
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
I get the following message.
Click image for larger version

Name:	native-add-files.png
Views:	28
Size:	37.1 KB
ID:	216042
BeckyEbook is offline   Reply With Quote
Advert
Old 06-06-2025, 01:32 PM   #36
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,763
Karma: 5706256
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!
KevinH is online now   Reply With Quote
Old 06-06-2025, 01:50 PM   #37
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,570
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.
DiapDealer is offline   Reply With Quote
Old 06-06-2025, 02:00 PM   #38
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,727
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by KevinH View Post
A user can of course use any web browser to download and store locally any number of files if they so desire.
Shameless plug: or they could use my PasteImage plugin and have it download the file and add it to the epub.
It didn't work for the fish image though, but it worked with pretty much any other Internet image.
Doitsu is offline   Reply With Quote
Old 06-06-2025, 03:12 PM   #39
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 46,191
Karma: 168983734
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.
Attached Thumbnails
Click image for larger version

Name:	Screenshot 2025-06-06 121208.png
Views:	19
Size:	139.7 KB
ID:	216043  
DNSB is offline   Reply With Quote
Old 06-06-2025, 07:21 PM   #40
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,763
Karma: 5706256
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,
So will someone with access to Windows try one of the other getOpenFileName instances above and try hand typing in an external url and hitting open and verifying if any of these crash. If so, we may need to move to non-native QFileDialogs for Windows throughout the Sigil code. If not, we will have found and fixed the only occurrence.

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.
KevinH is online now   Reply With Quote
Old 06-06-2025, 08:32 PM   #41
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
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.
Attached Thumbnails
Click image for larger version

Name:	sigil-external-browse-jpg.png
Views:	20
Size:	15.0 KB
ID:	216056  
BeckyEbook is offline   Reply With Quote
Old 06-06-2025, 08:45 PM   #42
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
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.
BeckyEbook is offline   Reply With Quote
Old 06-06-2025, 09:43 PM   #43
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
Posts: 13,511
Karma: 78910202
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:
Code:
<html><head><title>Request Rejected</title></head><body>The requested URL was rejected. Please consult with your administrator.<br><br>Your support ID is: < 6919071033828809802><br><br><a href='javascript:history.back();'>
PeterT is offline   Reply With Quote
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,763
Karma: 5706256
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 online now   Reply With Quote
Old 06-06-2025, 11:03 PM   #45
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,763
Karma: 5706256
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by PeterT View Post
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
Interesting. Lots of websites seem to reject wget and curl requests that do not use https: and instead use http: and visa versa since there is no security.

It is my understanding the error in question happens when the user types in any external url, not just that particular one.
KevinH is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 02:30 PM.


MobileRead.com is a privately owned, operated and funded community.