From 16f927a4f1ffeff399351b625d73ac3cd7bccd51 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 19 Aug 2019 23:17:48 +0200 Subject: 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 --- tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/auto/corelib/io') diff --git a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp index a10e706ed7..4c269822d6 100644 --- a/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp +++ b/tests/auto/corelib/io/qloggingregistry/tst_qloggingregistry.cpp @@ -158,10 +158,13 @@ private slots: QFETCH(QtMsgType, msgType); QFETCH(LoggingRuleState, result); - QLoggingRule rule(QStringRef(&pattern), true); + const auto categoryL1 = category.toLatin1(); + const auto categoryL1S = QLatin1String(categoryL1); + + QLoggingRule rule(pattern, true); LoggingRuleState state = Invalid; if (rule.flags != 0) { - switch (rule.pass(category, msgType)) { + switch (rule.pass(categoryL1S, msgType)) { case -1: QFAIL("Shoudn't happen, we set pattern to true"); break; case 0: state = NoMatch; break; case 1: state = Match; break; -- cgit v1.2.3