View Single Post
Old 04-05-2019, 02:11 PM   #129
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,593
Karma: 6774048
Join Date: Nov 2009
Device: many
Well that is a Problem!!

We can alawys special case this just for Windows and remove the beginning slash on the url part or prepend the initial / to the path part before comparison.

A QUrl path() should be to a local file in this case and should be the same url path returned by WebKit but it is obviously not on Windows. The path is the one from Webkit which does not have leading / on Windows.

I would just special case this for Windows and adjust one to properly match unless you know which of these two are technically incorrect?

We should probably push out a new Windows build (or point people at the appveyor builds) to stop this annoying behaviour.

Thanks for tracking this one down!

KevinH




Quote:
Originally Posted by DiapDealer View Post
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?
KevinH is offline   Reply With Quote