From d4f022be6a1ec05bca44d23f19140eec0626c36c Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 24 Apr 2023 17:58:58 +0200 Subject: [PATCH] LocatorWidget: Turn the new LocatorMatcher implementation on by default Change-Id: Id9dab7ff68a710a8406879ecf4658cfb09e8f76e Reviewed-by: Qt CI Bot Reviewed-by: Eike Ziller Reviewed-by: --- src/plugins/coreplugin/locator/locatorwidget.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 01ea7f5b6ab..c253ff726c3 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -54,7 +54,11 @@ const int LocatorEntryRole = int(HighlightingItemRole::User); namespace Core { namespace Internal { -static bool isUsingLocatorMatcher() { return qtcEnvironmentVariableIsSet("QTC_USE_MATCHER"); } +static bool isUsingLocatorMatcher() +{ + const QString value = qtcEnvironmentVariable("QTC_USE_MATCHER", "").toLower(); + return !(value == "false" || value == "off"); +} bool LocatorWidget::m_shuttingDown = false; QFuture LocatorWidget::m_sharedFuture; @@ -975,11 +979,13 @@ static void printMatcherInfo() static bool printed = false; if (printed) return; - if (isUsingLocatorMatcher()) - qDebug() << "QTC_USE_MATCHER env var set, using new LocatorMatcher implementation."; - else - qDebug() << "QTC_USE_MATCHER env var not set, using old matchesFor implementation."; printed = true; + if (isUsingLocatorMatcher()) { + qDebug() << "Using the new LocatorMatcher implementation (default). In order to switch " + "back to the old implementation, set QTC_USE_MATCHER=FALSE env var."; + return; + } + qDebug() << "QTC_USE_MATCHER env var set to FALSE, using the old matchesFor implementation."; } void LocatorWidget::updateCompletionList(const QString &text)