Changeset View
Changeset View
Standalone View
Standalone View
kmymoney/plugins/xmlhelper/xmlstoragehelper.cpp
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright 2004-2006 Ace Jones <acejones@users.sourceforge.net> | 2 | * Copyright 2004-2006 Ace Jones <acejones@users.sourceforge.net> | ||
3 | * Copyright 2006 Darren Gould <darren_gould@gmx.de> | 3 | * Copyright 2006 Darren Gould <darren_gould@gmx.de> | ||
4 | * Copyright 2007-2010 Alvaro Soliverez <asoliverez@gmail.com> | 4 | * Copyright 2007-2010 Alvaro Soliverez <asoliverez@gmail.com> | ||
5 | * Copyright 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | 5 | * Copyright 2017-2018 Łukasz Wojniłowicz <lukasz.wojnilowicz@gmail.com> | ||
6 | * Copyright 2018 Michael Kiefer <Michael-Kiefer@web.de> | ||||
6 | * | 7 | * | ||
7 | * This program is free software; you can redistribute it and/or | 8 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License as | 9 | * modify it under the terms of the GNU General Public License as | ||
9 | * published by the Free Software Foundation; either version 2 of | 10 | * published by the Free Software Foundation; either version 2 of | ||
10 | * the License, or (at your option) any later version. | 11 | * the License, or (at your option) any later version. | ||
11 | * | 12 | * | ||
12 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Line(s) | 70 | enum class Report { | |||
72 | IncludesActuals, IncludesForecast, IncludesPrice, | 73 | IncludesActuals, IncludesForecast, IncludesPrice, | ||
73 | IncludesAveragePrice, IncludesMovingAverage, | 74 | IncludesAveragePrice, IncludesMovingAverage, | ||
74 | IncludesSchedules, IncludesTransfers, IncludesUnused, | 75 | IncludesSchedules, IncludesTransfers, IncludesUnused, | ||
75 | MixedTime, Investments, Budget, | 76 | MixedTime, Investments, Budget, | ||
76 | ShowRowTotals, ShowColumnTotals, Detail, | 77 | ShowRowTotals, ShowColumnTotals, Detail, | ||
77 | ColumnsAreDays, ChartType, | 78 | ColumnsAreDays, ChartType, | ||
78 | ChartCHGridLines, ChartSVGridLines, | 79 | ChartCHGridLines, ChartSVGridLines, | ||
79 | ChartDataLabels, ChartByDefault, | 80 | ChartDataLabels, ChartByDefault, | ||
80 | LogYAxis, ChartLineWidth, ColumnType, RowType, | 81 | LogYAxis, NegExpenses, | ||
82 | ChartLineWidth, ColumnType, RowType, | ||||
81 | DataRangeStart, DataRangeEnd, | 83 | DataRangeStart, DataRangeEnd, | ||
82 | DataMajorTick, DataMinorTick, | 84 | DataMajorTick, DataMinorTick, | ||
83 | YLabelsPrecision, QueryColumns, | 85 | YLabelsPrecision, QueryColumns, | ||
84 | Tax, Loans, HideTransactions, InvestmentSum, | 86 | Tax, Loans, HideTransactions, InvestmentSum, | ||
85 | SettlementPeriod, ShowSTLTCapitalGains, TermsSeparator, | 87 | SettlementPeriod, ShowSTLTCapitalGains, TermsSeparator, | ||
86 | Pattern, CaseSensitive, RegEx, InvertText, State, | 88 | Pattern, CaseSensitive, RegEx, InvertText, State, | ||
87 | From, To, | 89 | From, To, | ||
88 | // insert new entries above this line | 90 | // insert new entries above this line | ||
▲ Show 20 Lines • Show All 598 Lines • ▼ Show 20 Line(s) | 645 | if (report.reportType() == eMyMoney::Report::ReportType::PivotTable) { | |||
687 | else | 689 | else | ||
688 | report.setChartType(eMyMoney::Report::ChartType::None); | 690 | report.setChartType(eMyMoney::Report::ChartType::None); | ||
689 | 691 | | |||
690 | report.setChartCHGridLines(node.attribute(attributeName(Attribute::Report::ChartCHGridLines), "1").toUInt()); | 692 | report.setChartCHGridLines(node.attribute(attributeName(Attribute::Report::ChartCHGridLines), "1").toUInt()); | ||
691 | report.setChartSVGridLines(node.attribute(attributeName(Attribute::Report::ChartSVGridLines), "1").toUInt()); | 693 | report.setChartSVGridLines(node.attribute(attributeName(Attribute::Report::ChartSVGridLines), "1").toUInt()); | ||
692 | report.setChartDataLabels(node.attribute(attributeName(Attribute::Report::ChartDataLabels), "1").toUInt()); | 694 | report.setChartDataLabels(node.attribute(attributeName(Attribute::Report::ChartDataLabels), "1").toUInt()); | ||
693 | report.setChartByDefault(node.attribute(attributeName(Attribute::Report::ChartByDefault), "0").toUInt()); | 695 | report.setChartByDefault(node.attribute(attributeName(Attribute::Report::ChartByDefault), "0").toUInt()); | ||
694 | report.setLogYAxis(node.attribute(attributeName(Attribute::Report::LogYAxis), "0").toUInt()); | 696 | report.setLogYAxis(node.attribute(attributeName(Attribute::Report::LogYAxis), "0").toUInt()); | ||
697 | report.setNegExpenses(node.attribute(attributeName(Attribute::Report::NegExpenses), "0").toUInt()); | ||||
tbaumgart: If I understand this right, the default will turn the show negative expenses downwards to on. | |||||
695 | report.setChartLineWidth(node.attribute(attributeName(Attribute::Report::ChartLineWidth), QString(MyMoneyReport::m_lineWidth)).toUInt()); | 698 | report.setChartLineWidth(node.attribute(attributeName(Attribute::Report::ChartLineWidth), QString(MyMoneyReport::m_lineWidth)).toUInt()); | ||
696 | 699 | | |||
697 | // read range tab | 700 | // read range tab | ||
698 | const auto columnTypeFromXML = stringToColumnType(node.attribute(attributeName(Attribute::Report::ColumnType))); | 701 | const auto columnTypeFromXML = stringToColumnType(node.attribute(attributeName(Attribute::Report::ColumnType))); | ||
699 | if (columnTypeFromXML != eMyMoney::Report::ColumnType::Invalid) | 702 | if (columnTypeFromXML != eMyMoney::Report::ColumnType::Invalid) | ||
700 | report.setColumnType(columnTypeFromXML); | 703 | report.setColumnType(columnTypeFromXML); | ||
701 | else | 704 | else | ||
702 | report.setColumnType(eMyMoney::Report::ColumnType::Months); | 705 | report.setColumnType(eMyMoney::Report::ColumnType::Months); | ||
▲ Show 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | 854 | if (report.reportType() == eMyMoney::Report::ReportType::PivotTable) { | |||
875 | el.setAttribute(attributeName(Attribute::Report::IncludesUnused), report.isIncludingUnusedAccounts()); | 878 | el.setAttribute(attributeName(Attribute::Report::IncludesUnused), report.isIncludingUnusedAccounts()); | ||
876 | el.setAttribute(attributeName(Attribute::Report::ColumnsAreDays), report.isColumnsAreDays()); | 879 | el.setAttribute(attributeName(Attribute::Report::ColumnsAreDays), report.isColumnsAreDays()); | ||
877 | el.setAttribute(attributeName(Attribute::Report::ChartType), reportNames(report.chartType())); | 880 | el.setAttribute(attributeName(Attribute::Report::ChartType), reportNames(report.chartType())); | ||
878 | el.setAttribute(attributeName(Attribute::Report::ChartCHGridLines), report.isChartCHGridLines()); | 881 | el.setAttribute(attributeName(Attribute::Report::ChartCHGridLines), report.isChartCHGridLines()); | ||
879 | el.setAttribute(attributeName(Attribute::Report::ChartSVGridLines), report.isChartSVGridLines()); | 882 | el.setAttribute(attributeName(Attribute::Report::ChartSVGridLines), report.isChartSVGridLines()); | ||
880 | el.setAttribute(attributeName(Attribute::Report::ChartDataLabels), report.isChartDataLabels()); | 883 | el.setAttribute(attributeName(Attribute::Report::ChartDataLabels), report.isChartDataLabels()); | ||
881 | el.setAttribute(attributeName(Attribute::Report::ChartByDefault), report.isChartByDefault()); | 884 | el.setAttribute(attributeName(Attribute::Report::ChartByDefault), report.isChartByDefault()); | ||
882 | el.setAttribute(attributeName(Attribute::Report::LogYAxis), report.isLogYAxis()); | 885 | el.setAttribute(attributeName(Attribute::Report::LogYAxis), report.isLogYAxis()); | ||
886 | el.setAttribute(attributeName(Attribute::Report::NegExpenses), report.isNegExpenses()); | ||||
883 | el.setAttribute(attributeName(Attribute::Report::ChartLineWidth), report.chartLineWidth()); | 887 | el.setAttribute(attributeName(Attribute::Report::ChartLineWidth), report.chartLineWidth()); | ||
884 | el.setAttribute(attributeName(Attribute::Report::ColumnType), reportNames(report.columnType())); | 888 | el.setAttribute(attributeName(Attribute::Report::ColumnType), reportNames(report.columnType())); | ||
885 | el.setAttribute(attributeName(Attribute::Report::DataLock), reportNames(report.dataFilter())); | 889 | el.setAttribute(attributeName(Attribute::Report::DataLock), reportNames(report.dataFilter())); | ||
886 | el.setAttribute(attributeName(Attribute::Report::DataRangeStart), report.dataRangeStart()); | 890 | el.setAttribute(attributeName(Attribute::Report::DataRangeStart), report.dataRangeStart()); | ||
887 | el.setAttribute(attributeName(Attribute::Report::DataRangeEnd), report.dataRangeEnd()); | 891 | el.setAttribute(attributeName(Attribute::Report::DataRangeEnd), report.dataRangeEnd()); | ||
888 | el.setAttribute(attributeName(Attribute::Report::DataMajorTick), report.dataMajorTick()); | 892 | el.setAttribute(attributeName(Attribute::Report::DataMajorTick), report.dataMajorTick()); | ||
889 | el.setAttribute(attributeName(Attribute::Report::DataMinorTick), report.dataMinorTick()); | 893 | el.setAttribute(attributeName(Attribute::Report::DataMinorTick), report.dataMinorTick()); | ||
890 | el.setAttribute(attributeName(Attribute::Report::YLabelsPrecision), report.yLabelsPrecision()); | 894 | el.setAttribute(attributeName(Attribute::Report::YLabelsPrecision), report.yLabelsPrecision()); | ||
▲ Show 20 Lines • Show All 314 Lines • Show Last 20 Lines |
If I understand this right, the default will turn the show negative expenses downwards to on. This is *not* backward compatible.