Moving KPart args from QStringList to QVariantList

David Faure faure at kde.org
Fri Mar 2 20:18:00 GMT 2007


On Friday 02 March 2007, Matt Broadstone wrote:
>   In plasma we've run into a situation where we'd like to cache the
> KService::Ptr for a given applet in the applet itself, and it seems
> the only way to do this is to pass it along to the applet factory by
> means of args, however args is a QStringList.

This is not the only way. If we're talking about in-process plugins, a much cleaner
solution is to have a base class for applets (surely there's one already),
with a setService(KService::Ptr) method which the caller (still called kicker?)
would call.

The QStringList in KParts is about some 'flags' for the part creation
(e.g. setting in which mode it should be). It's not a generic setData() replacement,
which should be implemented with normal method calls; or if you really can't have
a known base class to link to, with generic QObject::setProperty() calls.

-- 
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 kde-core-devel mailing list