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

Richard Dale rdale at foton.es
Tue Apr 1 10:22:58 BST 2008


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





More information about the kde-core-devel mailing list