KConfigBase cleanup

Thomas Braxton brax108 at cox.net
Tue Jan 10 16:40:04 GMT 2006


This patch cleans up kconfigbase.cpp by removing some unneeded 
functions(covered by the templates) and moving all the 
readEntry/writeEntry(const QString& key, ...) functions inline. What do you 
think?

Another thing I was thinking about was adding a new macro KDE3_EXPORT. This 
macro would be used for functions that are still there only for KDE3 support. 
I was thinking it could be defined something like:
#ifndef KDE3_SUPPORT
#define KDE3_EXPORT KDE_NO_EXPORT // or KDE_DEPRECATED or a combination
#else
#define KDE3_EXPORT KDE_EXPORT
#endif
then I could move all of the functions that are still in KConfigBase for KDE3 
support to kde3support. I don't know if msvc allows functions from one class 
to be defined across two different libraries, but it would allow all 
deprecated functions to be in one place instead of spread over 
kconfigbase.cpp. This could probably be used all over kdelibs to clean up the 
code. We wouldn't have to work around a bunch of code that is deprecated, we 
could just move it to kde3support and forget about it, and move on with 
cleaning up KDE4. The only problem I see with this is that you would have to 
link to kde3support you would get linker errors if you used any deprecated 
functions. I don't know how far along other modules are to removing KDE3 
support, but probably almost all of them would have to be compiled with 
-DKDE3_SUPPORT and linked to -lkde3support to find all the functions that 
would be moved, some parts of kdelibs would still need to be compiled this 
way.
I tried it by moving readListEntry/writeEntry(key, Q3StrList,...) to 
kde3support and kdelibs compiled, unsermake check in kdecore worked. I didn't 
do any more extensive testing than this, but it seems it would work at least 
w/ g++, don't know about msvc. What do you guys think?

Regards,
Thomas

PS - if we go the KDE3_EXPORT route this patch would be half useless, because 
alot of the functions would instead be moved to kde3support.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diff.gz
Type: application/x-gzip
Size: 3894 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20060110/17327a0c/attachment.bin>


More information about the kde-core-devel mailing list