Plugin Toolbar problem

David Faure faure at kde.org
Tue Jun 22 22:23:26 BST 2004


On Tuesday 22 June 2004 23:17, Kevin Krammer wrote:
> I still think loading plugins should happen after the d pointer got 
> initialized.

Well did you try if this was enough to fix that problem?

Index: khtml_part.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/khtml_part.cpp,v
retrieving revision 1.1009
diff -u -p -r1.1009 khtml_part.cpp
--- khtml_part.cpp      19 Jun 2004 20:47:34 -0000      1.1009
+++ khtml_part.cpp      22 Jun 2004 21:21:38 -0000
@@ -163,8 +163,8 @@ KHTMLPart::KHTMLPart( QWidget *parentWid
 {
     d = 0;
     KHTMLFactory::registerPart( this );
-    setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
     init( new KHTMLView( this, parentWidget, widgetname ), prof );
+    setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
 }

 KHTMLPart::KHTMLPart( KHTMLView *view, QObject *parent, const char *name, GUIProfile prof )
@@ -172,9 +172,9 @@ KHTMLPart::KHTMLPart( KHTMLView *view, Q
 {
     d = 0;
     KHTMLFactory::registerPart( this );
-    setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
     assert( view );
     init( view, prof );
+    setInstance( KHTMLFactory::instance(), prof == BrowserViewGUI && !parentPart() );
 }

 void KHTMLPart::init( KHTMLView *view, GUIProfile prof )

Hopefully no code in init() needs instance(). If it does, then we need to use
setInstance( ..., false ) before init()
and loadPlugins( this, this, instance() ) after init().

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kfm-devel mailing list