diff options
author | Kai Koehne <kai.koehne@digia.com> | 2014-03-07 15:31:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-20 19:01:53 +0100 |
commit | ba4d1547372b7f3c1d7d4ea1cbf6785cfca90755 (patch) | |
tree | 50a08fd65da02bdaf9e2121172a498585e56f3d4 /src/corelib/io/qloggingregistry.cpp | |
parent | 07fef5f3ffd83ebece224e7fccac6749b3fc6cf7 (diff) |
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 <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/corelib/io/qloggingregistry.cpp')
-rw-r--r-- | src/corelib/io/qloggingregistry.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
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()); |