Page is not reloaded in a KHTML part
Andras Mantia
amantia at kde.org
Wed Mar 10 09:55:24 GMT 2004
David Faure wrote:
> Hmm? Why do you use begin/end if you use openURL?
> I suggest dropping the begin and end.
>
Because sometimes the content is not loaded from a file. ;-) But I've tried
without the begin/end, the problem remains.
Meantime I've added some debug info to KHTMLPart::openURL, and was surprised
to see the following:
- the cache policy is set to KIO::CC_Refresh
- KIO::get is called with this policy
- the cache policy is set to KIO::CC_Cache
- KIO::get is called with this policy
Now why is it called again? Because I have a KHTMLPart::setEncoding() call
after KHTMLPart::openURL (I forgot to paste this in the origian mail). This
calls closeURL() and openURL(), but closeURL resets the cache policy and
openURL will reload from the cache. Now this wouldn't be bad, but in the
cache there isn't the last version, which was just loaded. So
part->openURL(url);
part->setEncoding(someencoding, true);
part->show();
does not work as expected. What can I do to load an URL and set the encoding
I want afterwards and avoid the above problem? I may put the encoding
setting prior to openURL, but in this case will it be used for the url I
want to open? Answer: *seems* to do so, but I still think this is a problem
with the cache handling, as the file is not put to the cache when the first
openURL is called.
Andras
More information about the kfm-devel
mailing list