Bug 423509 - kmymoney : decimal separator not supported anymore
Summary: kmymoney : decimal separator not supported anymore
Status: RESOLVED FIXED
Alias: None
Product: kmymoney
Classification: Applications
Component: general (show other bugs)
Version: 5.1.0
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: KMyMoney Devel Mailing List
URL:
Keywords:
: 421970 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-06-25 16:20 UTC by tnemeth
Modified: 2020-09-16 09:39 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.1.1


Attachments
Messages before it crashes (128.93 KB, image/png)
2020-06-25 17:57 UTC, tnemeth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tnemeth 2020-06-25 16:20:41 UTC
SUMMARY

    When I try to input transaction amounts using the keypad, the decimal
    separator is not recognized and the decimal part is just appended
    without separation. Eg: "5,44" -> "544,00".

    In the KDE System Settings application, in the Advanced tab for the
    Keyboard configuration, the "Numeric keypad Delete behavior" is set
    to "4 level key with abstract decimal separator". My locale is French
    so the decimal separator is the coma "," instead of the dot.


STEPS TO REPRODUCE
1. Configure the locale as French
2. Configure the keyboard keypad Delete key to produce an abstract decimal separator
3. Open Kmymoney and insert an amount with a decimal part in a transaction.

OBSERVED RESULT

    The decimal separator is not detected. As if the key was not typed or
    if the scancode was not recognized.


EXPECTED RESULT

    A decimal separator should have been inserted between the typed numbers.


SOFTWARE/OS VERSIONS
Windows: N/A
macOS: N/A
Linux/KDE Plasma: 5.17.5 / Linux kernel : 5.6.0-2
(available in About System)
KDE Plasma Version: 5.17.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION

    When the same operation is done in, say, calc, or speedcrunch the decimal
    separator is correctly handled and a coma is inserted as decimal separator.
    When used where a decimal separator is not needed (eg: konsole, kate), a
    dot is inserted, as expected.

    Here are the X events from xev :

KeyRelease event, serial 40, synthetic NO, window 0x8c00001,
    root 0x771, subw 0x0, time 38368496, (109,68), root:(3018,146),
    state 0x10, keycode 91 (keysym 0xffae, KP_Decimal), same_screen YES,
    XKeysymToKeycode returns keycode: 129
    XLookupString gives 1 bytes: (2e) "."
    XFilterEvent returns: False

KeyPress event, serial 40, synthetic NO, window 0x8c00001,
    root 0x771, subw 0x0, time 38368571, (109,68), root:(3018,146),
    state 0x10, keycode 91 (keysym 0xffae, KP_Decimal), same_screen YES,
    XKeysymToKeycode returns keycode: 129
    XLookupString gives 1 bytes: (2e) "."
    XmbLookupString gives 1 bytes: (2e) "."
    XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x8c00001,
    root 0x771, subw 0x0, time 38368647, (109,68), root:(3018,146),
    state 0x10, keycode 91 (keysym 0xffae, KP_Decimal), same_screen YES,
    XKeysymToKeycode returns keycode: 129
    XLookupString gives 1 bytes: (2e) "."
    XFilterEvent returns: False
Comment 1 Alexander Lohnau 2020-06-25 17:11:50 UTC
Can you please provide a screenshot of your "Formats" System Settings page?

I had been working on a bug which might be related: https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/100
Comment 2 tnemeth 2020-06-25 17:57:58 UTC
Created attachment 129679 [details]
Messages before it crashes
Comment 3 tnemeth 2020-06-25 17:58:50 UTC
(In reply to Alexander Lohnau from comment #1)
> Can you please provide a screenshot of your "Formats" System Settings page?

    You may have put your finger on something.

    Interestingly, I can't provide a screenshot of my "Formats" System
    Settings page because... System Settings crashes when I try to access
    Regional Settings.


$ LC_ALL=C systemsettings5 
kf5.kservice.sycoca: The menu spec file contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix your file.
QQmlEngine::setContextForObject(): Object already has a QQmlContext
QQmlEngine::setContextForObject(): Object already has a QQmlContext
kf5.ki18n: "1 instead of 2 arguments to message {The translation file...} supplied before conversion."
KCrash: crashing... crashRecursionCounter = 2
KCrash: Application Name = systemsettings5 path = /usr/bin pid = 3066016
KCrash: Arguments: /usr/bin/systemsettings5 
KCrash: Attempting to start /usr/lib/x86_64-linux-gnu/libexec/drkonqi


    There are 2 messages that briefly appear before it crashes, and before I can
    do anything :

    "There are no languages available on this system."
    "There are currently no preferred languages configured."

    Of course there had been such things before (as you can see I'm using debian
    testing so packages tend to follow upstream) and when I configured it, I'm sure
    I set it up correctly :)
Comment 4 Jack 2020-06-25 18:25:56 UTC
I'm not sure what you did "when I configured it,...." and I don't know if it's relevant on debian, but have you edited /etc/locale.gen and then run locale-gen?  Is there any language choice made at installation time you might have missed?
Comment 5 tnemeth 2020-06-25 18:49:09 UTC
(In reply to Jack from comment #4)
> I'm not sure what you did "when I configured it,...."

    It means that when I logged-in for the first time into Plasma, I went
    through all relevant (to my eyes) configuration sections in order to
    make it suit my taste :)

    Each time a new Plasma release is made I have the habit to have a
    look at what has changed since the previous time. However I rarely
    go the the locales section after 1st configuration.


> and I don't know if
> it's relevant on debian, but have you edited /etc/locale.gen and then run
> locale-gen?

    It's relevant on debian. And yes I did it : I don't want to be
    encumbered with GB of locales I will never use :) Relaunched
    locale-gen just in case (should be automatically relaunched after
    each upgrade btw) but it doesn't change anything.


>  Is there any language choice made at installation time you
> might have missed?

    There is only 1 locale configured on my systems. I configure debian
    systems _really_ regularly since '96 ('cause before that I was more
    a Slackware guy). I don't think I missed something regarding to
    locales configuration on this one. I think it has been set up about
    2 years ago.

    However, having System Setting crash is one thing, but it does not
    explain why only kmymoney has that decimal separator problem and not
    Calc and Speedcrunch.
Comment 6 Thomas Baumgart 2020-06-27 12:36:25 UTC
Git commit 2e0440ec0d2d09475b4c09af4fd6cb6a6ccd3a1a by Thomas Baumgart.
Committed on 27/06/2020 at 12:35.
Pushed by tbaumgart into branch '5.1'.

Fix keypad comma/dot to use QLocale::decimalPoint for amounts

In general, pressing the keypad's comma or dot character creates the
correct key press event for a locale. In case the keyboard option
"Four-level key with abstract separators" is set in the KDE settings,
the wrong character is used to create the event (e.g.: for locales DE or
FR a dot is returned when the decimal symbol is a comma).

This change fixes the problem such that a key press event for dot or
comma with the Qt::KeypadModifier set is turned into a key press event
with for the QLocale::decimalPoint() character.
FIXED-IN: 5.1.1

M  +23   -2    kmymoney/widgets/amountedit.cpp

https://invent.kde.org/office/kmymoney/commit/2e0440ec0d2d09475b4c09af4fd6cb6a6ccd3a1a
Comment 7 dunkiper 2020-09-16 09:39:02 UTC
*** Bug 421970 has been marked as a duplicate of this bug. ***