summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@digia.com>2014-03-07 15:31:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 19:01:53 +0100
commitba4d1547372b7f3c1d7d4ea1cbf6785cfca90755 (patch)
tree50a08fd65da02bdaf9e2121172a498585e56f3d4 /src/corelib/io
parent07fef5f3ffd83ebece224e7fccac6749b3fc6cf7 (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')
-rw-r--r--src/corelib/io/qloggingregistry.cpp7
-rw-r--r--src/corelib/io/qloggingregistry_p.h1
2 files changed, 2 insertions, 6 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());
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,