Commit 1e538415 authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Convert enumeration MyMoneyReport::EColumnType into a class to be more type safe

Type safety is increased by moving the enum into a separate name space (here
a class is used because namespaces are not allowed inside classes).

Q_ENUM(s) or QFlags could also not be used because the related enums need
to be defined somewhere outside, which does not solve the issue having all
constants in MyMoneyReport namespace.

CCBUG:391091

Test Plan: compiled on linux

Reviewers: #kmymoney

Reviewed By: #kmymoney, tbaumgart

Differential Revision: https://phabricator.kde.org/D11043

Signed-off-by: Ralf Habacker's avatarRalf Habacker <ralf.habacker@freenet.de>
parent 5fadc202
......@@ -74,7 +74,7 @@ KReportChartView* KBalanceChartDlg::drawChart(const MyMoneyAccount& account)
{
MyMoneyReport reportCfg = MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last3ToNext3Months,
MyMoneyReport::eDetailTotal,
i18n("%1 Balance History", account.name()),
......
......@@ -170,7 +170,7 @@ void KReportConfigurationFilterDlg::slotSearch()
if (m_tab2->findChild<KComboBox*>("m_comboRows")->currentIndex() == 0)
m_currentState.setShowingRowTotals(m_tab2->findChild<QCheckBox*>("m_checkTotalColumn")->isChecked());
MyMoneyReport::EColumnType ct[6] = { MyMoneyReport::eDays, MyMoneyReport::eWeeks, MyMoneyReport::eMonths, MyMoneyReport::eBiMonths, MyMoneyReport::eQuarters, MyMoneyReport::eYears };
MyMoneyReport::Column::Type ct[6] = { MyMoneyReport::Column::Days, MyMoneyReport::Column::Weeks, MyMoneyReport::Column::Months, MyMoneyReport::Column::BiMonths, MyMoneyReport::Column::Quarters, MyMoneyReport::Column::Years };
bool dy[6] = { true, true, false, false, false, false };
m_currentState.setColumnType(ct[m_tab2->findChild<KComboBox*>("m_comboColumns")->currentIndex()]);
......@@ -334,11 +334,11 @@ void KReportConfigurationFilterDlg::slotReset()
combo = m_tab2->findChild<KComboBox*>("m_comboColumns");
if (m_initialState.isColumnsAreDays()) {
switch (m_initialState.columnType()) {
case MyMoneyReport::eNoColumns:
case MyMoneyReport::eDays:
case MyMoneyReport::Column::NoColumns:
case MyMoneyReport::Column::Days:
combo->setCurrentItem(i18nc("@item the columns will display daily data", "Daily"), false);
break;
case MyMoneyReport::eWeeks:
case MyMoneyReport::Column::Weeks:
combo->setCurrentItem(i18nc("@item the columns will display weekly data", "Weekly"), false);
break;
default:
......@@ -346,17 +346,17 @@ void KReportConfigurationFilterDlg::slotReset()
}
} else {
switch (m_initialState.columnType()) {
case MyMoneyReport::eNoColumns:
case MyMoneyReport::eMonths:
case MyMoneyReport::Column::NoColumns:
case MyMoneyReport::Column::Months:
combo->setCurrentItem(i18nc("@item the columns will display monthly data", "Monthly"), false);
break;
case MyMoneyReport::eBiMonths:
case MyMoneyReport::Column::BiMonths:
combo->setCurrentItem(i18nc("@item the columns will display bi-monthly data", "Bi-Monthly"), false);
break;
case MyMoneyReport::eQuarters:
case MyMoneyReport::Column::Quarters:
combo->setCurrentItem(i18nc("@item the columns will display quarterly data", "Quarterly"), false);
break;
case MyMoneyReport::eYears:
case MyMoneyReport::Column::Years:
combo->setCurrentItem(i18nc("@item the columns will display yearly data", "Yearly"), false);
break;
default:
......@@ -393,7 +393,7 @@ void KReportConfigurationFilterDlg::slotReset()
} else if (m_tab3) {
KComboBox *combo = m_tab3->findChild<KComboBox*>("m_comboOrganizeBy");
switch (m_initialState.rowType()) {
case MyMoneyReport::eNoColumns:
case MyMoneyReport::Column::NoColumns:
case MyMoneyReport::eCategory:
combo->setCurrentItem(i18n("Categories"), false);
break;
......
......@@ -34,8 +34,9 @@
#include "mymoneyfile.h"
#include "reportdebug.h"
const QStringList MyMoneyReport::Column::kTypeText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(',');
const QStringList MyMoneyReport::kRowTypeText = QString("none,assetliability,expenseincome,category,topcategory,account,tag,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow").split(',');
const QStringList MyMoneyReport::kColumnTypeText = QString("none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years").split(',');
// if you add names here, don't forget to update the bitmap for EQueryColumns
// and shift the bit for eQCend one position to the left
......@@ -61,7 +62,7 @@ MyMoneyReport::MyMoneyReport() :
m_loans(false),
m_reportType(kTypeArray[eExpenseIncome]),
m_rowType(eExpenseIncome),
m_columnType(eMonths),
m_columnType(Column::Months),
m_columnsAreDays(false),
m_queryColumns(eQCnone),
m_dateLock(userDefined),
......@@ -107,7 +108,7 @@ MyMoneyReport::MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetai
m_loans(false),
m_reportType(kTypeArray[_rt]),
m_rowType(_rt),
m_columnType(eMonths),
m_columnType(Column::Months),
m_columnsAreDays(false),
m_queryColumns(eQCnone),
m_dateLock(_dl),
......@@ -135,7 +136,7 @@ MyMoneyReport::MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetai
//set report type
if (m_reportType == ePivotTable)
m_columnType = static_cast<EColumnType>(_ct);
m_columnType = static_cast<Column::Type>(_ct);
if (m_reportType == eQueryTable)
m_queryColumns = static_cast<EQueryColumns>(_ct);
setDateFilter(_dl);
......@@ -400,7 +401,7 @@ void MyMoneyReport::write(QDomElement& e, QDomDocument *doc, bool anonymous) con
if (m_reportType == ePivotTable) {
e.setAttribute("type", "pivottable 1.15");
e.setAttribute("detail", kDetailLevelText[m_detailLevel]);
e.setAttribute("columntype", kColumnTypeText[m_columnType]);
e.setAttribute("columntype", Column::kTypeText[m_columnType]);
e.setAttribute("showrowtotals", m_showRowTotals);
} else if (m_reportType == eQueryTable) {
e.setAttribute("type", "querytable 1.14");
......@@ -726,9 +727,9 @@ bool MyMoneyReport::read(const QDomElement& e)
if (e.hasAttribute("showrowtotals"))
m_showRowTotals = e.attribute("showrowtotals").toUInt();
i = kColumnTypeText.indexOf(e.attribute("columntype", "months"));
i = Column::kTypeText.indexOf(e.attribute("columntype", "months"));
if (i != -1)
setColumnType(static_cast<EColumnType>(i));
setColumnType(static_cast<Column::Type>(i));
unsigned qc = 0;
QStringList columns = e.attribute("querycolumns", "none").split(',');
......
......@@ -58,7 +58,11 @@ public:
// When adding a new row type, be sure to add a corresponding entry in kTypeArray
enum ERowType { eNoRows = 0, eAssetLiability, eExpenseIncome, eCategory, eTopCategory, eAccount, eTag, ePayee, eMonth, eWeek, eTopAccount, eAccountByTopAccount, eEquityType, eAccountType, eInstitution, eBudget, eBudgetActual, eSchedule, eAccountInfo, eAccountLoanInfo, eAccountReconcile, eCashFlow};
enum EReportType { eNoReport = 0, ePivotTable, eQueryTable, eInfoTable };
enum EColumnType { eNoColumns = 0, eDays = 1, eMonths = 1, eBiMonths = 2, eQuarters = 3, eWeeks = 7, eYears = 12 };
class Column {
public:
enum Type { NoColumns = 0, Days = 1, Months = 1, BiMonths = 2, Quarters = 3, Weeks = 7, Years = 12 };
static const QStringList kTypeText;
};
// if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards
// also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp
......@@ -68,7 +72,6 @@ public:
enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd };
static const QStringList kRowTypeText;
static const QStringList kColumnTypeText;
static const QStringList kQueryColumnsText;
static const QStringList kDetailLevelText;
static const QStringList kChartTypeText;
......@@ -99,7 +102,7 @@ public:
ERowType rowType() const {
return m_rowType;
}
EColumnType columnType() const {
Column::Type columnType() const {
return m_columnType;
}
bool isRunningSum() const {
......@@ -213,7 +216,7 @@ public:
m_convertCurrency = _f;
}
void setRowType(ERowType _rt);
void setColumnType(EColumnType _ct) {
void setColumnType(Column::Type _ct) {
m_columnType = _ct;
}
void setComment(const QString& _comment) {
......@@ -563,7 +566,7 @@ private:
* QUANTITY of months or days. Whether it's months or days is determined
* by m_columnsAreDays.
*/
enum EColumnType m_columnType;
Column::Type m_columnType;
/**
* Whether the base unit of columns of this report is days. Only applies to
* 'PivotTable' reports. If false, then columns are months or multiples thereof.
......
......@@ -901,10 +901,10 @@ void PivotTable::calculateBudgetMapping()
case MyMoneyBudget::AccountGroup::eMonthly:
// place the single monthly value in each column of the report
// only add the value if columns are monthly or longer
if (m_config_f.columnType() == MyMoneyReport::eBiMonths
|| m_config_f.columnType() == MyMoneyReport::eMonths
|| m_config_f.columnType() == MyMoneyReport::eYears
|| m_config_f.columnType() == MyMoneyReport::eQuarters) {
if (m_config_f.columnType() == MyMoneyReport::Column::BiMonths
|| m_config_f.columnType() == MyMoneyReport::Column::Months
|| m_config_f.columnType() == MyMoneyReport::Column::Years
|| m_config_f.columnType() == MyMoneyReport::Column::Quarters) {
QDate budgetDate = budget.budgetStart();
while (column < m_numColumns && budget.budgetStart().addYears(1) > budgetDate) {
//only show budget values if the budget year and the column date match
......@@ -932,10 +932,10 @@ void PivotTable::calculateBudgetMapping()
++column;
} else {
switch (m_config_f.columnType()) {
case MyMoneyReport::eYears:
case MyMoneyReport::eBiMonths:
case MyMoneyReport::eQuarters:
case MyMoneyReport::eMonths: {
case MyMoneyReport::Column::Years:
case MyMoneyReport::Column::BiMonths:
case MyMoneyReport::Column::Quarters:
case MyMoneyReport::Column::Months: {
if ((*it_period).startDate() >= m_beginDate.addDays(-m_beginDate.day() + 1)
&& (*it_period).startDate() <= m_endDate.addDays(m_endDate.daysInMonth() - m_endDate.day())
&& (*it_period).startDate() > (columnDate(column).addMonths(-m_config_f.columnType()))) {
......@@ -2079,7 +2079,7 @@ void PivotTable::calculateMovingAverage()
int column = 1;
//check whether columns are days or months
if (m_config_f.columnType() == MyMoneyReport::eDays) {
if (m_config_f.columnType() == MyMoneyReport::Column::Days) {
while (column < m_numColumns) {
MyMoneyMoney totalPrice = MyMoneyMoney();
......@@ -2110,23 +2110,23 @@ void PivotTable::calculateMovingAverage()
//set the right start date depending on the column type
switch (m_config_f.columnType()) {
case MyMoneyReport::eYears: {
case MyMoneyReport::Column::Years: {
averageStart = QDate(columnDate(column).year(), 1, 1);
break;
}
case MyMoneyReport::eBiMonths: {
case MyMoneyReport::Column::BiMonths: {
averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
break;
}
case MyMoneyReport::eQuarters: {
case MyMoneyReport::Column::Quarters: {
averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
break;
}
case MyMoneyReport::eMonths: {
case MyMoneyReport::Column::Months: {
averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1);
break;
}
case MyMoneyReport::eWeeks: {
case MyMoneyReport::Column::Weeks: {
averageStart = columnDate(column).addDays(-columnDate(column).dayOfWeek() + 1);
break;
}
......
......@@ -736,7 +736,7 @@ void PivotTableTest::testColumnType()
filter.setRowType(MyMoneyReport::eExpenseIncome);
filter.setDateFilter(QDate(2003, 12, 31), QDate(2005, 12, 31));
filter.setRowType(MyMoneyReport::eExpenseIncome);
filter.setColumnType(MyMoneyReport::eBiMonths);
filter.setColumnType(MyMoneyReport::Column::BiMonths);
XMLandback(filter);
PivotTable spending_b(filter);
......@@ -754,7 +754,7 @@ void PivotTableTest::testColumnType()
QVERIFY(spending_b.m_grid.m_total[eActual][12] == -moParent2);
QVERIFY(spending_b.m_grid.m_total[eActual][13] == moZero);
filter.setColumnType(MyMoneyReport::eQuarters);
filter.setColumnType(MyMoneyReport::Column::Quarters);
XMLandback(filter);
PivotTable spending_q(filter);
......@@ -785,7 +785,7 @@ void PivotTableTest::testColumnType()
QVERIFY(networth_q.m_grid.m_total[eActual][9] == -moParent2 - moParent1 - moSolo - moSolo - moParent - moSolo - moParent + moCheckingOpen + moCreditOpen);
filter.setRowType(MyMoneyReport::eExpenseIncome);
filter.setColumnType(MyMoneyReport::eYears);
filter.setColumnType(MyMoneyReport::Column::Years);
XMLandback(filter);
PivotTable spending_y(filter);
......@@ -818,7 +818,7 @@ void PivotTableTest::testColumnType()
filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 7, 14));
filter.setRowType(MyMoneyReport::eExpenseIncome);
filter.setColumnType(MyMoneyReport::eMonths);
filter.setColumnType(MyMoneyReport::Column::Months);
filter.setColumnsAreDays(true);
filter.setName("Spending by Days");
......@@ -835,7 +835,7 @@ void PivotTableTest::testColumnType()
filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 8, 1));
filter.setRowType(MyMoneyReport::eExpenseIncome);
filter.setColumnType(static_cast<MyMoneyReport::EColumnType>(7));
filter.setColumnType(static_cast<MyMoneyReport::Column::Type>(7));
filter.setColumnsAreDays(true);
filter.setName("Spending by Weeks");
......@@ -941,7 +941,7 @@ void PivotTableTest::testBudget()
budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0));
MyMoneyReport report(MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
"Yearly Budgeted vs. Actual", "Default Report");
......@@ -953,7 +953,7 @@ void PivotTableTest::testBudget()
BudgetHelper budget;
budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, false, MyMoneyMoney(100.0));
MyMoneyReport report(MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
"Yearly Budgeted vs. Actual", "Default Report");
......@@ -969,7 +969,7 @@ void PivotTableTest::testBudget()
BudgetHelper budget;
budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, true, MyMoneyMoney(100.0));
MyMoneyReport report(MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop ,
"Yearly Budgeted vs. Actual", "Default Report");
......@@ -986,7 +986,7 @@ void PivotTableTest::testBudget()
budget += BudgetEntryHelper(QDate(2006, 1, 1), acChild, false, MyMoneyMoney(100.0));
budget += BudgetEntryHelper(QDate(2006, 1, 1), acSecondChild, true, MyMoneyMoney(100.0));
MyMoneyReport report(MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
"Yearly Budgeted vs. Actual", "Default Report");
......@@ -1003,7 +1003,7 @@ void PivotTableTest::testBudget()
BudgetHelper budget;
budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0));
MyMoneyReport report(MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
"Yearly Budgeted vs. Actual", "Default Report");
......
......@@ -1009,7 +1009,7 @@ void KForecastView::loadChartView()
MyMoneyReport reportCfg = MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::userDefined, // overridden by the setDateFilter() call below
detailLevel[m_comboDetail->currentIndex()],
i18n("Net Worth Forecast"),
......
......@@ -297,7 +297,7 @@ void KHomeView::showNetWorthGraph()
MyMoneyReport reportCfg = MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::userDefined, // overridden by the setDateFilter() call below
MyMoneyReport::eDetailTotal,
i18n("Net Worth Forecast"),
......@@ -1454,7 +1454,7 @@ void KHomeView::showBudget()
//config report just like "Monthly Budgeted vs Actual
MyMoneyReport reportCfg = MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentMonth,
MyMoneyReport::eDetailAll,
i18n("Monthly Budgeted vs. Actual"),
......
......@@ -1174,7 +1174,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentMonth,
MyMoneyReport::eDetailAll,
i18n("Income and Expenses This Month"),
......@@ -1182,7 +1182,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Income and Expenses This Year"),
......@@ -1190,7 +1190,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eYears,
MyMoneyReport::Column::Years,
MyMoneyTransactionFilter::allDates,
MyMoneyReport::eDetailAll,
i18n("Income and Expenses By Year"),
......@@ -1199,7 +1199,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last12Months,
MyMoneyReport::eDetailTop,
i18n("Income and Expenses Graph"),
......@@ -1211,7 +1211,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailGroup,
i18n("Income and Expenses Pie Chart"),
......@@ -1228,7 +1228,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailTop,
i18n("Net Worth By Month"),
......@@ -1236,7 +1236,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::today,
MyMoneyReport::eDetailTop,
i18n("Net Worth Today"),
......@@ -1244,7 +1244,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eYears,
MyMoneyReport::Column::Years,
MyMoneyTransactionFilter::allDates,
MyMoneyReport::eDetailTop,
i18n("Net Worth By Year"),
......@@ -1252,7 +1252,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
));
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::next7Days,
MyMoneyReport::eDetailTop,
i18n("7-day Cash Flow Forecast"),
......@@ -1263,7 +1263,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last12Months,
MyMoneyReport::eDetailTotal,
i18n("Net Worth Graph"),
......@@ -1430,7 +1430,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setInvestmentsOnly(true);
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::today,
MyMoneyReport::eDetailAll,
i18n("Investment Holdings Pie"),
......@@ -1443,7 +1443,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last12Months,
MyMoneyReport::eDetailAll,
i18n("Investment Worth Graph"),
......@@ -1457,7 +1457,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last12Months,
MyMoneyReport::eDetailAll,
i18n("Investment Price Graph"),
......@@ -1476,7 +1476,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last12Months,
MyMoneyReport::eDetailAll,
i18n("Investment Moving Average Price Graph"),
......@@ -1495,7 +1495,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last30Days,
MyMoneyReport::eDetailAll,
i18n("Investment Moving Average"),
......@@ -1511,7 +1511,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::last30Days,
MyMoneyReport::eDetailAll,
i18n("Investment Moving Average vs Actual"),
......@@ -1573,7 +1573,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToDate,
MyMoneyReport::eDetailAll,
i18n("Budgeted vs. Actual This Year"),
......@@ -1584,7 +1584,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::yearToMonth,
MyMoneyReport::eDetailAll,
i18n("Budgeted vs. Actual This Year (YTM)"),
......@@ -1599,7 +1599,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentMonth,
MyMoneyReport::eDetailAll,
i18n("Monthly Budgeted vs. Actual"),
......@@ -1609,7 +1609,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentYear,
MyMoneyReport::eDetailAll,
i18n("Yearly Budgeted vs. Actual"),
......@@ -1620,7 +1620,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudget,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentMonth,
MyMoneyReport::eDetailAll,
i18n("Monthly Budget"),
......@@ -1630,7 +1630,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eBudget,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentYear,
MyMoneyReport::eDetailAll,
i18n("Yearly Budget"),
......@@ -1640,7 +1640,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setShowingRowTotals(true);
list.push_back(MyMoneyReport(
MyMoneyReport::eBudgetActual,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentYear,
MyMoneyReport::eDetailGroup,
i18n("Yearly Budgeted vs Actual Graph"),
......@@ -1658,7 +1658,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::next12Months,
MyMoneyReport::eDetailTop,
i18n("Forecast By Month"),
......@@ -1668,7 +1668,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::nextQuarter,
MyMoneyReport::eDetailTop,
i18n("Forecast Next Quarter"),
......@@ -1679,7 +1679,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eExpenseIncome,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::currentYear,
MyMoneyReport::eDetailTop,
i18n("Income and Expenses Forecast This Year"),
......@@ -1689,7 +1689,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eAssetLiability,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::next3Months,
MyMoneyReport::eDetailTotal,
i18n("Net Worth Forecast Graph"),
......@@ -1707,7 +1707,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.push_back(MyMoneyReport(
MyMoneyReport::eSchedule,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::next12Months,
MyMoneyReport::eDetailAll,
i18n("Schedule Information"),
......@@ -1716,7 +1716,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setDetailLevel(MyMoneyReport::eDetailAll);
list.push_back(MyMoneyReport(
MyMoneyReport::eSchedule,
MyMoneyReport::eMonths,
MyMoneyReport::Column::Months,
MyMoneyTransactionFilter::next12Months,
MyMoneyReport::eDetailAll,
i18n("Schedule Summary Information"),
......@@ -1725,7 +1725,7 @@ void KReportsView::defaultReports(QList<ReportGroup>& groups)
list.back().setDetailLevel(MyMoneyReport::eDetailTop);
list.push_back(MyMoneyReport(
MyMoneyReport::eAccountInfo,
MyMoneyReport::eMonths,
MyMoneyReport::<