shared lib: conversion-lib in Plasma

Petri Damstén petri.damsten at gmail.com
Tue Jul 28 09:35:41 BST 2009


On Tuesday 28 July 2009 00:32:21 Aaron J. Seigo wrote:
> On Monday 27 July 2009, Petri Damstén wrote:
> > Hmm, yes maybe it would be easier to just use KUnitConversion::Value and
> > add convertTo function to it and then when last value is deleted delete
> > also unit categories. Converter class would be just private to the lib.
>
> that makes sense ... deleting the units on last-usage is easily done using
> a KSharedPtr, which i've already implemented in the lib in the last few
> days. so it shouldn't be hard to accomplish.

Which I removed, since I can't see how it could work if Unit is KSharedPtr. 
Converter has UnitCategories which has Units. Category takes care of creating 
and deleting units. If Unit is deleted outside category (by KSharedPtr or 
otherwise) categories will fail. Values only have pointer to unit. They don't 
create or delete units. I think I need one instance of Converter class that is 
deleted on last-usage which then frees categories and units.

Petri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090728/fbe97806/attachment.sig>


More information about the kde-core-devel mailing list