[bt-devel] couple of non-working commits
Eeli Kaikkonen
eekaikko at mail.student.oulu.fi
Fri Nov 16 16:16:35 MST 2007
On Fri, 16 Nov 2007, Eeli Kaikkonen wrote:
> I looked in the KDE svn. 3.96 tag has associateWidget() but 3.94 and
> 3.95 do not. That is not a real problem, but khtml is. When I first saw
> our code which creates the html renderer I thought that it was an ugly
> hack or something. Then I learned that it is the fault of khtml: it has
> a circular dependency between khtmlpart and khtmlview. We create the
> khtmlview on the fly while khtmlpart is still being initialized and the
> khtmlpart pointer is given to the khtmlview constructor. It is not a
> very good idea but no matter how hard I read the docs and think about it
> I cannot find a way to do it otherwise if we want to inherit from
> khtmlview.
I compared the khtmlview.cpp versions 3.94 and 3.95. It is just like I
suspected: our way of creating the part and the view is a hack because
the internal behaviour of the constructor methods is naturally
undefined. The change is this in the KHTMLView::init() method:
@@ -514,13 +518,8 @@
- // ### we'll enable redirection of khtmlview
- // when event issues have been thoroughly worked out
-
- bool redirect = false; // m_part->parentPart() && !isFrame() ...
-
+ bool redirect = m_part->parentPart();
m_kwp->setIsRedirected( redirect );
- d->staticWidget = redirect;
}
The init() method is called from the constructor. It means that
KHTMLPart::parentPart() is called before the KHTMLPart object is ready.
It leads to memory access violation.
I discussed about this in #kde4-devel and will write an email. We will
see where this leads to.
Yours,
Eeli Kaikkonen (Mr.), Oulu, Finland
e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)
More information about the bt-devel
mailing list