Fix #410744: Duplicate results when a 2nd unit is partially written in krunner

Authored by iasensio on Aug 10 2019, 2:27 PM.

Description

Fix #410744: Duplicate results when a 2nd unit is partially written in krunner

Summary:
When typing a conversion, and the second unit is partially written (i.e. "10€ to ru..." the results are duplicated by several times. This behavior happens with different categories of units (lenght, currency, ...) and on different languages.

The problem is that a new result is being added not once for every matching unit, but once for every matching stringUnit, generating the duplicates.

Before:

After:

This is my first attempt to build kde from source and commit the diff to phabricator, so please excuse any possible mistakes.

BUG: 410744

Test Plan:
Open krunner and type any conversion with a letter for the second unit: "10€ to r"
Result for each matching second unit is only shown one time

Reviewers: ngraham, broulik

Reviewed By: ngraham, broulik

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D23064

Details

Committed
ngrahamAug 10 2019, 3:48 PM
Reviewer
ngraham
Differential Revision
D23064: Fix duplicate results when a 2nd unit is partially written in krunner
Parents
R114:bbd38325d9c3: Merge branch 'Plasma/5.12' into Plasma/5.16
Branches
Unknown
Tags
Unknown