Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 07:17 PM   #151
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: 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 ...
KevinH is online now   Reply With Quote
Old Yesterday, 07:27 PM   #152
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: 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.
KevinH is online now   Reply With Quote
Advert
Old Yesterday, 07:43 PM   #153
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: 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());
to

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 am hoping that the problem is related to file locking in the local QtWebEngine file cache.

I have my fiingers crossed, one of these last two will impact the error.
KevinH is online now   Reply With Quote
Old Yesterday, 08:34 PM   #154
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: 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.
DiapDealer is online now   Reply With Quote
Old Yesterday, 09:08 PM   #155
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: 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.
Attached Files
File Type: txt sigil_debug.txt (3.6 KB, 4 views)
DNSB is online now   Reply With Quote
Advert
Old Yesterday, 09:37 PM   #156
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: 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.
KevinH is online now   Reply With Quote
Old Today, 04:59 AM   #157
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: 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.

Click image for larger version

Name:	works.png
Views:	10
Size:	479.0 KB
ID:	220927
Attached Files
File Type: zip morning-debug.zip (2.4 KB, 1 views)
File Type: zip debug-after-change-mainwindow.zip (2.2 KB, 1 views)
BeckyEbook is offline   Reply With Quote
Old Today, 09:23 AM   #158
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: 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.
DiapDealer is online now   Reply With Quote
Old Today, 09:55 AM   #159
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: 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.
KevinH is online now   Reply With Quote
Old Today, 12:19 PM   #160
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: 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.
KevinH is online now   Reply With Quote
Old Today, 12:48 PM   #161
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: 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.
KevinH is online now   Reply With Quote
Old Today, 02:49 PM   #162
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: 939
Karma: 3501230
Join Date: Jan 2017
Location: Poland
Device: Various
It works for me.

But… this commit fixed the issue described in this thread.

Now you need to click the "Refresh" button (which doesn't bother me personally – just letting you know).
BeckyEbook is offline   Reply With Quote
Old Today, 03:14 PM   #163
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: 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.
KevinH is online now   Reply With Quote
Old Today, 03:22 PM   #164
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: 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.

Click image for larger version

Name:	alice.png
Views:	3
Size:	600.5 KB
ID:	220947

Click image for larger version

Name:	Ruben.png
Views:	5
Size:	230.1 KB
ID:	220948

Last edited by BeckyEbook; Today at 03:29 PM.
BeckyEbook is offline   Reply With Quote
Old Today, 04:01 PM   #165
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: 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.
KevinH is online now   Reply With Quote
Reply


Forum Jump

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


All times are GMT -4. The time now is 10:52 PM.


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