Bug 421757

Summary: Anonymised files are no longer created
Product: [Applications] kmymoney Reporter: Ian Neal <iann_bugzilla>
Component: fileAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal CC: dev.rszczesiak, me
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 5.1.0
Attachments: Anonymised file created on 5.0.6
Anonymised file created on git master
Anonymized KMM file

Description Ian Neal 2020-05-19 07:56:14 UTC
SUMMARY
When trying to create an anonymous file, it doesn't

STEPS TO REPRODUCE
1. Create a test kmy file and add some accounts / data
2. Save As and select Anonymous file
3. Open newly created anonymous file

OBSERVED RESULT
1. File name is "xyz.onymous files (*.anon.xml).kmy" - xyz is the name I asked to call it
2. File contents are not anonymised

EXPECTED RESULT
1. File name is "xyz"
2. Contents are anonymised

SOFTWARE/OS VERSIONS
Windows: n/a
macOS: n/a
Linux/KDE Plasma: latest git master on Fedora 30
(available in About System)
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.5

ADDITIONAL INFORMATION
Comment 1 Ian Neal 2020-05-19 09:13:04 UTC
Created attachment 128608 [details]
Anonymised file created on 5.0.6

This is a test file saved anonymised, only has two accounts (Account 1 and Account 2) plus one monthly transfer (Transfer 1) and one payee (Regular)
Comment 2 Ian Neal 2020-05-19 09:18:48 UTC
Created attachment 128609 [details]
Anonymised file created on git master

This only has two accounts (Check account and Savings), one scheduled transfer (Transfer 1) and one payee (Test Transfer)
Comment 3 Robert Szczesiak 2020-05-19 09:22:24 UTC
This is what I did:
1. Open the attached test file.
2. Select File -> Save as...and choose XML format with no encryption.
3. Input file name: xyz and select Filter: Anonymous files. 
4. Click Save.

Result:
File named "xyz.anon.xml" (please find attached).
Seems good to me.

SOFTWARE/OS VERSIONS
Manjaro Linux
KDE Plasma Version: 5.18.4
KDE Frameworks Version: 5.69.0
Qt Version: 5.14.2

branch: master
Comment 4 Robert Szczesiak 2020-05-19 09:23:17 UTC
Created attachment 128610 [details]
Anonymized KMM file
Comment 5 Ian Neal 2020-05-19 09:31:21 UTC
(In reply to Robert Szczesiak from comment #3)
> This is what I did:
> 1. Open the attached test file.
> 2. Select File -> Save as...and choose XML format with no encryption.
> 3. Input file name: xyz and select Filter: Anonymous files. 
> 4. Click Save.
> 
> Result:
> File named "xyz.anon.xml" (please find attached).
> Seems good to me.
> 
> SOFTWARE/OS VERSIONS
> Manjaro Linux
> KDE Plasma Version: 5.18.4
> KDE Frameworks Version: 5.69.0
> Qt Version: 5.14.2
> 
> branch: master

Those are the same steps I am following, for whatever reason, selecting the Anonymous file filter is not adding the .anon.xml extension to the filename.
If I manually add it on my 5.0.6 install then it creates an anonymised version
Comment 6 Ian Neal 2020-05-19 09:33:12 UTC
With git master, manually typing example.anon.xml also works.
Comment 7 Thomas Baumgart 2020-05-19 15:24:17 UTC
Git commit 5f7b325274c0535b68aca58819273e13e6a8d2b5 by Thomas Baumgart.
Committed on 19/05/2020 at 15:23.
Pushed by tbaumgart into branch 'fix-421757'.

Fix setup of default file extension in Save as dialog

The default file extension was not setup correctly in all circumstances.
This change makes sure to extract the filetype from all known formats.
FIXED-IN: 5.0.9

M  +17   -1    kmymoney/plugins/xml/xmlstorage.cpp

https://invent.kde.org/office/kmymoney/commit/5f7b325274c0535b68aca58819273e13e6a8d2b5
Comment 8 Thomas Baumgart 2020-05-19 20:06:54 UTC
Git commit cc39e19fe91d7c118b0ce9d7e7b57d5c6e806c6f by Thomas Baumgart.
Committed on 19/05/2020 at 20:04.
Pushed by tbaumgart into branch '5.0'.

Fix setup of default file extension in Save as dialog

The default file extension was not setup correctly in all circumstances.
This change makes sure to extract the filetype from all known formats.
FIXED-IN: 5.0.9
(cherry picked from commit 5f7b325274c0535b68aca58819273e13e6a8d2b5)

M  +17   -1    kmymoney/plugins/xml/xmlstorage.cpp

https://invent.kde.org/office/kmymoney/commit/cc39e19fe91d7c118b0ce9d7e7b57d5c6e806c6f