Page is not reloaded in a KHTML part

Tobias Anton TA at ESC-Electronics.de
Thu Mar 11 11:46:28 GMT 2004


On Donnerstag, 11. März 2004 10:12, Andras Mantia wrote:
> On Thursday 11 March 2004 11:02, Tobias Anton wrote:
> So you mean that the page is not yet loaded fully, so it's not in the cache
> and the openURL in the setEncoding will get the old version of the file
> from the cache?

I didn't write the KIO-slave, so I'm not 100% sure about it. But I assume that 
the cache entry of a request is not deleted when the request is made, but 
when the response arrives.

So if the reload request is canceled before completion, the cached copy still 
exists and thus gets used in the following cached read operation.

> > > What can I do to load an URL and set the
> > > encoding I want afterwards and avoid the above problem?
> >
> > I think the flag "d->m_restored" should only be changed if the current
> > page is already completely loaded. This requires some additional logic in
> > setEncoding(), however.
>
> If the above one is the reason of the problem, I think it makes sense to
> use some flag and use the cache only if the file was completely loaded.

No, I think the existing set of flags and variables is completely sufficient 
to determine whether the request is still running. Examine for example 
d->m_workingURL, d->m_bComplete, d->m_doc->parsing() and things like that.

Another option would be deleting the cache entry before the reload request. 
That can be done through a special command in KIO:
	KIO::http_update_cache(url, true, 0);

Better Ideas, anyone?

Cheers,
Tobias




More information about the kfm-devel mailing list