Moving KPart args from QStringList to QVariantList

Aaron J. Seigo aseigo at kde.org
Fri Mar 2 20:33:10 GMT 2007


On March 2, 2007, David Faure wrote:
> 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.

this only works if you don't need that information during construction. in 
this case, it would mean having a rule for applets that they couldn't call 
their globalAppletConfig or appletConfig methods until after the constructor. 
and then we'd have to make ++sure that the -first- thing that happens after 
instantiating the applet is to call setService on it. that is so ugly.

another way to go is to change how we do things like figure out the config 
file names and not base it on the service information, though using the 
kservice seems like a pretty obvious/elegant way to do that.

it's ok, we just won't use KGenericFactory and friends and do the loading more 
manually, just as kicker ended up doing.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

Full time KDE developer sponsored by Trolltech (http://www.trolltech.com)
-------------- 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/kde-core-devel/attachments/20070302/e768c2b4/attachment.sig>


More information about the kde-core-devel mailing list