[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdebase/konqueror/listview
From:       David Faure <faure () kde ! org>
Date:       2004-12-24 15:12:58
Message-ID: 200412241612.59322.faure () kde ! org
[Download RAW message or body]

On Friday 24 December 2004 16:00, Martin Koller wrote:
> CVS commit by mkoller: 
> 
> Ensure that a plugin already has the widget defined
> +   setInstance( KonqListViewFactory::instance() );
> +   setXMLFile( xmlFile );

I just realized the risk of moving down the setInstance call: 
any i18n() before that line won't work, since setInstance loads the i18n catalogue
for the part.

Sounds like a general KParts design mistake: we say that setInstance should be 
done first (in the part's constructor) for the i18n catalogues, but at the same time
it should be done last for the plugins (so that the view is already created).

Simon: do you think we should remove the automatic loading of plugins from
setInstance in KDE4, and tell people to add a mandatory loadPlugins() call at the 
end of the part constructor instead?

A typical part ctor would then be

setInstance(...);
setWidget(...);
setXMLFile(...);
create actions etc.
loadPlugins();

KHTML had the same problem, cf my commented-out-but-ready-for-kde4 code there,
this is why I'm thinking a general solution is needed (a more intuitive one than
setInstance( instance, false );
...
loadPlugins( this, this, instance() );
)

-- 
David Faure, faure@kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic