Quote:
Originally Posted by KevinH
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?