Bug 361004

Summary: CSV Importer doesn't read DecimalSymbol stored in csvimporterrc
Product: [Applications] kmymoney Reporter: NSLW <lukasz.wojnilowicz>
Component: importerAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 4.8.0
Attachments: CSV Test File
Column Assignment for CSV file
Warning about decimal symbol
Patch to fix this issue

Description NSLW 2016-03-26 07:32:05 UTC
During creation of Investment profile I choose my DecimalSymbol to be comma. That setting is saved in csvimporterrc as DecimalSymbol=1. If I want to reuse my investment profile to import some more CSV files I get warning (see attachment) about DecimalSymbol not found in my CSV file and afterwards DecimalSymbol in csvimporterrc is overridden to 0 ie. DecimalSymbol=1 which means dot. That's unwanted bec  

Reproducible: Always

Steps to Reproduce:
1. File->Import->CSV
2. Select investment
3. Create new profile
4. Field delimiter to comma, Text delimiter to double quotes
5. Assign columns (see attachment)
6. Next on start line/end line
7. Change Decimal Symbol from dot to comma and press exit
8. For information purposes: Open ~/.kde/share/config/csvimporterrc  and see that under your newly created profile DecimalSymbol=1, which means comma
9. File->Import->CSV
10. Select investment
11. Select your newly created profile
12. Select  "Skip setup" checkbox and do as you would normally import CSV file then close importer.

Actual Results:  
1) Warning about decimal symbol
2) DecimalSymbol gets changed in ~/.kde/share/config/csvimporterrc from 1 (comma) to 0 (dot) without my will


Expected Results:  
1) No warning at all
2) DecimalSymbol shouldn't be changed without my will or without informing me

The problem is in readSettings() of investprocessing.cpp. There is a line 

tmp = profilesGroup.readEntry("", 0);

which reads nothing at all from csvimporterrc so DecimalSymbol is always set to 0. That line should look like this

tmp = profilesGroup.readEntry("DecimalSymbol", 0);

which will read DecimalSymbol parameter and if nothing is there it will be set to 0.
Comment 1 NSLW 2016-03-26 07:32:59 UTC
Created attachment 98096 [details]
CSV Test File
Comment 2 NSLW 2016-03-26 07:33:22 UTC
Created attachment 98097 [details]
Column Assignment for CSV file
Comment 3 NSLW 2016-03-26 07:33:53 UTC
Created attachment 98098 [details]
Warning about decimal symbol
Comment 4 NSLW 2016-03-26 07:35:09 UTC
Created attachment 98099 [details]
Patch to fix this issue

Please revise it and apply to master branch.
Comment 5 allan 2016-03-26 18:54:53 UTC
Well spotted!  Now, why did I do that?

I'll come back to this later.

Allan