Re-enable commented out code to handle both '.' and ',' shortcut keys for the decimal separator. Also port it from KLocale to QLocale.
BUG: 357824
Re-enable commented out code to handle both '.' and ',' shortcut keys for the decimal separator. Also port it from KLocale to QLocale.
BUG: 357824
Running kcalc with both locale en_US.UTF-8 and de_DE.UTF-8.
In both cases the keys '.' and ',' work.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
kcalc.cpp | ||
---|---|---|
374 | QLocale::decimalPoint() returns a QChar, not a QString. |
What happens if the locale uses . as a decimal point, and , as a thousands separator (or vice versa)?
I saw the other patch for converting strings which are pasted to kcalc where it may cause problems since the meaning of separators in the string is not clear.
But this patch only adds another shortcut key. The digit group separator should normally not be entered manually but only shown automatically to help the user.
Other calculators also allow to use both "." and "," as decimal separator (e.g. galculator and calc from Windows), so this behavior should be fine.
For me the main problem with the current behavior is that in all programming languages the dot is used and I automatically use the dot also in the calculator. Maybe accepting both separators is also useful in other situations.
Arthur, I didn't find any previous KDE patches from you. To commit the change, I would need your mail address for proper attribution.