From ba4d1547372b7f3c1d7d4ea1cbf6785cfca90755 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 7 Mar 2014 15:31:21 +0100 Subject: Logging: Remove PatternFlag::Invalid from QLoggingRule The flag is not orthogonal to the rest, and e.g. checking with flags & Invalid will fail. Rather make it explicit by comparing with 0. Change-Id: I428d5e71f5ecd05f61d543aaa78532548ef93d5a Reviewed-by: Friedemann Kleint --- src/corelib/io/qloggingregistry.cpp | 7 ++----- src/corelib/io/qloggingregistry_p.h | 1 - 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/io/qloggingregistry.cpp b/src/corelib/io/qloggingregistry.cpp index d79de3f0e8..7e6883fd14 100644 --- a/src/corelib/io/qloggingregistry.cpp +++ b/src/corelib/io/qloggingregistry.cpp @@ -62,7 +62,6 @@ Q_GLOBAL_STATIC(QLoggingRegistry, qtLoggingRegistry) Constructs a logging rule with default values. */ QLoggingRule::QLoggingRule() : - flags(Invalid), enabled(false) { } @@ -73,7 +72,6 @@ QLoggingRule::QLoggingRule() : */ QLoggingRule::QLoggingRule(const QStringRef &pattern, bool enabled) : messageType(-1), - flags(Invalid), enabled(enabled) { parse(pattern); @@ -147,7 +145,6 @@ void QLoggingRule::parse(const QStringRef &pattern) p = pattern; } - flags = Invalid; if (!p.contains(QLatin1Char('*'))) { flags = FullText; } else { @@ -160,7 +157,7 @@ void QLoggingRule::parse(const QStringRef &pattern) p = QStringRef(p.string(), p.position() + 1, p.length() - 1); } if (p.contains(QLatin1Char('*'))) // '*' only supported at start/end - flags = Invalid; + flags = 0; } category = p.toString(); @@ -225,7 +222,7 @@ void QLoggingSettingsParser::setContent(QTextStream &stream) bool enabled = (value.compare(QLatin1String("true"), Qt::CaseInsensitive) == 0); QLoggingRule rule(pattern, enabled); - if (rule.flags != QLoggingRule::Invalid) + if (rule.flags != 0) _rules.append(rule); else warnMsg("Ignoring malformed logging rule: '%s'", line.toUtf8().constData()); diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h index 21896bb268..48804cfc2b 100644 --- a/src/corelib/io/qloggingregistry_p.h +++ b/src/corelib/io/qloggingregistry_p.h @@ -72,7 +72,6 @@ public: int pass(const QString &categoryName, QtMsgType type) const; enum PatternFlag { - Invalid = 0x0, FullText = 0x1, LeftFilter = 0x2, RightFilter = 0x4, -- cgit v1.2.3