Why don't the KConfig* classes have reference counting on their d-pointers, value semantics?

Matthias Kretz kretz at kde.org
Tue Apr 1 10:56:30 BST 2008


Simple answer:

KSharedConfig(Ptr) was added at some point in KDE 3 IIRC. For KDE 4 I would 
have liked to do make KConfig a value-based, ref-counted class (like 
KSharedConfigPtr is now), but the porting effort was too big (I did make 
KInstance value based and that was one week full-time porting work - you do 
that once and never again...).

On Tuesday 01 April 2008, Richard Dale wrote:
> I've been trying to wrap the KConfig* classes in Ruby, and they need
> special casing on their marshalling because they have KSharedConfig::Ptr
> and KSharedConfigPtr types exposed in the public api. There is also a
> KSharedConfig class. Is there a reason why reference counting wasn't
> implement of the d pointer, instead of via a KSharedPtr, and the KConfigs
> could be just returned as values. There seem to be a lot of things which
> are not on the d-pointer too like various enums, that also have accessor
> methods. Then instead of:
>
>     KDECORE_EXPORT KSharedConfigPtr config();
>
> It could be:
>
>     KDECORE_EXPORT KConfig config();
>
> Am I missing something, is there a good reason for this difference?
>
> -- Richard



-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- 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/20080401/9b203413/attachment.sig>


More information about the kde-core-devel mailing list