Uppercase the verbosity setting enums.

Change-Id: I7a9e11d7b64a4cc78e24ffff142b9996fd77cb10
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
Thiago Macieira 2016-01-21 16:56:08 -08:00
parent 0f51686a69
commit 9eda09f511
2 changed files with 8 additions and 8 deletions

View File

@ -357,7 +357,7 @@ QDebug &QDebug::resetFormat()
stream->space = true;
if (stream->context.version > 1)
stream->flags = 0;
stream->setVerbosity(Stream::defaultVerbosity);
stream->setVerbosity(Stream::DefaultVerbosity);
return *this;
}

View File

@ -66,14 +66,14 @@ class Q_CORE_EXPORT QDebug
friend class QMessageLogger;
friend class QDebugStateSaverPrivate;
struct Stream {
enum { defaultVerbosity = 2, verbosityShift = 29, verbosityMask = 0x7 };
enum { DefaultVerbosity = 2, VerbosityShift = 29, VerbosityMask = 0x7 };
Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg),
space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {}
space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {}
Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg),
space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {}
space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {}
Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t),
space(true), message_output(true), flags(defaultVerbosity << verbosityShift) {}
space(true), message_output(true), flags(DefaultVerbosity << VerbosityShift) {}
QTextStream ts;
QString buffer;
int ref;
@ -91,12 +91,12 @@ class Q_CORE_EXPORT QDebug
void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } }
void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } }
int verbosity() const
{ return context.version > 1 ? (flags >> verbosityShift) & verbosityMask : int(Stream::defaultVerbosity); }
{ return context.version > 1 ? (flags >> VerbosityShift) & VerbosityMask : int(Stream::DefaultVerbosity); }
void setVerbosity(int v)
{
if (context.version > 1) {
flags &= ~(verbosityMask << verbosityShift);
flags |= (v & verbosityMask) << verbosityShift;
flags &= ~(VerbosityMask << VerbosityShift);
flags |= (v & VerbosityMask) << VerbosityShift;
}
}
// added in 5.4