From 23b9372c706a485455c021e4b271234e493e3f92 Mon Sep 17 00:00:00 2001 From: David Faure <faure@kde.org> Date: Sat, 31 Oct 2015 09:31:52 +0100 Subject: [PATCH 19/74] Hide "less than 3 characters" warning when all words are longer than 3 chars. (Fix from Laurent, backported) --- messagelist/core/widgets/quicksearchwarning.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/messagelist/core/widgets/quicksearchwarning.cpp b/messagelist/core/widgets/quicksearchwarning.cpp index 025ea6db86..a3c1f255c4 100644 --- a/messagelist/core/widgets/quicksearchwarning.cpp +++ b/messagelist/core/widgets/quicksearchwarning.cpp @@ -37,11 +37,17 @@ QuickSearchWarning::~QuickSearchWarning() void QuickSearchWarning::setSearchText(const QString &text) { const QStringList lstText = text.split(QLatin1Char(' '), QString::SkipEmptyParts); + bool foundLessThanThreeCharacters = false; Q_FOREACH(const QString &text, lstText) { if (text.trimmed().size() < 3) { - animatedShow(); + foundLessThanThreeCharacters = true; break; } } + if (foundLessThanThreeCharacters) { + animatedShow(); + } else { + animatedHide(); + } } -- 2.14.1