Uppercase the verbosity setting enums.
Change-Id: I7a9e11d7b64a4cc78e24ffff142b9996fd77cb10 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
This commit is contained in:
parent
0f51686a69
commit
9eda09f511
@ -357,7 +357,7 @@ QDebug &QDebug::resetFormat()
|
|||||||
stream->space = true;
|
stream->space = true;
|
||||||
if (stream->context.version > 1)
|
if (stream->context.version > 1)
|
||||||
stream->flags = 0;
|
stream->flags = 0;
|
||||||
stream->setVerbosity(Stream::defaultVerbosity);
|
stream->setVerbosity(Stream::DefaultVerbosity);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,14 +66,14 @@ class Q_CORE_EXPORT QDebug
|
|||||||
friend class QMessageLogger;
|
friend class QMessageLogger;
|
||||||
friend class QDebugStateSaverPrivate;
|
friend class QDebugStateSaverPrivate;
|
||||||
struct Stream {
|
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),
|
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),
|
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),
|
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;
|
QTextStream ts;
|
||||||
QString buffer;
|
QString buffer;
|
||||||
int ref;
|
int ref;
|
||||||
@ -91,12 +91,12 @@ class Q_CORE_EXPORT QDebug
|
|||||||
void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } }
|
void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } }
|
||||||
void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } }
|
void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } }
|
||||||
int verbosity() const
|
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)
|
void setVerbosity(int v)
|
||||||
{
|
{
|
||||||
if (context.version > 1) {
|
if (context.version > 1) {
|
||||||
flags &= ~(verbosityMask << verbosityShift);
|
flags &= ~(VerbosityMask << VerbosityShift);
|
||||||
flags |= (v & verbosityMask) << verbosityShift;
|
flags |= (v & VerbosityMask) << VerbosityShift;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// added in 5.4
|
// added in 5.4
|
||||||
|
Loading…
Reference in New Issue
Block a user