kdebase compile fix patch - konq-drag

Oswald Buddenhagen ossi at kde.org
Thu May 29 22:38:44 BST 2003

On Thu, May 29, 2003 at 06:15:18PM -0300, Helio Chissini de Castro wrote:
> +    kdDebug(1203) << "KonqDrag::decodeIsCutSelection : a=" << QCString( a.data() ) << endl;
> +    return !strcmp( QCString( a.data() ).data(), "1"); // true if 1
this is a bit silly ... this code constructs a qcstring for the sole
purpose of extracting the char array from it. i suggest to use
(a.length() == 1 && a.data()[0] == '1') or something like that instead.

oh, btw, this is one more case of code that does exactly the same
comparably expensive operation (constructiong a qcstring) two times in a
row. the only excuse for this is that the debug message was supposed to
be removed soon.


ps: yes helio, i know that the original code prolly does not come from
you. :)=

Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
Chaos, panic, and disorder - my work here is done.

More information about the kde-core-devel mailing list