|
|
#151 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,316
Karma: 6686152
Join Date: Nov 2009
Device: many
|
And interesting enough, line 7 in that Chapter 7 xhtml file is:
<link href="css/style.css" type="text/css" rel="stylesheet"/> So the bug happens when trying to load the css file that is open but not the first time. The first time it worked. But when using the cache it ties to get the contents of the css/styl.css that is being actively edited and fails! So my guess is this is due to some Windows specific file locking. Hmm ... |
|
|
|
|
|
#152 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,316
Karma: 6686152
Join Date: Nov 2009
Device: many
|
@BeckyEbook,
I wonder if this has anything to do with the actual file cache used by WebEngine. Would you please try the following using the debug build. 1. open an epub in Sigil (any epub) 2. Without closing the first Sigil, open a second instance of Sigil and load the Alice epub and run the test but only in the second instance. Thanks! Last edited by KevinH; Yesterday at 11:03 PM. |
|
|
|
|
|
#153 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,316
Karma: 6686152
Join Date: Nov 2009
Device: many
|
And one more thing to try if you have time ...
In Sigil/src/MainUI/MainWindow.cpp there is a a routine called UpdatePreview. In this routine I would like you to comment out the line that clears the cache, then try and see if that prevents the error. From: Code:
void MainWindow::UpdatePreview()
{
if (m_IsClosing) return;
m_PreviewTimer.stop();
DBG qDebug() << "MW: UpdatePreview()";
QString text;
QList<ElementIndex> location;
HTMLResource *html_resource;
ContentTab *tab = GetCurrentContentTab();
if (tab != NULL) {
// Save Tab if update requested from a TextTab tab like CSS or SVG tabs
if (m_SaveTab) {
m_SaveTab = false;
tab->SaveTabContent();
m_PreviewWindow->ForceFullWebCacheClear();
}
html_resource = qobject_cast<HTMLResource *>(tab->GetLoadedResource());
Code:
void MainWindow::UpdatePreview()
{
if (m_IsClosing) return;
m_PreviewTimer.stop();
DBG qDebug() << "MW: UpdatePreview()";
QString text;
QList<ElementIndex> location;
HTMLResource *html_resource;
ContentTab *tab = GetCurrentContentTab();
if (tab != NULL) {
// Save Tab if update requested from a TextTab tab like CSS or SVG tabs
if (m_SaveTab) {
m_SaveTab = false;
tab->SaveTabContent();
// m_PreviewWindow->ForceFullWebCacheClear();
}
html_resource = qobject_cast<HTMLResource *>(tab->GetLoadedResource());
I have my fiingers crossed, one of these last two will impact the error. |
|
|
|
|
|
#154 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,076
Karma: 211348980
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I am mobile-devices-only until tomorrow sometime, or I would test.
|
|
|
|
|
|
#155 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 50,237
Karma: 178398938
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
This may not be any help but I tried your suggestion for triggering the issue with my local build using Python 3.14.3/Qt 6.10.2 and the debug log does not show any errors. Up to this point, I hadn't realized that I had updated to 3.14.3 instead of 3.14.2.
|
|
|
|
|
|
#156 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,316
Karma: 6686152
Join Date: Nov 2009
Device: many
|
That is strange. The code paths in question do not use python3lib code as far as I can tell, so I have no explanation why one Windows person sees a javascript error that causes the Preview to not properly reload and move to its last location, while another does not see the issue or error at all.
The mystery deepens. Last edited by KevinH; Today at 12:13 AM. |
|
|
|
|
|
#157 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 934
Karma: 3501230
Join Date: Jan 2017
Location: Poland
Device: Various
|
It was already nighttime where I am, so I only checked it now.
1. The test with two instances still caused an error. (I removed debug for childs form PreviewWindow.cpp, so the log is cleaner). 2. The change in MainWindow.cpp made it work! Note that I am editing the CSS file, but in the preview window I am still in the previous location, which is how it should be. |
|
|
|
|
|
#158 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,076
Karma: 211348980
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm not where I can build from your fork, but I can also confirm that with the current Sigil, the behavior doesn't change with the second instance of Sigil.
|
|
|
|
|
|
#159 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,316
Karma: 6686152
Join Date: Nov 2009
Device: many
|
@BeckyEBook
Thank you. So it is related to the asynchronous clearing of the cache on Windows somehow. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suggestions for Sigil Improvements or New Features | KevinH | Sigil | 168 | 11-18-2025 01:23 PM |
| Suggestions for New Plugins and Plugin Improvements | KevinH | Plugins | 0 | 09-22-2025 11:53 AM |
| Ideas for New Improvements or Features | KevinH | Sigil | 97 | 04-09-2025 10:45 AM |
| Improvements/bugs/features | dontcrash | KOReader | 10 | 10-23-2019 11:05 AM |
| Onyx M92: Suggestions for possible improvements | Lode | Onyx Boox | 3 | 02-11-2013 08:40 AM |