Back to kDebug
Lubos Lunak
l.lunak at suse.cz
Fri May 25 17:50:53 BST 2007
Hello,
this should be a follow-up to
http://lists.kde.org/?l=kde-core-devel&m=116903044203449&w=2 . I'd like to do
something about it before it gets forgotten even more. To sum it up, there
are 2 problems with current kDebug:
- the output for some types is ... strange, I e.g. really don't see why
anybody would need to be told that [10,10-20x20] is a QRect
- there is a template operator<< , which gets everything that is not an exact
match - inherit or add const and all you get is the class name and the
pointer value
kdebug.cpp r649670 is a nice example of how ugly this can get. Additionally
note that "kDebug() << someKComboBox" will give you "KComboBox(0xbfa7cf74)"
anyway, so it actually doesn't work.
There's no patch because I don't know what it should be :(.
According to http://lists.kde.org/?l=kde-core-devel&m=116905397604715&w=2 or
David's commit message there should be a possibility of some template tricks,
but I haven't managed to come up with anything. In fact my headache tells me
there's none, either there's a template somewhere and then it's too greedy or
there's no template and then it needs to link to UI libs, but I'd certainly
like to be corrected.
The solutions I see are:
- kdebug.h from kdecore gets renamed to kdebugcore.h, kdebug.h gets added to
kdeui, the template gets dumped, operator<< implementations for all types we
care about get added
- it stays as it is
- all operator<< implementations except for the template one get dropped, we
implement QDebug operator<< re-implementations and hope they win
- ???
Ideas, comments?
--
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12 tel: +420 284 028 972
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http//www.suse.cz
More information about the kde-core-devel
mailing list