AW: bugfix KHTMLPart::started(KIO::Job *job)

Grimm, Cornelius grimm at valudo.de
Wed Aug 27 16:21:02 BST 2003


> Ok, I see. My problem is, the signal "complete()" sometimes is emitted
> before the page is completely loaded and parsed. I don't know 

It seems to be a bug indeed.

Let's have a look into khtml_part.cpp...

"slotLoaderRequestDone()" calls checkComplete(), which somewhere looks if
there is a document (d->m_doc) and if so, how many requests are running for
this document. If there are no requests running (and after some other
checks), it does the stuff it should do when the page is complete, including
the emittion the "completed()" signal.

Now, if "slotLoaderRequestDone()" get's called _before_ the document exists,
checkComplete does the completion stuff. And the document is created in
begin(), which is called when the first piece of data arrives. This might
happen later than the call of "slotLoaderRequestDone()".

A solution to this would be to cancel checkComplete() if there is no
document, but maybe it's not the best one.

Strangely enough, slotLoaderRequestDone() seems only to be called if there
exist more than one KHTMLPart at a time. (?)

Any ideas, any comments? ;-)

Cornelius




More information about the kfm-devel mailing list