Fix null values in currency conversion
ClosedPublic

Authored by davidedmundson on Apr 7 2016, 12:00 AM.

Details

Summary

We would check if the string (unit1) matched any known units (s) using a
case insensitve compare.

If it did, we would treat that as a valid unit and pass it on to
KUnitConversion, but unfortunately that is case senstive, and then fails
to find anything.

This fixes the case of the user typed unit to be correct.

Test Plan

Ran krunner with "640 gbp in eur" it now returns the same as "640 GBP
in EUR" .
debug in kunitconversion shows it now has a valid unit ID for the first
query.
(the result is still utterly wrong, but it's one problem less)

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.
davidedmundson retitled this revision from to Fix null values in currency conversion.
davidedmundson updated this object.
davidedmundson edited the test plan for this revision. (Show Details)
davidedmundson added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptApr 7 2016, 12:00 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart accepted this revision.Apr 7 2016, 8:39 AM
mart added a reviewer: mart.
This revision is now accepted and ready to land.Apr 7 2016, 8:39 AM
This revision was automatically updated to reflect the committed changes.