Commit ce4ffe14 authored by Thomas Baumgart's avatar Thomas Baumgart
Browse files

Hide/remove sensitive information from anon file

BUG: 309453
(cherry picked from commit a6cb6feb)
parent cdfa2693
......@@ -253,7 +253,7 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx)
{
MyMoneyBudget bn;
bn.setName(bx.name());
bn.setName(bx.id());
bn.setBudgetStart(bx.budgetStart());
bn = MyMoneyBudget(bx.id(), bn);
......@@ -290,5 +290,14 @@ void MyMoneyStorageANON::writeBudget(QDomElement& budgets, const MyMoneyBudget&
MyMoneyStorageXML::writeBudget(budgets, bn);
}
void MyMoneyStorageANON::writeReport(QDomElement& reports, const MyMoneyReport& r)
{
MyMoneyReport rn = r;
rn.setName(rn.id());
rn.setComment(hideString(rn.comment()));
MyMoneyStorageXML::writeReport(reports, rn);
}
// vim:cin:si:ai:et:ts=2:sw=2:
......@@ -78,12 +78,15 @@ protected:
void writeBudget(QDomElement& budgets, const MyMoneyBudget& b);
void writeReport(QDomElement& reports, const MyMoneyReport& r);
void readFile(QIODevice* s, IMyMoneySerialize* storage);
void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security);
QDomElement findChildElement(const QString& name, const QDomElement& root);
private:
/**
* The list of key-value pairs to not modify
......
......@@ -773,11 +773,16 @@ void MyMoneyStorageXML::writeReports(QDomElement& parent)
signalProgress(0, list.count(), i18n("Saving reports..."));
unsigned i = 0;
for (it = list.constBegin(); it != list.constEnd(); ++it) {
(*it).writeXML(*m_doc, parent);
writeReport(parent, (*it));
signalProgress(++i, 0);
}
}
void MyMoneyStorageXML::writeReport(QDomElement& report, const MyMoneyReport& r)
{
r.writeXML(*m_doc, report);
}
void MyMoneyStorageXML::writeBudgets(QDomElement& parent)
{
const QList<MyMoneyBudget> list = m_storage->budgetList();
......
......@@ -99,6 +99,7 @@ protected:
virtual void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx);
virtual void writeReports(QDomElement& e);
virtual void writeReport(QDomElement& report, const MyMoneyReport& r);
virtual void writeBudgets(QDomElement& e);
virtual void writeBudget(QDomElement& budget, const MyMoneyBudget& b);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment