Page is not reloaded in a KHTML part
Andras Mantia
amantia at kde.org
Thu Mar 11 09:12:24 GMT 2004
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 11 March 2004 11:02, Tobias Anton wrote:
[...]
> have a look at khtmlpart.cpp:
I saw this.
>
> bool KHTMLPart::setEncoding( const QString &name, bool override )
> {
> d->m_encoding = name;
> d->m_haveEncoding = override;
>
> if( !m_url.isEmpty() ) {
> // reload document
> closeURL();
> KURL url = m_url;
> m_url = 0;
> d->m_restored = true;
> openURL(url);
> d->m_restored = false;
> }
>
> return true;
> }
>
> If you call setEncoding() immediately after openURL(), the page is supposed
> to be reloaded, but before the request can actually be issued, it gets
> aborted by closeURL(), then the cache policy gets changed and the request
> is re-issued with caching turned on.
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?
>
> > 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.
Andras
- --
Quanta Plus developer - http://quanta.sourceforge.net
K Desktop Environment - http://www.kde.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAUC14TQdfac6L/08RAtC7AKCVOUCGybMgZayDGOTUGAFUEvWR2QCfRigB
eI94ijyqKNWWpayWD6Z8kTk=
=K2si
-----END PGP SIGNATURE-----
More information about the kfm-devel
mailing list