Patch: port kError to qError and kFatal to qFatal

David Faure faure at kde.org
Wed Jan 9 11:46:31 UTC 2013


On Wednesday 09 January 2013 16:45:08 Jignesh Kakadiya wrote:
> Hi David,
> 
> I have ported all kError calls to qWarning and kFatal to qFatal in
> kdelibs/kio/kio directory. Compiles successfully. Please review it.
> 
> Next patch will be removal of kdebug.h include from kio/kio.

qFatal("Fatal Error: Got cmd %s, while waiting for an answer!", cmd);

I doubt that cmd is a char*. If it's a QString, use qPrintable(cmd), if it's a 
QByteArray, use cmd.constData().
Otherwise it compiles, but with a compiler warning (cannot pass a POD to 
"...") and it will crash at runtime (OK, for qFatal we expect a crash, but it 
helps if we can see the message first :-)


+        qFatal() << "HUH? Lister" << listit << "is supposed to be listing, 
but has no job!";

This one won't compile. You didn't notice because it's inside #if 0, but it 
should be fixed for whenever a developer re-enables that code. If qFatal is too 
cumbersome to use, you could use qWarning() followed by abort, for instance.

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list