Fix duplicate results when a 2nd unit is partially written in krunner
ClosedPublic

Authored by iasensio on Sat, Aug 10, 8:22 AM.

Details

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

Diff Detail

Repository
R114 Plasma Addons
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
iasensio created this revision.Sat, Aug 10, 8:22 AM
Restricted Application added a project: Plasma. · View Herald TranscriptSat, Aug 10, 8:22 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
iasensio requested review of this revision.Sat, Aug 10, 8:22 AM
broulik accepted this revision.Sat, Aug 10, 2:18 PM

Well done! :)
I'll land this (or Nate is probably quicker) once I find the time to do it. Can I use the email address you used in the bugreport for this?

This revision is now accepted and ready to land.Sat, Aug 10, 2:18 PM
ngraham accepted this revision.Sat, Aug 10, 2:27 PM

I'll do it :)

Very nice job indeed!

ngraham retitled this revision from Fix #410744: Duplicate results when a 2nd unit is partially written in krunner to Fix duplicate results when a 2nd unit is partially written in krunner.Sat, Aug 10, 2:30 PM

Sure about the email. Thanks!

This revision was automatically updated to reflect the committed changes.

Great job, @iasensio! May it be the first of many. :)