Bug 483815

Summary: Unit conversion runner does not detect KB as kilobytes
Product: [Plasma] krunner Reporter: Kishore Gopalakrishnan <kishore96>
Component: converterAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alexander.lohnau, mobile.harvey, natalie_clarius
Priority: NOR Keywords: qt6
Version First Reported In: 6.0.2   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Kishore Gopalakrishnan 2024-03-17 10:09:38 UTC
SUMMARY
The unit conversion runner thinks 'KB' (note the use of uppercase) stands for kilobits, rather than kilobytes.


STEPS TO REPRODUCE
1. Type '1 KB' (without the quotes) in krunner

OBSERVED RESULT
0.125 kilobytes is shown as a unit conversion (i.e. the input is interpreted as 1 kilobit)

EXPECTED RESULT
KB should be kilobytes (just like GB=gigabytes)

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.0.2
KDE Frameworks Version: 6.0.0
Qt Version: 6.6.2
Kernel Version: 6.7.9-arch1-1 (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Typing 1 kB is interpreted as kilobyte.
Comment 1 Nick 2024-03-23 18:25:37 UTC
Duplicated on Neon 6.0.2. Looks like a bug to me. Enter 1 Mb as well and the answer is 125 kilobytes. Confirmed.
Comment 2 Bug Janitor Service 2024-03-23 18:53:41 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kunitconversion/-/merge_requests/47
Comment 3 Natalie Clarius 2024-03-27 02:57:22 UTC
Git commit 0acee867fd2911dd4d5f37fae84e313f0940aadc by Natalie Clarius.
Committed on 27/03/2024 at 01:32.
Pushed by nclarius into branch 'master'.

binary_data: add match strings with {upper/lower}case k for kilo- and kibi-{bits/bytes}

M  +32   -32   src/binary_data.cpp

https://invent.kde.org/frameworks/kunitconversion/-/commit/0acee867fd2911dd4d5f37fae84e313f0940aadc