KParts, widget() and multiple views in katepart

Christoph Cullmann cullmann at babylon2k.de
Sat Jul 22 07:36:07 BST 2006


Am Samstag, 22. Juli 2006 01:01 schrieb Adam Treat:
> On Friday 21 July 2006 6:50 pm, Christoph Cullmann wrote:
> > Am Samstag, 22. Juli 2006 00:42 schrieb Adam Treat:
> > > Currently Katepart does not implement widget() when the part is a
> > > ReadOnly.
> >
> > Guess you mixed that up, Kate Part does not implement it if the factory
> > loads it explicit as KTextEditor::Document or KDocument::Document ;)
>
> Oh? Line #63 in katefactory.cpp:
>
> bool bWantSingleView = ( classname == "KTextEditor::Editor" );
>
> Unless the factory loads it explicitly as "Editor" it doesn't implement
> widget();
Which was changed by your commit, which I reverted/fixed yesterday.....
The old behaviour even only didn't create view if it's loaded as 
ktexteditor::document.

Look at:

SVN commit 559557 by treat:

* Only construct the view when the classname is explicitly
KTextEditor::Editor and take care to setWidget() when views
are created.  Handle this in the destructor.


 M  +13 -16    katedocument.cpp  
 M  +1 -1      katefactory.cpp  

<............>

--- trunk/KDE/kdelibs/kate/part/katefactory.cpp #559556:559557
@@ -60,7 +60,7 @@
     KParts::Part *createPartObject ( QWidget *parentWidget, QObject *parent, 
const char *_classname, const QStringList & )
     {
       QByteArray classname( _classname );
-      bool bWantSingleView = ( classname != "KTextEditor::Document" && 
classname != "KTextEditor::Document" );
+      bool bWantSingleView = ( classname == "KTextEditor::Editor" );
       bool bWantBrowserView = ( classname == "Browser/View" );
       bool bWantReadOnly = (bWantBrowserView || ( classname 
== "KParts::ReadOnlyPart" ));
 




More information about the kde-core-devel mailing list