diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-08-19 23:17:48 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-03-05 13:03:13 +0200 |
commit | 16f927a4f1ffeff399351b625d73ac3cd7bccd51 (patch) | |
tree | b4f99e0b56232cd60fa45e5992ca6092dd2ac5e0 /src/corelib/io/qloggingregistry_p.h | |
parent | c58249c32774646a4be5c7504339b483d658a4da (diff) |
QLoggingRegistry: use QStringView/QLatin1String more
- QLoggingRule::parse() and the ctor take pattern as QStringView
- parseNextLine takes lines as QStringView and produces the pattern as
QStringView for QLoggingRule
- (setContent has to wait for QStringTokenizer)
- QLoggingRule::pass()'s first argument is always QLatin1String, so
take it as one
Use chopped() more, add a std::move().
Change-Id: Ic95ea77464a9922fef452846bc6d5053bd5de56e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/io/qloggingregistry_p.h')
-rw-r--r-- | src/corelib/io/qloggingregistry_p.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/corelib/io/qloggingregistry_p.h b/src/corelib/io/qloggingregistry_p.h index 12a1f166b3..3ac429b147 100644 --- a/src/corelib/io/qloggingregistry_p.h +++ b/src/corelib/io/qloggingregistry_p.h @@ -67,8 +67,8 @@ class Q_AUTOTEST_EXPORT QLoggingRule { public: QLoggingRule(); - QLoggingRule(const QStringRef &pattern, bool enabled); - int pass(const QString &categoryName, QtMsgType type) const; + QLoggingRule(QStringView pattern, bool enabled); + int pass(QLatin1String categoryName, QtMsgType type) const; enum PatternFlag { FullText = 0x1, @@ -84,7 +84,7 @@ public: bool enabled; private: - void parse(const QStringRef &pattern); + void parse(QStringView pattern); }; Q_DECLARE_OPERATORS_FOR_FLAGS(QLoggingRule::PatternFlags) @@ -101,7 +101,7 @@ public: QVector<QLoggingRule> rules() const { return _rules; } private: - void parseNextLine(QStringRef line); + void parseNextLine(QStringView line); private: bool m_inRulesSection = false; |