View Single Post
Old 04-05-2019, 01:51 PM   #127
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,771
Karma: 206758686
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
I bet one version is using unix style path separators and the other is using windows path separators or one is escaped and one is not. If so, this should be an easy fix. So when you get a free moment, please use qDebug() to output both paths so that we can see what is actually going on.

So no, it should never flush the cache until it is asked to load a different tab. Moving a cursor should do nothing. Even editing in the same tab should do nothing, making the cache actually useful.

As soon as we see why that url path differs from path only on Windows we should be able to fix it (even if we need to tell Preview to remember its last url path itself).
It doesn't seem to be the path separator. I pushed some debug prints to my Sigil Fork from work and than ran the Appveyor build created from the commit.

On Windows, there seems to be a forward slash prepended to url().path() that doesn't exist in the passed-in "path" parameter. So they're never equal. For example on the default epub Sigil creates upon opening:

url().path() = /C:/Users/FPC PC/AppData/Local/Temp/Sigil-SKylwq/OEBPS/Text/Section0001.xhtml

and the path parameter = C:/Users/FPC PC/AppData/Local/Temp/Sigil-SKylwq/OEBPS/Text/Section0001.xhtml

Hence the decision to clear the cache is being made every single time.

Perhaps:

Code:
if (url().toLocalFile() != path)
would be a better cross-platform comparison?

Last edited by DiapDealer; 04-05-2019 at 02:00 PM.
DiapDealer is offline   Reply With Quote