|
|
#151 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
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,331
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. |
|
|
|
| Advert | |
|
|
|
|
#153 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
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,080
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,253
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.
|
|
|
|
| Advert | |
|
|
|
|
#156 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
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: 939
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,080
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,331
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. But does that change (to disable cache clear) break making real css changes show up in Preview? Last edited by KevinH; Today at 11:47 AM. |
|
|
|
|
|
#160 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
Karma: 6686152
Join Date: Nov 2009
Device: many
|
I tested that disabling cache clear change on MacOS with no issues, so I have pushed it to Sigil master with deploy so that others open Windows can check that it fixes the issue and that editing changes in the css are properly being reflected in the cached xhtml page.
Once the CI build is done, I will grab Windows ci build and post a link to it so that Windows users can test this latest change. |
|
|
|
|
|
#161 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
Karma: 6686152
Join Date: Nov 2009
Device: many
|
Okay, I have a version of Sigil 2.7.5 Beta with that one line change.
It has been posted to my personal github repo: https://github.com/kevinhendricks/Bu...nMac/releases/ The file you want is: Sigil-2.7.5-New_Test-Windows-x64-Setup.exe Please test the following scenario: 1. Open the public domain Alice epub and open Up Chapter 7 2. scroll down in Preview to half way in that chapter and click there in Preview to sync CodeView 3. Use BookBrowser to open styles.css in CodeView Does Preview after its refesh return to the point you scrolled to? 4. Now add the following at the top of styles.css body { background: red; } Does Preview which is still showing Chapter 7 reflect this change in css immediately? Last edited by KevinH; Today at 01:27 PM. |
|
|
|
|
|
#163 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
Karma: 6686152
Join Date: Nov 2009
Device: many
|
You needed to hit refresh? That is not good.
There is already another cache clear going on in ViewPreview.cpp in CustomSetDocument that should handle this case. So the first cache clear in MainWindow we commented out should not be needed anymore as long as the content tab (css/TextTab changes are properly written to disk. And they are. Please double verify with my ci build that you really do need the Refresh button. You should not. I think disk caching on Windows is just plain broken, where as using QtWebEngine NoCache setting is broken on all platforms. What a mess! Last edited by KevinH; Today at 04:19 PM. |
|
|
|
|
|
#164 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 939
Karma: 3501230
Join Date: Jan 2017
Location: Poland
Device: Various
|
Wait, wait…
In Alice change css body {background: red;} is OK (auto refersh) I need click "Refresh" only on SVG sample from @RbnJrg. Last edited by BeckyEbook; Today at 03:29 PM. |
|
|
|
|
|
#165 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,331
Karma: 6686152
Join Date: Nov 2009
Device: many
|
Hmm ... so an SVG tab being edited is not being treated the same as a CSS tab being edited.
I will look into why that is happening. |
|
|
|
![]() |
|
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 |