Commit 6e6c5707 authored by Alexander Lohnau's avatar Alexander Lohnau 💬 Committed by Nate Graham

[runners/converter] Skip empty parts when splitting units

Summary:
Skip empty parts when splitting the units({D27166}).
PS: I had to set the locale to german to reproduce this issue,
thats why I didn't noticed it in the first place.

Test Plan: Does not display results for queries like 1/2

Reviewers: broulik

Reviewed By: broulik

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D28458
parent 0c0a937b
......@@ -79,7 +79,13 @@ void ConverterRunner::match(Plasma::RunnerContext &context)
const QString inputValueString = valueRegexMatch.captured(1);
// Get the different units by splitting up the query with the regex
QStringList unitStrings = context.query().simplified().remove(valueRegex).split(unitSeperatorRegex);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
QStringList unitStrings = context.query().simplified().remove(valueRegex)
.split(unitSeperatorRegex, QString::SkipEmptyParts);
#else
QStringList unitStrings = context.query().simplified().remove(valueRegex)
.split(unitSeperatorRegex, Qt::SkipEmptyParts);
#endif
if (unitStrings.isEmpty()) {
return;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment