shared lib: conversion-lib in Plasma

Aaron J. Seigo aseigo at kde.org
Sun Jul 26 21:48:23 BST 2009


On Sunday 26 July 2009, Petri Damstén wrote:
> On Friday 24 July 2009 00:24:29 Aaron J. Seigo wrote:
> > >  * Do you really need Unit being a QObject?
> >
> > it's apparently used for memory management, but it's parented to the
> > Converter singleton so they will live for the lifetime of the application
> > -> not so good. will fix....
>
> Unit must live for the lifetime of the application. UnitCategory uses those
> to do the actual conversion and has two maps String > Unit and Enum > Unit.
> If unit class is deleted you cannot convert to that unit again.

that's not really acceptable for apps that do occassional conversion. having 
memory hanging around because someone creates a conversion plasmoid and then 
closes it (or does similarly in krunner) isn't good.

instead of a straight singleton, perhaps it could provide reference counted 
access so that the units can actually be cleared once there are no further 
users of it.

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

KDE core developer sponsored by Qt Software
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090726/21e033dc/attachment.sig>


More information about the kde-core-devel mailing list