Fix checking of category for printf-style qCDebug

Fixes an issue introduced in b8a38a6737. We forgot
to check for category validness, and printed qCDebug(c, ""...)
unconditionally for compilers not supporting variadic
macros.

Change-Id: I779a97dacd7ea559f0d91473aad2c29e73ea2f89
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
bb10
Kai Koehne 2014-02-06 17:12:34 +01:00 committed by The Qt Project
parent ba8e61a388
commit 5dae375c24
1 changed files with 2 additions and 0 deletions

View File

@ -322,6 +322,8 @@ void QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc,
const char *msg, ...) const
{
const QLoggingCategory &cat = (*catFunc)();
if (!cat.isDebugEnabled())
return;
QMessageLogContext ctxt;
ctxt.copy(context);