KDevPlugin::extension

Andras Mantia amantia at kde.org
Wed Aug 23 08:39:01 UTC 2006


Hi,

 While looking at the KDevPlugin sources I found this comment:
//FIXME Is this used for anything? 
for the KDevPlugin::extension method.

We are using this method in Quanta heavily and would like to have it in 
future as well (or some kind of replacement). The reason is that we 
would like to have plugins that do not depend on each other during 
compilation time, but they still can communicate. The "extension" 
method was suggested here and helps a lot.

A quick example: plugin X wants to have access to some methods of plugin 
Y. We define a common interface (class derived from KDevPlugin, call it 
YInterface), and plugin Y derives from this interface. Plugin X can 
load plugin Y inside of it using
YInterface *objectY = extension<YInterface>("KDevelop/Y");

and use via objectY (and the YInterface) the methods of plugin Y.

In the y.desktop for ServiceTypes you need to list KDevelop/Y as well.

AFAIK it is also used in some places of the old KDevelop.

Andras


-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20060823/010e5e95/attachment.sig>


More information about the KDevelop-devel mailing list