Plugin loader (was: Re: "get hot new stuff" button)

Frerich Raabe raabe at kde.org
Fri Jun 21 10:09:01 BST 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 21 June 2002 10:33, Simon Hausmann wrote:
> On Fri, Jun 21, 2002 at 10:22:09AM +0200, Cornelius Schumacher wrote:
> > On Friday 21 June 2002 10:02, David Faure wrote:
> > > On Friday 21 June 2002 09:54, Cornelius Schumacher wrote:
> > > >
> > > > What I'm missing is something which would it
> > > > make possible to write plugin loading code like this:
> > > >
> > > > PluginLoader<SomeClass> loader;
> > > > PluginInfo::List list = loader.availablePlugins();
> > > > SomeClass *plugin = loader.load( list[1] );
> > > > QPtrList<SomeClass> pluginList = loader.loadAll();
> > > >
> > > > This would hide ugly things like passing around library names or
> > > > casting factory classes to the right type.
> > >
> > > Sorry, I forgot to mention KParts::ComponentFactory, which is exactly
> > > what you want.
> >
> > Doesn't this only work for classes inheriting from QObject?
>
> Yes, but how else do you want to make it type-safe using a template?

Hmm, perhaps InheritanceDetector does what you need? That's not perfectly 
typesafe, but at least it matches only subclasses (hope that's not a 
problem).

- - Frerich
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (FreeBSD)

iD8DBQE9Eu0zKrbzRexv2VkRAgCEAKCth+TD/ItKrNlU0d/pIFUaLfEfTgCgk/dS
rfzG4LTfwpuQoYtou4DtT5k=
=rR0b
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list