Bug 396978

Summary: Stable xml file output
Product: [Applications] kmymoney Reporter: Ralf Habacker <ralf.habacker>
Component: fileAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: git (master)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 5.0.4
Sentry Crash Report:

Description Ralf Habacker 2018-07-30 06:47:24 UTC
Jack Ostroff reported at https://bugs.kde.org/show_bug.cgi?id=363582#c8 an issue that the Qt5 variant of the xml writer has a problem with unstable attribute ordering in generated xml and kmy files (kmy files are compressed xml files).

While a uniform sorting is not required for normal use, it helps considerably when comparing KMyMoney data in order to recognize differences.
Comment 1 Thomas Baumgart 2018-07-30 08:01:15 UTC
I second this! Especially for QA purposes a stable/fixed order would be very beneficial. https://stackoverflow.com/questions/27378143/qt-5-produce-random-attribute-order-in-xml may indeed point to a possible solution.
Comment 2 Jack 2018-07-30 14:47:46 UTC
I have used the temporary solution Ralf mentioned in  https://bugs.kde.org/show_bug.cgi?id=363582#c4 but that is obviously not a good solution for the long run, as it requires too much manual work.  Should we change this to a wishlist, or is the fix easy enough to implement that it doesn't matter?
Comment 3 Thomas Baumgart 2019-04-20 05:49:23 UTC
Git commit 600af541035959ace4bdd21b74d078764f02516e by Thomas Baumgart.
Committed on 20/04/2019 at 05:49.
Pushed by tbaumgart into branch '5.0'.

Make XML files comparable again

Since commit e4d384d34a91eb6024800 (which later made it into v5.0.2),
the order of attributes in the XML file is random each time the file is
saved. This leads to the fact that it is extremly hard to compare two
files because one does not see the forest for the trees.

This change removes the randomness and thus brings back comparability.
FIXED-IN: 5.0.4

M  +11   -10   kmymoney/plugins/xml/mymoneystoragenames.cpp

https://commits.kde.org/kmymoney/600af541035959ace4bdd21b74d078764f02516e