Adds imperial gallon and US pint as requested in a bug report.
BUG: 341072
ngraham |
Frameworks |
Adds imperial gallon and US pint as requested in a bug report.
BUG: 341072
I haven't figured out how to test the changes, so any directions are welcome. I've tried LD_PRELOAD with the compiled library when launching KRunner to no avail.
Lint Skipped |
Unit Tests Skipped |
Thanks very much for the patch, but that bug report is very old and these units of measurement were already added in 5.53 as GallonUS and PintImperial. I'm sorry the the bug report wasn't correctly closed after those units were added (I have just done so). You did a great job here though. Would you care to work on a different unit conversion bug report? Here are a few: https://bugs.kde.org/buglist.cgi?component=general&list_id=1736763&product=frameworks-kunitconversion&resolution=---
The units added in 5.53 were pint (imperial) and gallon (US). The units in the bug report and added by me now are pint (US) and gallon (imperial).
Aren't Imperial and US the same thing?The USA is the only country that still officially uses the imperiaI system.
Every time you use "is the same as" in reference to imperial measures, a kitten dies ...
The US uses USC units which are derived from the British imperial system, but some units differ such as the volume of the gallon and pint. So there is an American gallon and a British gallon, and an American pint and a British pint and probably even more variants. Prevoiusly the US gallon and British pint had been added. I've added the US pint and the British gallon (which it seems had been added for fuel efficiency calucations, but not regular calculations).
Ah, I see.
I wonder if it actually makes sense to mark the non-US imperial measurements as common. Are these units still widely used outside of the USA? Speaking as an American where everything is gallons, it will be kind of annoying to see imperial gallons appear in KRunner first.
The imperial gallon has limited use in the UK as liters mostly are used these days except for mileage which is in miles per imperial gallon. So I agree that it shouldn't be a common unit for volume.
@ngraham How widespread is usage of the pint in the US? Does it make sense to keep both pints as a common unit? (The British pint is still used widely in the UK.)
Pints are not very commonly used in the USA. So yeah, I guess both of these new units should be non-common units.