[kmymoney4] [Bug 328050] KMymoney does not support space as thousand separator

Ralf Habacker bugzilla_noreply at kde.org
Wed Jul 12 22:55:05 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=328050

--- Comment #8 from Ralf Habacker <ralf.habacker at freenet.de> ---
(In reply to Jack from comment #7)
> (Candian French and Canadian English are two separate languages)
> Does this only affect KMM, or is there anything at a higher level in KDE
> which should be changed also?

This does only affect KMM only. I kmm main function the KDE thousand separator
system settings is copied into kmm, see below

main.cpp
138: // setup the MyMoneyMoney locale settings according to the KDE settings
139:
MyMoneyMoney::setThousandSeparator(KGlobal::locale()->monetaryThousandsSeparator()[0]);

Because ' ' as thousand separator is ignored the whole application does not
know anything about this value except the cases where
KGlobal::locale()->monetaryThousandsSeparator() is used directly, which is 
1. MyMoneyQifProfile::clear()
2. kMyMoneyMoneyValidator::validate()

An interesting location is inside GncObject::hide() 
... 
      case MONEY2:
        in = MyMoneyMoney(data);
        if (data == "-1/0") in = MyMoneyMoney();
        mresult  = MyMoneyMoney(m_moneyHideFactor) * in;
        mresult.convert(10000);
        MyMoneyMoney::setThousandSeparator(' ');
        result = mresult.formatMoney("", 2);
        break;

Because ' ' is converted to '', which means no thousand separator this could be
rewritten to 

        result = mresult.formatMoney("", 2, false);

The third parameter is a value for showThousandSeparator.

I'm talking about code because the task is to inspect any call of formatMoney()
if it falls into one of the following category: 

1. used for debug output
2. used for gui output
3. used for further processing
4. used for file export

Category 1. and 2. are uncritical (from my current knowledge) but the other
need to be inspected  and optional fixed like the mentioned example.

<offtopic>Refactoring the above mentioned code fragment also fixes an
additional bug: Because the original thousand separator is not saved and
restored (as it is done in the qif reader), this piece of code kills the
thousand separator in the whole application until kmymoney will be been
restarted.</offtopic>

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list