Move more writing mehods to XML storage
ClosedPublic

Authored by wojnilowicz on Jul 21 2018, 11:09 AM.

Details

Summary

As before, redundant methods, not present in this patch, will be removed, after the patch will be accepted.

Diff Detail

Repository
R261 KMyMoney
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
wojnilowicz requested review of this revision.Jul 21 2018, 11:09 AM
wojnilowicz created this revision.
tbaumgart requested changes to this revision.Jul 21 2018, 1:48 PM

Looks OK and if I apply the following patch it also compiles for me (the first hunk seems to be caused by trailing blanks) :

diff --git a/kmymoney/plugins/xml/mymoneystoragexml.cpp b/kmymoney/plugins/xml/mymoneystoragexml.cpp
index 02e623a2..e38790f0 100644
--- a/kmymoney/plugins/xml/mymoneystoragexml.cpp
+++ b/kmymoney/plugins/xml/mymoneystoragexml.cpp
@@ -564,7 +564,7 @@ MyMoneyTransaction MyMoneyXmlContentHandler::readTransaction(const QDomElement &
       }
 
     } else if (c.tagName() == nodeName(Node::KeyValuePairs)) {
-      addToKeyValueContainer(transaction, c.toElement());         
+      addToKeyValueContainer(transaction, c.toElement());
     }
 
     child = child.nextSibling();
@@ -1361,7 +1361,7 @@ void MyMoneyXmlContentHandler::writeBudget(const MyMoneyBudget &budget, QDomDocu
 
   QMap<QString, MyMoneyBudget::AccountGroup>::const_iterator it;
   auto accounts = budget.accountsMap();
-  for (it = accounts.begin(); it != accounts.end(); ++it) {
+  for (it = accounts.cbegin(); it != accounts.cend(); ++it) {
     // only add the account if there is a budget entered
     // or it covers some sub accounts
     if (!(*it).balance().isZero() || (*it).budgetSubaccounts()) {
This revision now requires changes to proceed.Jul 21 2018, 1:48 PM
This revision was not accepted when it landed; it landed in state Needs Revision.Jul 21 2018, 7:01 PM
This revision was automatically updated to reflect the committed changes.