diff --git a/kmymoney/dialogs/kbalancechartdlg.cpp b/kmymoney/dialogs/kbalancechartdlg.cpp --- a/kmymoney/dialogs/kbalancechartdlg.cpp +++ b/kmymoney/dialogs/kbalancechartdlg.cpp @@ -85,18 +85,18 @@ KReportChartView* KBalanceChartDlg::drawChart(const MyMoneyAccount& account) { MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::Last3ToNext3Months, - MyMoneyReport::eDetailTotal, + MyMoneyReport::Detail::Total, i18n("%1 Balance History", account.name()), i18n("Generated Report") ); reportCfg.setChartByDefault(true); reportCfg.setChartCHGridLines(false); reportCfg.setChartSVGridLines(false); reportCfg.setChartDataLabels(false); - reportCfg.setChartType(MyMoneyReport::eChartLine); + reportCfg.setChartType(MyMoneyReport::Chart::Line); reportCfg.setIncludingForecast(true); reportCfg.setIncludingBudgetActuals(true); if (account.accountType() == eMyMoney::Account::Type::Investment) { diff --git a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp --- a/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp +++ b/kmymoney/dialogs/kreportconfigurationfilterdlg.cpp @@ -94,7 +94,7 @@ }; KReportConfigurationFilterDlg::KReportConfigurationFilterDlg(MyMoneyReport report, QWidget *parent) : - KFindTransactionDlg(*new KReportConfigurationFilterDlgPrivate(this), parent, (report.rowType() == MyMoneyReport::eAccount)) + KFindTransactionDlg(*new KReportConfigurationFilterDlgPrivate(this), parent, (report.rowType() == MyMoneyReport::Row::Account)) { Q_D(KReportConfigurationFilterDlg); @@ -123,7 +123,7 @@ d->m_tabGeneral = new ReportTabGeneral(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(0, d->m_tabGeneral, i18nc("General tab", "General")); - if (d->m_initialState.reportType() == MyMoneyReport::ePivotTable) { + if (d->m_initialState.reportType() == MyMoneyReport::Report::PivotTable) { int tabNr = 1; if (!(d->m_initialState.isIncludingPrice() || d->m_initialState.isIncludingAveragePrice())) { d->m_tabRowColPivot = new ReportTabRowColPivot(d->ui->m_criteriaTab); @@ -155,18 +155,18 @@ connect(d->m_tabRange->ui->m_comboColumns, static_cast(&QComboBox::activated), this, static_cast(&KReportConfigurationFilterDlg::slotUpdateColumnsCombo)); } connect(d->m_tabChart->ui->m_logYaxis, &QCheckBox::stateChanged, this, &KReportConfigurationFilterDlg::slotLogAxisChanged); - } else if (d->m_initialState.reportType() == MyMoneyReport::eQueryTable) { + } else if (d->m_initialState.reportType() == MyMoneyReport::Report::QueryTable) { // eInvestmentHoldings is a special-case report, and you cannot configure the // rows & columns of that report. - if (d->m_initialState.rowType() < MyMoneyReport::eAccountByTopAccount) { + if (d->m_initialState.rowType() < MyMoneyReport::Row::AccountByTopAccount) { d->m_tabRowColQuery = new ReportTabRowColQuery(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabRowColQuery, i18n("Rows/Columns")); } - if (d->m_initialState.queryColumns() & MyMoneyReport::eQCcapitalgain) { + if (d->m_initialState.queryColumns() & MyMoneyReport::QueryColumns::Capitalgain) { d->m_tabCapitalGain = new ReportTabCapitalGain(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabCapitalGain, i18n("Report")); } - if (d->m_initialState.queryColumns() & MyMoneyReport::eQCperformance) { + if (d->m_initialState.queryColumns() & MyMoneyReport::QueryColumns::Performance) { d->m_tabPerformance = new ReportTabPerformance(d->ui->m_criteriaTab); d->ui->m_criteriaTab->insertTab(1, d->m_tabPerformance, i18n("Report")); } @@ -214,13 +214,13 @@ d->m_currentState.setSkipZero(d->m_tabGeneral->ui->m_skipZero->isChecked()); if (d->m_tabRowColPivot) { - MyMoneyReport::EDetailLevel dl[4] = { MyMoneyReport::eDetailAll, MyMoneyReport::eDetailTop, MyMoneyReport::eDetailGroup, MyMoneyReport::eDetailTotal }; + MyMoneyReport::Detail::Level dl[4] = { MyMoneyReport::Detail::All, MyMoneyReport::Detail::Top, MyMoneyReport::Detail::Group, MyMoneyReport::Detail::Total }; d->m_currentState.setDetailLevel(dl[d->m_tabRowColPivot->ui->m_comboDetail->currentIndex()]); // modify the rowtype only if the widget is enabled if (d->m_tabRowColPivot->ui->m_comboRows->isEnabled()) { - MyMoneyReport::ERowType rt[2] = { MyMoneyReport::eExpenseIncome, MyMoneyReport::eAssetLiability }; + MyMoneyReport::Row::Type rt[2] = { MyMoneyReport::Row::ExpenseIncome, MyMoneyReport::Row::AssetLiability }; d->m_currentState.setRowType(rt[d->m_tabRowColPivot->ui->m_comboRows->currentIndex()]); } @@ -236,7 +236,7 @@ d->m_currentState.setIncludingUnusedAccounts(d->m_tabRowColPivot->ui->m_checkUnused->isChecked()); if (d->m_tabRowColPivot->ui->m_comboBudget->isEnabled()) { - d->m_currentState.setBudget(d->m_budgets[d->m_tabRowColPivot->ui->m_comboBudget->currentItem()].id(), d->m_initialState.rowType() == MyMoneyReport::eBudgetActual); + d->m_currentState.setBudget(d->m_budgets[d->m_tabRowColPivot->ui->m_comboBudget->currentItem()].id(), d->m_initialState.rowType() == MyMoneyReport::Row::BudgetActual); } else { d->m_currentState.setBudget(QString(), false); } @@ -246,52 +246,52 @@ d->m_currentState.setMovingAverageDays(d->m_tabRowColPivot->ui->m_movingAverageDays->value()); } } else if (d->m_tabRowColQuery) { - MyMoneyReport::ERowType rtq[8] = { MyMoneyReport::eCategory, MyMoneyReport::eTopCategory, MyMoneyReport::eTag, MyMoneyReport::ePayee, MyMoneyReport::eAccount, MyMoneyReport::eTopAccount, MyMoneyReport::eMonth, MyMoneyReport::eWeek }; + MyMoneyReport::Row::Type rtq[8] = { MyMoneyReport::Row::Category, MyMoneyReport::Row::TopCategory, MyMoneyReport::Row::Tag, MyMoneyReport::Row::Payee, MyMoneyReport::Row::Account, MyMoneyReport::Row::TopAccount, MyMoneyReport::Row::Month, MyMoneyReport::Row::Week }; d->m_currentState.setRowType(rtq[d->m_tabRowColQuery->ui->m_comboOrganizeBy->currentIndex()]); - unsigned qc = MyMoneyReport::eQCnone; + unsigned qc = MyMoneyReport::QueryColumns::None; - if (d->m_currentState.queryColumns() & MyMoneyReport::eQCloan) + if (d->m_currentState.queryColumns() & MyMoneyReport::QueryColumns::Loan) // once a loan report, always a loan report - qc = MyMoneyReport::eQCloan; + qc = MyMoneyReport::QueryColumns::Loan; if (d->m_tabRowColQuery->ui->m_checkNumber->isChecked()) - qc |= MyMoneyReport::eQCnumber; + qc |= MyMoneyReport::QueryColumns::Number; if (d->m_tabRowColQuery->ui->m_checkPayee->isChecked()) - qc |= MyMoneyReport::eQCpayee; + qc |= MyMoneyReport::QueryColumns::Payee; if (d->m_tabRowColQuery->ui->m_checkTag->isChecked()) - qc |= MyMoneyReport::eQCtag; + qc |= MyMoneyReport::QueryColumns::Tag; if (d->m_tabRowColQuery->ui->m_checkCategory->isChecked()) - qc |= MyMoneyReport::eQCcategory; + qc |= MyMoneyReport::QueryColumns::Category; if (d->m_tabRowColQuery->ui->m_checkMemo->isChecked()) - qc |= MyMoneyReport::eQCmemo; + qc |= MyMoneyReport::QueryColumns::Memo; if (d->m_tabRowColQuery->ui->m_checkAccount->isChecked()) - qc |= MyMoneyReport::eQCaccount; + qc |= MyMoneyReport::QueryColumns::Account; if (d->m_tabRowColQuery->ui->m_checkReconciled->isChecked()) - qc |= MyMoneyReport::eQCreconciled; + qc |= MyMoneyReport::QueryColumns::Reconciled; if (d->m_tabRowColQuery->ui->m_checkAction->isChecked()) - qc |= MyMoneyReport::eQCaction; + qc |= MyMoneyReport::QueryColumns::Action; if (d->m_tabRowColQuery->ui->m_checkShares->isChecked()) - qc |= MyMoneyReport::eQCshares; + qc |= MyMoneyReport::QueryColumns::Shares; if (d->m_tabRowColQuery->ui->m_checkPrice->isChecked()) - qc |= MyMoneyReport::eQCprice; + qc |= MyMoneyReport::QueryColumns::Price; if (d->m_tabRowColQuery->ui->m_checkBalance->isChecked()) - qc |= MyMoneyReport::eQCbalance; + qc |= MyMoneyReport::QueryColumns::Balance; - d->m_currentState.setQueryColumns(static_cast(qc)); + d->m_currentState.setQueryColumns(static_cast(qc)); d->m_currentState.setTax(d->m_tabRowColQuery->ui->m_checkTax->isChecked()); d->m_currentState.setInvestmentsOnly(d->m_tabRowColQuery->ui->m_checkInvestments->isChecked()); d->m_currentState.setLoansOnly(d->m_tabRowColQuery->ui->m_checkLoans->isChecked()); d->m_currentState.setDetailLevel(d->m_tabRowColQuery->ui->m_checkHideSplitDetails->isChecked() ? - MyMoneyReport::eDetailNone : MyMoneyReport::eDetailAll); + MyMoneyReport::Detail::None : MyMoneyReport::Detail::All); d->m_currentState.setHideTransactions(d->m_tabRowColQuery->ui->m_checkHideTransactions->isChecked()); d->m_currentState.setShowingColumnTotals(!d->m_tabRowColQuery->ui->m_checkHideTotals->isChecked()); } if (d->m_tabChart) { - MyMoneyReport::EChartType ct[5] = { MyMoneyReport::eChartLine, MyMoneyReport::eChartBar, MyMoneyReport::eChartStackedBar, MyMoneyReport::eChartPie, MyMoneyReport::eChartRing }; + MyMoneyReport::Chart::Type ct[5] = { MyMoneyReport::Chart::Line, MyMoneyReport::Chart::Bar, MyMoneyReport::Chart::StackedBar, MyMoneyReport::Chart::Pie, MyMoneyReport::Chart::Ring }; d->m_currentState.setChartType(ct[d->m_tabChart->ui->m_comboType->currentIndex()]); d->m_currentState.setChartCHGridLines(d->m_tabChart->ui->m_checkCHGridLines->isChecked()); @@ -310,7 +310,7 @@ d->m_currentState.setYLabelsPrecision(d->m_tabRange->ui->m_yLabelsPrecision->value()); d->m_currentState.setDataFilter((MyMoneyReport::dataOptionE)d->m_tabRange->ui->m_dataLock->currentIndex()); - 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 }; d->m_currentState.setColumnType(ct[d->m_tabRange->ui->m_comboColumns->currentIndex()]); @@ -327,12 +327,12 @@ d->m_currentState.setShowSTLTCapitalGains(d->m_tabCapitalGain->ui->m_showSTLTCapitalGains->isChecked()); d->m_currentState.setSettlementPeriod(d->m_tabCapitalGain->ui->m_settlementPeriod->value()); d->m_currentState.setShowingColumnTotals(!d->m_tabCapitalGain->ui->m_checkHideTotals->isChecked()); - d->m_currentState.setInvestmentSum(static_cast(d->m_tabCapitalGain->ui->m_investmentSum->currentData().toInt())); + d->m_currentState.setInvestmentSum(static_cast(d->m_tabCapitalGain->ui->m_investmentSum->currentData().toInt())); } if (d->m_tabPerformance) { d->m_currentState.setShowingColumnTotals(!d->m_tabPerformance->ui->m_checkHideTotals->isChecked()); - d->m_currentState.setInvestmentSum(static_cast(d->m_tabPerformance->ui->m_investmentSum->currentData().toInt())); + d->m_currentState.setInvestmentSum(static_cast(d->m_tabPerformance->ui->m_investmentSum->currentData().toInt())); } done(true); @@ -403,27 +403,27 @@ if (d->m_tabRowColPivot) { KComboBox *combo = d->m_tabRowColPivot->ui->m_comboDetail; switch (d->m_initialState.detailLevel()) { - case MyMoneyReport::eDetailNone: - case MyMoneyReport::eDetailEnd: - case MyMoneyReport::eDetailAll: + case MyMoneyReport::Detail::None: + case MyMoneyReport::Detail::End: + case MyMoneyReport::Detail::All: combo->setCurrentItem(i18nc("All accounts", "All"), false); break; - case MyMoneyReport::eDetailTop: + case MyMoneyReport::Detail::Top: combo->setCurrentItem(i18n("Top-Level"), false); break; - case MyMoneyReport::eDetailGroup: + case MyMoneyReport::Detail::Group: combo->setCurrentItem(i18n("Groups"), false); break; - case MyMoneyReport::eDetailTotal: + case MyMoneyReport::Detail::Total: combo->setCurrentItem(i18n("Totals"), false); break; } combo = d->m_tabRowColPivot->ui->m_comboRows; switch (d->m_initialState.rowType()) { - case MyMoneyReport::eExpenseIncome: - case MyMoneyReport::eBudget: - case MyMoneyReport::eBudgetActual: + case MyMoneyReport::Row::ExpenseIncome: + case MyMoneyReport::Row::Budget: + case MyMoneyReport::Row::BudgetActual: combo->setCurrentItem(i18n("Income & Expenses"), false); // income / expense break; default: @@ -436,8 +436,8 @@ slotRowTypeChanged(combo->currentIndex()); //load budgets combo - if (d->m_initialState.rowType() == MyMoneyReport::eBudget - || d->m_initialState.rowType() == MyMoneyReport::eBudgetActual) { + if (d->m_initialState.rowType() == MyMoneyReport::Row::Budget + || d->m_initialState.rowType() == MyMoneyReport::Row::BudgetActual) { d->m_tabRowColPivot->ui->m_comboRows->setEnabled(false); d->m_tabRowColPivot->ui->m_budgetFrame->setEnabled(!d->m_budgets.empty()); auto i = 0; @@ -464,47 +464,47 @@ } else if (d->m_tabRowColQuery) { KComboBox *combo = d->m_tabRowColQuery->ui->m_comboOrganizeBy; switch (d->m_initialState.rowType()) { - case MyMoneyReport::eNoColumns: - case MyMoneyReport::eCategory: + case MyMoneyReport::Column::NoColumns: + case MyMoneyReport::Row::Category: combo->setCurrentItem(i18n("Categories"), false); break; - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::TopCategory: combo->setCurrentItem(i18n("Top Categories"), false); break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: combo->setCurrentItem(i18n("Tags"), false); break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: combo->setCurrentItem(i18n("Payees"), false); break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: combo->setCurrentItem(i18n("Accounts"), false); break; - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::TopAccount: combo->setCurrentItem(i18n("Top Accounts"), false); break; - case MyMoneyReport::eMonth: + case MyMoneyReport::Row::Month: combo->setCurrentItem(i18n("Month"), false); break; - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Week: combo->setCurrentItem(i18n("Week"), false); break; default: throw MYMONEYEXCEPTION("KReportConfigurationFilterDlg::slotReset(): QueryTable report has invalid rowtype"); } unsigned qc = d->m_initialState.queryColumns(); - d->m_tabRowColQuery->ui->m_checkNumber->setChecked(qc & MyMoneyReport::eQCnumber); - d->m_tabRowColQuery->ui->m_checkPayee->setChecked(qc & MyMoneyReport::eQCpayee); - d->m_tabRowColQuery->ui->m_checkTag->setChecked(qc & MyMoneyReport::eQCtag); - d->m_tabRowColQuery->ui->m_checkCategory->setChecked(qc & MyMoneyReport::eQCcategory); - d->m_tabRowColQuery->ui->m_checkMemo->setChecked(qc & MyMoneyReport::eQCmemo); - d->m_tabRowColQuery->ui->m_checkAccount->setChecked(qc & MyMoneyReport::eQCaccount); - d->m_tabRowColQuery->ui->m_checkReconciled->setChecked(qc & MyMoneyReport::eQCreconciled); - d->m_tabRowColQuery->ui->m_checkAction->setChecked(qc & MyMoneyReport::eQCaction); - d->m_tabRowColQuery->ui->m_checkShares->setChecked(qc & MyMoneyReport::eQCshares); - d->m_tabRowColQuery->ui->m_checkPrice->setChecked(qc & MyMoneyReport::eQCprice); - d->m_tabRowColQuery->ui->m_checkBalance->setChecked(qc & MyMoneyReport::eQCbalance); + d->m_tabRowColQuery->ui->m_checkNumber->setChecked(qc & MyMoneyReport::QueryColumns::Number); + d->m_tabRowColQuery->ui->m_checkPayee->setChecked(qc & MyMoneyReport::QueryColumns::Payee); + d->m_tabRowColQuery->ui->m_checkTag->setChecked(qc & MyMoneyReport::QueryColumns::Tag); + d->m_tabRowColQuery->ui->m_checkCategory->setChecked(qc & MyMoneyReport::QueryColumns::Category); + d->m_tabRowColQuery->ui->m_checkMemo->setChecked(qc & MyMoneyReport::QueryColumns::Memo); + d->m_tabRowColQuery->ui->m_checkAccount->setChecked(qc & MyMoneyReport::QueryColumns::Account); + d->m_tabRowColQuery->ui->m_checkReconciled->setChecked(qc & MyMoneyReport::QueryColumns::Reconciled); + d->m_tabRowColQuery->ui->m_checkAction->setChecked(qc & MyMoneyReport::QueryColumns::Action); + d->m_tabRowColQuery->ui->m_checkShares->setChecked(qc & MyMoneyReport::QueryColumns::Shares); + d->m_tabRowColQuery->ui->m_checkPrice->setChecked(qc & MyMoneyReport::QueryColumns::Price); + d->m_tabRowColQuery->ui->m_checkBalance->setChecked(qc & MyMoneyReport::QueryColumns::Balance); d->m_tabRowColQuery->ui->m_checkTax->setChecked(d->m_initialState.isTax()); d->m_tabRowColQuery->ui->m_checkInvestments->setChecked(d->m_initialState.isInvestmentsOnly()); @@ -515,20 +515,20 @@ d->m_tabRowColQuery->ui->m_checkHideSplitDetails->setEnabled(!d->m_initialState.isHideTransactions()); d->m_tabRowColQuery->ui->m_checkHideSplitDetails->setChecked - (d->m_initialState.detailLevel() == MyMoneyReport::eDetailNone || d->m_initialState.isHideTransactions()); + (d->m_initialState.detailLevel() == MyMoneyReport::Detail::None || d->m_initialState.isHideTransactions()); } if (d->m_tabChart) { KMyMoneyGeneralCombo* combo = d->m_tabChart->ui->m_comboType; switch (d->m_initialState.chartType()) { - case MyMoneyReport::eChartNone: - combo->setCurrentItem(MyMoneyReport::eChartLine); + case MyMoneyReport::Chart::None: + combo->setCurrentItem(MyMoneyReport::Chart::Line); break; - case MyMoneyReport::eChartLine: - case MyMoneyReport::eChartBar: - case MyMoneyReport::eChartStackedBar: - case MyMoneyReport::eChartPie: - case MyMoneyReport::eChartRing: + case MyMoneyReport::Chart::Line: + case MyMoneyReport::Chart::Bar: + case MyMoneyReport::Chart::StackedBar: + case MyMoneyReport::Chart::Pie: + case MyMoneyReport::Chart::Ring: combo->setCurrentItem(d->m_initialState.chartType()); break; default: @@ -553,29 +553,29 @@ KComboBox *combo = d->m_tabRange->ui->m_comboColumns; if (d->m_initialState.isColumnsAreDays()) { switch (d->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: break; } } else { switch (d->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: @@ -591,20 +591,20 @@ d->m_tabCapitalGain->ui->m_checkHideTotals->setChecked(!d->m_initialState.isShowingColumnTotals()); d->m_tabCapitalGain->ui->m_investmentSum->blockSignals(true); d->m_tabCapitalGain->ui->m_investmentSum->clear(); - d->m_tabCapitalGain->ui->m_investmentSum->addItem(i18n("Only owned"), MyMoneyReport::eSumOwned); - d->m_tabCapitalGain->ui->m_investmentSum->addItem(i18n("Only sold"), MyMoneyReport::eSumSold); + d->m_tabCapitalGain->ui->m_investmentSum->addItem(i18n("Only owned"), MyMoneyReport::Investment::Owned); + d->m_tabCapitalGain->ui->m_investmentSum->addItem(i18n("Only sold"), MyMoneyReport::Investment::Sold); d->m_tabCapitalGain->ui->m_investmentSum->blockSignals(false); d->m_tabCapitalGain->ui->m_investmentSum->setCurrentIndex(d->m_tabCapitalGain->ui->m_investmentSum->findData(d->m_initialState.investmentSum())); } if (d->m_tabPerformance) { d->m_tabPerformance->ui->m_checkHideTotals->setChecked(!d->m_initialState.isShowingColumnTotals()); d->m_tabPerformance->ui->m_investmentSum->blockSignals(true); d->m_tabPerformance->ui->m_investmentSum->clear(); - d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("From period"), MyMoneyReport::eSumPeriod); - d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Owned and sold"), MyMoneyReport::eSumOwnedAndSold); - d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Only owned"), MyMoneyReport::eSumOwned); - d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Only sold"), MyMoneyReport::eSumSold); + d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("From period"), MyMoneyReport::Investment::Period); + d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Owned and sold"), MyMoneyReport::Investment::OwnedAndSold); + d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Only owned"), MyMoneyReport::Investment::Owned); + d->m_tabPerformance->ui->m_investmentSum->addItem(i18n("Only sold"), MyMoneyReport::Investment::Sold); d->m_tabPerformance->ui->m_investmentSum->blockSignals(false); d->m_tabPerformance->ui->m_investmentSum->setCurrentIndex(d->m_tabPerformance->ui->m_investmentSum->findData(d->m_initialState.investmentSum())); } diff --git a/kmymoney/kmymoney.cpp b/kmymoney/kmymoney.cpp --- a/kmymoney/kmymoney.cpp +++ b/kmymoney/kmymoney.cpp @@ -377,7 +377,7 @@ new KmymoneyAdaptor(this); QDBusConnection::sessionBus().registerObject("/KMymoney", this); QDBusConnection::sessionBus().interface()->registerService( - "org.kde.kmymoney", QDBusConnectionInterface::DontQueueService); + "org.kde.kmymoney-" + QString::number(platformTools::processId()), QDBusConnectionInterface::DontQueueService); #endif // Register the main engine types used as meta-objects qRegisterMetaType("MyMoneyMoney"); @@ -1455,7 +1455,7 @@ selectedKeyName = dlg->secretKey(); } delete dlg; - if ((rc != QDialog::Accepted) || (dlg == 0)) { + if (rc != QDialog::Accepted) { return false; } } diff --git a/kmymoney/main.cpp b/kmymoney/main.cpp --- a/kmymoney/main.cpp +++ b/kmymoney/main.cpp @@ -258,10 +258,7 @@ if (kmymoney->isImportableFile(file)) { instantQuit = true; kmymoney->webConnect()->loadFile(file); - } - } else if (KMessageBox::questionYesNo(0, i18n("Another instance of KMyMoney is already running. Do you want to quit?")) == KMessageBox::Yes) { - instantQuit = true; } } diff --git a/kmymoney/mymoney/mymoneyreport.h b/kmymoney/mymoney/mymoneyreport.h --- a/kmymoney/mymoney/mymoneyreport.h +++ b/kmymoney/mymoney/mymoneyreport.h @@ -71,33 +71,72 @@ 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 }; - - // 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 - enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCtag = 0x8, eQCmemo = 0x10, eQCaccount = 0x20, eQCreconciled = 0x40, eQCaction = 0x80, eQCshares = 0x100, eQCprice = 0x200, eQCperformance = 0x400, eQCloan = 0x800, eQCbalance = 0x1000, eQCcapitalgain = 0x2000, eQCend = 0x4000 }; - - enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; - enum EInvestmentSum { eSumPeriod = 0, eSumOwnedAndSold, eSumOwned, eSumSold, eSumBought}; - enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; + class Row { + public: + enum Type { NoRows = 0, AssetLiability, ExpenseIncome, Category, TopCategory, Account, Tag, Payee, Month, Week, TopAccount, AccountByTopAccount, EquityType, AccountType, Institution, Budget, BudgetActual, Schedule, AccountInfo, AccountLoanInfo, AccountReconcile, CashFlow}; + /** + * Return row type as string. + * + * @param type type to get string for + * @return row type converted to string + */ + static QString toString(Type type); + static const QStringList kText; + }; + + + class Report { + public: + enum Type { NoReport = 0, PivotTable, QueryTable, InfoTable }; + /** + * Return report type as string. + * + * @param type report type to get string for + * @return report type converted to string + */ + static QString toString(Type type); + static const Type kTypeArray[]; + }; + + class Column { + public: + enum Type { NoColumns = 0, Days = 1, Months = 1, BiMonths = 2, Quarters = 3, Weeks = 7, Years = 12 }; + static const QStringList kText; + }; + + // if you add bits to this bitmask, start with the value currently assigned to end and update its value afterwards + // also don't forget to add column names to QueryColumns::kText in mymoneyreport.cpp + class QueryColumns { + public: + enum Type { None = 0x0, Begin = 0x1, Number = 0x1, Payee = 0x2, Category = 0x4, Tag = 0x8, Memo = 0x10, Account = 0x20, Reconciled = 0x40, Action = 0x80, Shares = 0x100, Price = 0x200, Performance = 0x400, Loan = 0x800, Balance = 0x1000, Capitalgain = 0x2000, End = 0x4000 }; + static const QStringList kText; + }; + + class Detail { + public: + enum Level { None = 0, All, Top, Group, Total, End }; + static const QStringList kText; + }; + + class Chart { + public: + enum Type { None = 0, Line, Bar, Pie, Ring, StackedBar, End }; + static const QStringList kText; + }; + + class Investment { + public: + enum Sum { Period = 0, OwnedAndSold, Owned, Sold, SumBought }; + }; enum dataOptionE { automatic = 0, userDefined, dataOptionCount }; - static const QStringList kRowTypeText; - static const QStringList kColumnTypeText; - static const QStringList kQueryColumnsText; - static const QStringList kDetailLevelText; - static const QStringList kChartTypeText; - static const EReportType kTypeArray[]; - public: MyMoneyReport(); - explicit MyMoneyReport(ERowType rt, + explicit MyMoneyReport(Row::Type rt, unsigned ct, eMyMoney::TransactionFilter::Date dl, - EDetailLevel ss, + Detail::Level ss, const QString& name, const QString& comment); /** @@ -117,7 +156,7 @@ ~MyMoneyReport(); - EReportType reportType() const; + Report::Type reportType() const; QString name() const; void setName(const QString& s); @@ -128,22 +167,22 @@ bool isShowingColumnTotals() const; void setShowingColumnTotals(bool f); - ERowType rowType() const; - void setRowType(ERowType rt); + Row::Type rowType() const; + void setRowType(Row::Type rt); bool isRunningSum() const; - EColumnType columnType() const; - void setColumnType(EColumnType ct); + Column::Type columnType() const; + void setColumnType(Column::Type ct); bool isConvertCurrency() const; void setConvertCurrency(bool f); uint columnPitch() const; QString comment() const; void setComment(const QString& comment); - EQueryColumns queryColumns() const; - void setQueryColumns(EQueryColumns qc); + QueryColumns::Type queryColumns() const; + void setQueryColumns(QueryColumns::Type qc); QString group() const; void setGroup(const QString& group); @@ -160,17 +199,17 @@ bool isLoansOnly() const; void setLoansOnly(bool f); - EDetailLevel detailLevel() const; - void setDetailLevel(EDetailLevel detail); + Detail::Level detailLevel() const; + void setDetailLevel(Detail::Level detail); - EInvestmentSum investmentSum() const; - void setInvestmentSum(EInvestmentSum sum); + Investment::Sum investmentSum() const; + void setInvestmentSum(Investment::Sum sum); bool isHideTransactions() const; void setHideTransactions(bool f); - EChartType chartType() const; - void setChartType(EChartType type); + Chart::Type chartType() const; + void setChartType(Chart::Type type); bool isChartDataLabels() const; void setChartDataLabels(bool f); @@ -452,15 +491,15 @@ * @param type type to get string for * @return row type converted to string */ - static QString toString(ERowType type); + static QString toString(Row::Type type); /** * Return report type as string. * * @param type report type to get string for * @return report type converted to string */ - static QString toString(EReportType type); + static QString toString(Report::Type type); }; inline void swap(MyMoneyReport& first, MyMoneyReport& second) // krazy:exclude=inline diff --git a/kmymoney/mymoney/mymoneyreport.cpp b/kmymoney/mymoney/mymoneyreport.cpp --- a/kmymoney/mymoney/mymoneyreport.cpp +++ b/kmymoney/mymoney/mymoneyreport.cpp @@ -44,16 +44,16 @@ // define this to debug reports // #define DEBUG_REPORTS -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(','); +const QStringList MyMoneyReport::Row::kText = 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::Column::kText = 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 -const QStringList MyMoneyReport::kQueryColumnsText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance,capitalgain").split(','); +// if you add names here, don't forget to update the bitmap for QueryColumns::Type +// and shift the bit for QueryColumns::end one position to the left +const QStringList MyMoneyReport::QueryColumns::kText = QString("none,number,payee,category,tag,memo,account,reconcileflag,action,shares,price,performance,loan,balance").split(','); -const MyMoneyReport::EReportType MyMoneyReport::kTypeArray[] = { eNoReport, ePivotTable, ePivotTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, ePivotTable, ePivotTable, eInfoTable, eInfoTable, eInfoTable, eQueryTable, eQueryTable, eNoReport }; -const QStringList MyMoneyReport::kDetailLevelText = QString("none,all,top,group,total,invalid").split(','); -const QStringList MyMoneyReport::kChartTypeText = QString("none,line,bar,pie,ring,stackedbar").split(','); +const MyMoneyReport::Report::Type MyMoneyReport::Report::kTypeArray[] = { NoReport, PivotTable, PivotTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, QueryTable, PivotTable, PivotTable, InfoTable, InfoTable, InfoTable, QueryTable, QueryTable, NoReport }; +const QStringList MyMoneyReport::Detail::kText = QString("none,all,top,group,total,invalid").split(','); +const QStringList MyMoneyReport::Chart::kText = QString("none,line,bar,pie,ring,stackedbar").split(','); // This should live in mymoney/mymoneytransactionfilter.h const QStringList kTypeText = QString("all,payments,deposits,transfers,none").split(','); @@ -67,22 +67,22 @@ { Q_D(MyMoneyReport); d->m_name = "Unconfigured Pivot Table Report"; - d->m_detailLevel = eDetailNone; - d->m_investmentSum = eSumSold; + d->m_detailLevel = Detail::None; + d->m_investmentSum = Investment::Sold; d->m_hideTransactions = false; d->m_convertCurrency = true; d->m_favorite = false; d->m_tax = false; d->m_investments = false; d->m_loans = false; - d->m_reportType = kTypeArray[eExpenseIncome]; - d->m_rowType = eExpenseIncome; - d->m_columnType = eMonths; + d->m_reportType = Report::kTypeArray[Row::ExpenseIncome]; + d->m_rowType = Row::ExpenseIncome; + d->m_columnType = Column::Months; d->m_columnsAreDays = false; - d->m_queryColumns = eQCnone; + d->m_queryColumns = QueryColumns::None; d->m_dateLock = TransactionFilter::Date::UserDefined; d->m_accountGroupFilter = false; - d->m_chartType = eChartLine; + d->m_chartType = Chart::Line; d->m_chartDataLabels = true; d->m_chartCHGridLines = true; d->m_chartSVGridLines = true; @@ -114,33 +114,33 @@ d->m_chartLineWidth = m_lineWidth; } -MyMoneyReport::MyMoneyReport(ERowType rt, +MyMoneyReport::MyMoneyReport(Row::Type rt, unsigned ct, TransactionFilter::Date dl, - EDetailLevel ss, + Detail::Level ss, const QString& name, const QString& comment) : MyMoneyObject(*new MyMoneyReportPrivate) { Q_D(MyMoneyReport); d->m_name = name; d->m_comment = comment; d->m_detailLevel = ss; - d->m_investmentSum = ct & eQCcapitalgain ? eSumSold : eSumPeriod; + d->m_investmentSum = ct & QueryColumns::Capitalgain ? Investment::Sold : Investment::Period; d->m_hideTransactions = false; d->m_convertCurrency = true; d->m_favorite = false; d->m_tax = false; d->m_investments = false; d->m_loans = false; - d->m_reportType = kTypeArray[rt]; + d->m_reportType = Report::kTypeArray[rt]; d->m_rowType = rt; - d->m_columnType = eMonths; + d->m_columnType = Column::Months; d->m_columnsAreDays = false; - d->m_queryColumns = eQCnone; + d->m_queryColumns = QueryColumns::None; d->m_dateLock = dl; d->m_accountGroupFilter = false; - d->m_chartType = eChartLine; + d->m_chartType = Chart::Line; d->m_chartDataLabels = true; d->m_chartCHGridLines = true; d->m_chartSVGridLines = true; @@ -174,24 +174,24 @@ d->m_chartLineWidth = m_lineWidth; //set report type - if (d->m_reportType == ePivotTable) - d->m_columnType = static_cast(ct); - if (d->m_reportType == eQueryTable) - d->m_queryColumns = static_cast(ct); + if (d->m_reportType == Report::PivotTable) + d->m_columnType = static_cast(ct); + if (d->m_reportType == Report::QueryTable) + d->m_queryColumns = static_cast(ct); setDateFilter(dl); //throw exception if the type is inconsistent - if ((rt > static_cast(sizeof(kTypeArray) / sizeof(kTypeArray[0]))) - || (d->m_reportType == eNoReport)) + if ((rt > static_cast(sizeof(Report::kTypeArray) / sizeof(Report::kTypeArray[0]))) + || (d->m_reportType == Report::NoReport)) throw MYMONEYEXCEPTION("Invalid report type"); //add the corresponding account groups - if (rt == MyMoneyReport::eAssetLiability) { + if (rt == MyMoneyReport::Row::AssetLiability) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); d->m_showRowTotals = true; } - if (rt == MyMoneyReport::eAccount) { + if (rt == MyMoneyReport::Row::Account) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::AssetLoan); addAccountGroup(Account::Type::Cash); @@ -207,22 +207,22 @@ addAccountGroup(Account::Type::Stock); d->m_showRowTotals = true; } - if (rt == MyMoneyReport::eExpenseIncome) { + if (rt == MyMoneyReport::Row::ExpenseIncome) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); d->m_showRowTotals = true; } //FIXME take this out once we have sorted out all issues regarding budget of assets and liabilities -- asoliverez@gmail.com - if (rt == MyMoneyReport::eBudget || rt == MyMoneyReport::eBudgetActual) { + if (rt == MyMoneyReport::Row::Budget || rt == MyMoneyReport::Row::BudgetActual) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); } - if (rt == MyMoneyReport::eAccountInfo) { + if (rt == MyMoneyReport::Row::AccountInfo) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); } //cash flow reports show splits for all account groups - if (rt == MyMoneyReport::eCashFlow) { + if (rt == MyMoneyReport::Row::CashFlow) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); addAccountGroup(Account::Type::Asset); @@ -268,7 +268,7 @@ { } -MyMoneyReport::EReportType MyMoneyReport::reportType() const +MyMoneyReport::Report::Type MyMoneyReport::reportType() const { Q_D(const MyMoneyReport); return d->m_reportType; @@ -310,44 +310,44 @@ d->m_showColumnTotals = f; } -MyMoneyReport::ERowType MyMoneyReport::rowType() const +MyMoneyReport::Row::Type MyMoneyReport::rowType() const { Q_D(const MyMoneyReport); return d->m_rowType; } -void MyMoneyReport::setRowType(ERowType rt) +void MyMoneyReport::setRowType(Row::Type rt) { Q_D(MyMoneyReport); d->m_rowType = rt; - d->m_reportType = kTypeArray[rt]; + d->m_reportType = Report::kTypeArray[rt]; d->m_accountGroupFilter = false; d->m_accountGroups.clear(); - if (rt == MyMoneyReport::eAssetLiability) { + if (rt == MyMoneyReport::Row::AssetLiability) { addAccountGroup(Account::Type::Asset); addAccountGroup(Account::Type::Liability); } - if (rt == MyMoneyReport::eExpenseIncome) { + if (rt == MyMoneyReport::Row::ExpenseIncome) { addAccountGroup(Account::Type::Expense); addAccountGroup(Account::Type::Income); } } bool MyMoneyReport::isRunningSum() const { Q_D(const MyMoneyReport); - return (d->m_rowType == eAssetLiability); + return (d->m_rowType == Row::AssetLiability); } -MyMoneyReport::EColumnType MyMoneyReport::columnType() const +MyMoneyReport::Column::Type MyMoneyReport::columnType() const { Q_D(const MyMoneyReport); return d->m_columnType; } -void MyMoneyReport::setColumnType(EColumnType ct) +void MyMoneyReport::setColumnType(Column::Type ct) { Q_D(MyMoneyReport); d->m_columnType = ct; @@ -383,13 +383,13 @@ d->m_comment = comment; } -MyMoneyReport::EQueryColumns MyMoneyReport::queryColumns() const +MyMoneyReport::QueryColumns::Type MyMoneyReport::queryColumns() const { Q_D(const MyMoneyReport); return d->m_queryColumns; } -void MyMoneyReport::setQueryColumns(EQueryColumns qc) +void MyMoneyReport::setQueryColumns(QueryColumns::Type qc) { Q_D(MyMoneyReport); d->m_queryColumns = qc; @@ -455,25 +455,25 @@ d->m_loans = f; if (f) d->m_investments = false; } -MyMoneyReport::EDetailLevel MyMoneyReport::detailLevel() const +MyMoneyReport::Detail::Level MyMoneyReport::detailLevel() const { Q_D(const MyMoneyReport); return d->m_detailLevel; } -void MyMoneyReport::setDetailLevel(EDetailLevel detail) +void MyMoneyReport::setDetailLevel(Detail::Level detail) { Q_D(MyMoneyReport); d->m_detailLevel = detail; } -MyMoneyReport::EInvestmentSum MyMoneyReport::investmentSum() const +MyMoneyReport::Investment::Sum MyMoneyReport::investmentSum() const { Q_D(const MyMoneyReport); return d->m_investmentSum; } -void MyMoneyReport::setInvestmentSum(EInvestmentSum sum) +void MyMoneyReport::setInvestmentSum(Investment::Sum sum) { Q_D(MyMoneyReport); d->m_investmentSum = sum; @@ -491,13 +491,13 @@ d->m_hideTransactions = f; } -MyMoneyReport::EChartType MyMoneyReport::chartType() const +MyMoneyReport::Chart::Type MyMoneyReport::chartType() const { Q_D(const MyMoneyReport); return d->m_chartType; } -void MyMoneyReport::setChartType(EChartType type) +void MyMoneyReport::setChartType(Chart::Type type) { Q_D(MyMoneyReport); d->m_chartType = type; @@ -1007,7 +1007,7 @@ { Q_D(const MyMoneyReport); bool result = (! d->m_accountGroupFilter) - || (isIncludingTransfers() && d->m_rowType == MyMoneyReport::eExpenseIncome) + || (isIncludingTransfers() && d->m_rowType == MyMoneyReport::Row::ExpenseIncome) || d->m_accountGroups.contains(type); return result; @@ -1033,7 +1033,7 @@ result = acc.isLoan() && includesAccount(acc.id()); else if (isInvestmentsOnly()) result = acc.isInvest() && includesAccount(acc.id()); - else if (isIncludingTransfers() && d->m_rowType == MyMoneyReport::eExpenseIncome) + else if (isIncludingTransfers() && d->m_rowType == MyMoneyReport::Row::ExpenseIncome) // If transfers are included, ONLY include this account if it is NOT // included in the report itself!! result = ! includesAccount(acc.id()); @@ -1060,125 +1060,125 @@ // Feel free to change the minor type every time a change is made here. // write report's internals - if (d->m_reportType == ePivotTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "pivottable 1.15"); - else if (d->m_reportType == eQueryTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "querytable 1.14"); - else if (d->m_reportType == eInfoTable) - e.setAttribute(d->getAttrName(Report::Attribute::Type), "infotable 1.0"); + if (d->m_reportType == Report::PivotTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "pivottable 1.15"); + else if (d->m_reportType == Report::QueryTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "querytable 1.14"); + else if (d->m_reportType == Report::InfoTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::Type), "infotable 1.0"); - e.setAttribute(d->getAttrName(Report::Attribute::Group), d->m_group); - e.setAttribute(d->getAttrName(Report::Attribute::ID), d->m_id); + e.setAttribute(d->getAttrName(Reporting::Attribute::Group), d->m_group); + e.setAttribute(d->getAttrName(Reporting::Attribute::ID), d->m_id); // write general tab if (anonymous) { - e.setAttribute(d->getAttrName(Report::Attribute::Name), d->m_id); - e.setAttribute(d->getAttrName(Report::Attribute::Comment), QString(d->m_comment).fill('x')); + e.setAttribute(d->getAttrName(Reporting::Attribute::Name), d->m_id); + e.setAttribute(d->getAttrName(Reporting::Attribute::Comment), QString(d->m_comment).fill('x')); } else { - e.setAttribute(d->getAttrName(Report::Attribute::Name), d->m_name); - e.setAttribute(d->getAttrName(Report::Attribute::Comment), d->m_comment); + e.setAttribute(d->getAttrName(Reporting::Attribute::Name), d->m_name); + e.setAttribute(d->getAttrName(Reporting::Attribute::Comment), d->m_comment); } - e.setAttribute(d->getAttrName(Report::Attribute::ConvertCurrency), d->m_convertCurrency); - e.setAttribute(d->getAttrName(Report::Attribute::Favorite), d->m_favorite); - e.setAttribute(d->getAttrName(Report::Attribute::SkipZero), d->m_skipZero); + e.setAttribute(d->getAttrName(Reporting::Attribute::ConvertCurrency), d->m_convertCurrency); + e.setAttribute(d->getAttrName(Reporting::Attribute::Favorite), d->m_favorite); + e.setAttribute(d->getAttrName(Reporting::Attribute::SkipZero), d->m_skipZero); - e.setAttribute(d->getAttrName(Report::Attribute::DateLock), kDateLockText[(int)d->m_dateLock]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DateLock), kDateLockText[(int)d->m_dateLock]); - if (d->m_reportType == ePivotTable) { + if (d->m_reportType == Report::PivotTable) { // write report's internals - e.setAttribute(d->getAttrName(Report::Attribute::IncludesActuals), d->m_includeBudgetActuals); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesForecast), d->m_includeForecast); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesPrice), d->m_includePrice); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesAveragePrice), d->m_includeAveragePrice); - e.setAttribute(d->getAttrName(Report::Attribute::MixedTime), d->m_mixedTime); - e.setAttribute(d->getAttrName(Report::Attribute::Investments), d->m_investments); // it's setable in rows/columns tab of querytable, but here it is internal setting + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesActuals), d->m_includeBudgetActuals); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesForecast), d->m_includeForecast); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesPrice), d->m_includePrice); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesAveragePrice), d->m_includeAveragePrice); + e.setAttribute(d->getAttrName(Reporting::Attribute::MixedTime), d->m_mixedTime); + e.setAttribute(d->getAttrName(Reporting::Attribute::Investments), d->m_investments); // it's setable in rows/columns tab of querytable, but here it is internal setting // write rows/columns tab if (!d->m_budgetId.isEmpty()) - e.setAttribute(d->getAttrName(Report::Attribute::Budget), d->m_budgetId); + e.setAttribute(d->getAttrName(Reporting::Attribute::Budget), d->m_budgetId); - e.setAttribute(d->getAttrName(Report::Attribute::RowType), kRowTypeText[d->m_rowType]); - e.setAttribute(d->getAttrName(Report::Attribute::ShowRowTotals), d->m_showRowTotals); - e.setAttribute(d->getAttrName(Report::Attribute::ShowColumnTotals), d->m_showColumnTotals); - e.setAttribute(d->getAttrName(Report::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); + e.setAttribute(d->getAttrName(Reporting::Attribute::RowType), Row::kText[d->m_rowType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals), d->m_showRowTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), d->m_showColumnTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::Detail), Detail::kText[d->m_detailLevel]); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesMovingAverage), d->m_includeMovingAverage); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesMovingAverage), d->m_includeMovingAverage); if (d->m_includeMovingAverage) - e.setAttribute(d->getAttrName(Report::Attribute::MovingAverageDays), d->m_movingAverageDays); + e.setAttribute(d->getAttrName(Reporting::Attribute::MovingAverageDays), d->m_movingAverageDays); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesSchedules), d->m_includeSchedules); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesTransfers), d->m_includeTransfers); - e.setAttribute(d->getAttrName(Report::Attribute::IncludesUnused), d->m_includeUnusedAccounts); - e.setAttribute(d->getAttrName(Report::Attribute::ColumnsAreDays), d->m_columnsAreDays); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesSchedules), d->m_includeSchedules); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesTransfers), d->m_includeTransfers); + e.setAttribute(d->getAttrName(Reporting::Attribute::IncludesUnused), d->m_includeUnusedAccounts); + e.setAttribute(d->getAttrName(Reporting::Attribute::ColumnsAreDays), d->m_columnsAreDays); // write chart tab - if (d->m_chartType < 0 || d->m_chartType >= kChartTypeText.size()) { + if (d->m_chartType < 0 || d->m_chartType >= Chart::kText.size()) { qDebug("m_chartType out of bounds with %d on report of type %d. Default to none.", d->m_chartType, d->m_reportType); - e.setAttribute(d->getAttrName(Report::Attribute::ChartType), kChartTypeText[eChartNone]); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartType), Chart::kText[Chart::None]); } else - e.setAttribute(d->getAttrName(Report::Attribute::ChartType), kChartTypeText[d->m_chartType]); - - e.setAttribute(d->getAttrName(Report::Attribute::ChartCHGridLines), d->m_chartCHGridLines); - e.setAttribute(d->getAttrName(Report::Attribute::ChartSVGridLines), d->m_chartSVGridLines); - e.setAttribute(d->getAttrName(Report::Attribute::ChartDataLabels), d->m_chartDataLabels); - e.setAttribute(d->getAttrName(Report::Attribute::ChartByDefault), d->m_chartByDefault); - e.setAttribute(d->getAttrName(Report::Attribute::LogYAxis), d->m_logYaxis); - e.setAttribute(d->getAttrName(Report::Attribute::ChartLineWidth), d->m_chartLineWidth); - e.setAttribute(d->getAttrName(Report::Attribute::ColumnType), kColumnTypeText[d->m_columnType]); - e.setAttribute(d->getAttrName(Report::Attribute::DataLock), kDataLockText[d->m_dataLock]); - e.setAttribute(d->getAttrName(Report::Attribute::DataRangeStart), d->m_dataRangeStart); - e.setAttribute(d->getAttrName(Report::Attribute::DataRangeEnd), d->m_dataRangeEnd); - e.setAttribute(d->getAttrName(Report::Attribute::DataMajorTick), d->m_dataMajorTick); - e.setAttribute(d->getAttrName(Report::Attribute::DataMinorTick), d->m_dataMinorTick); - e.setAttribute(d->getAttrName(Report::Attribute::YLabelsPrecision), d->m_yLabelsPrecision); - } else if (d->m_reportType == eQueryTable) { + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartType), Chart::kText[d->m_chartType]); + + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartCHGridLines), d->m_chartCHGridLines); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartSVGridLines), d->m_chartSVGridLines); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartDataLabels), d->m_chartDataLabels); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartByDefault), d->m_chartByDefault); + e.setAttribute(d->getAttrName(Reporting::Attribute::LogYAxis), d->m_logYaxis); + e.setAttribute(d->getAttrName(Reporting::Attribute::ChartLineWidth), d->m_chartLineWidth); + e.setAttribute(d->getAttrName(Reporting::Attribute::ColumnType), Column::kText[d->m_columnType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataLock), kDataLockText[d->m_dataLock]); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataRangeStart), d->m_dataRangeStart); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataRangeEnd), d->m_dataRangeEnd); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataMajorTick), d->m_dataMajorTick); + e.setAttribute(d->getAttrName(Reporting::Attribute::DataMinorTick), d->m_dataMinorTick); + e.setAttribute(d->getAttrName(Reporting::Attribute::YLabelsPrecision), d->m_yLabelsPrecision); + } else if (d->m_reportType == Report::QueryTable) { // write rows/columns tab - e.setAttribute(d->getAttrName(Report::Attribute::RowType), kRowTypeText[d->m_rowType]); + e.setAttribute(d->getAttrName(Reporting::Attribute::RowType), Row::kText[d->m_rowType]); QStringList columns; unsigned qc = d->m_queryColumns; - unsigned it_qc = eQCbegin; + unsigned it_qc = QueryColumns::Type::Begin; unsigned index = 1; - while (it_qc != eQCend) { + while (it_qc != QueryColumns::Type::End) { if (qc & it_qc) - columns += kQueryColumnsText[index]; + columns += QueryColumns::kText[index]; it_qc *= 2; index++; } - e.setAttribute(d->getAttrName(Report::Attribute::QueryColumns), columns.join(",")); + e.setAttribute(d->getAttrName(Reporting::Attribute::QueryColumns), columns.join(",")); - e.setAttribute(d->getAttrName(Report::Attribute::Tax), d->m_tax); - e.setAttribute(d->getAttrName(Report::Attribute::Investments), d->m_investments); - e.setAttribute(d->getAttrName(Report::Attribute::Loans), d->m_loans); - e.setAttribute(d->getAttrName(Report::Attribute::HideTransactions), d->m_hideTransactions); - e.setAttribute(d->getAttrName(Report::Attribute::ShowColumnTotals), d->m_showColumnTotals); - e.setAttribute(d->getAttrName(Report::Attribute::Detail), kDetailLevelText[d->m_detailLevel]); + e.setAttribute(d->getAttrName(Reporting::Attribute::Tax), d->m_tax); + e.setAttribute(d->getAttrName(Reporting::Attribute::Investments), d->m_investments); + e.setAttribute(d->getAttrName(Reporting::Attribute::Loans), d->m_loans); + e.setAttribute(d->getAttrName(Reporting::Attribute::HideTransactions), d->m_hideTransactions); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), d->m_showColumnTotals); + e.setAttribute(d->getAttrName(Reporting::Attribute::Detail), Detail::kText[d->m_detailLevel]); // write performance tab - if (d->m_queryColumns & eQCperformance || d->m_queryColumns & eQCcapitalgain) - e.setAttribute(d->getAttrName(Report::Attribute::InvestmentSum), d->m_investmentSum); + if (d->m_queryColumns & QueryColumns::Performance || d->m_queryColumns & QueryColumns::Capitalgain) + e.setAttribute(d->getAttrName(Reporting::Attribute::InvestmentSum), d->m_investmentSum); // write capital gains tab - if (d->m_queryColumns & eQCcapitalgain) { - if (d->m_investmentSum == MyMoneyReport::eSumSold) { - e.setAttribute(d->getAttrName(Report::Attribute::SettlementPeriod), d->m_settlementPeriod); - e.setAttribute(d->getAttrName(Report::Attribute::ShowSTLTCapitalGains), d->m_showSTLTCapitalGains); - e.setAttribute(d->getAttrName(Report::Attribute::TermsSeparator), d->m_tseparator.toString(Qt::ISODate)); + if (d->m_queryColumns & QueryColumns::Capitalgain) { + if (d->m_investmentSum == MyMoneyReport::Investment::Sold) { + e.setAttribute(d->getAttrName(Reporting::Attribute::SettlementPeriod), d->m_settlementPeriod); + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowSTLTCapitalGains), d->m_showSTLTCapitalGains); + e.setAttribute(d->getAttrName(Reporting::Attribute::TermsSeparator), d->m_tseparator.toString(Qt::ISODate)); } } - } else if (d->m_reportType == eInfoTable) - e.setAttribute(d->getAttrName(Report::Attribute::ShowRowTotals), d->m_showRowTotals); + } else if (d->m_reportType == Report::InfoTable) + e.setAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals), d->m_showRowTotals); // // Text Filter // QRegExp textfilter; if (textFilter(textfilter)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Text)); - f.setAttribute(d->getAttrName(Report::Attribute::Pattern), textfilter.pattern()); - f.setAttribute(d->getAttrName(Report::Attribute::CaseSensitive), (textfilter.caseSensitivity() == Qt::CaseSensitive) ? 1 : 0); - f.setAttribute(d->getAttrName(Report::Attribute::RegEx), (textfilter.patternSyntax() == QRegExp::Wildcard) ? 1 : 0); - f.setAttribute(d->getAttrName(Report::Attribute::InvertText), MyMoneyTransactionFilter::isInvertingText()); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Text)); + f.setAttribute(d->getAttrName(Reporting::Attribute::Pattern), textfilter.pattern()); + f.setAttribute(d->getAttrName(Reporting::Attribute::CaseSensitive), (textfilter.caseSensitivity() == Qt::CaseSensitive) ? 1 : 0); + f.setAttribute(d->getAttrName(Reporting::Attribute::RegEx), (textfilter.patternSyntax() == QRegExp::Wildcard) ? 1 : 0); + f.setAttribute(d->getAttrName(Reporting::Attribute::InvertText), MyMoneyTransactionFilter::isInvertingText()); e.appendChild(f); } @@ -1190,8 +1190,8 @@ // iterate over payees, and add each one QList::const_iterator it_type = typelist.constBegin(); while (it_type != typelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Type)); - p.setAttribute(d->getAttrName(Report::Attribute::Type), kTypeText[*it_type]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Type)); + p.setAttribute(d->getAttrName(Reporting::Attribute::Type), kTypeText[*it_type]); e.appendChild(p); ++it_type; @@ -1203,8 +1203,8 @@ // iterate over payees, and add each one QList::const_iterator it_state = statelist.constBegin(); while (it_state != statelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::State)); - p.setAttribute(d->getAttrName(Report::Attribute::State), kStateText[*it_state]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::State)); + p.setAttribute(d->getAttrName(Reporting::Attribute::State), kStateText[*it_state]); e.appendChild(p); ++it_state; @@ -1216,9 +1216,9 @@ QString nrFrom, nrTo; if (numberFilter(nrFrom, nrTo)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Number)); - f.setAttribute(d->getAttrName(Report::Attribute::From), nrFrom); - f.setAttribute(d->getAttrName(Report::Attribute::To), nrTo); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Number)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), nrFrom); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), nrTo); e.appendChild(f); } @@ -1228,9 +1228,9 @@ MyMoneyMoney from, to; if (amountFilter(from, to)) { // bool getAmountFilter(MyMoneyMoney&,MyMoneyMoney&); - QDomElement f = doc->createElement(d->getElName(Report::Element::Amount)); - f.setAttribute(d->getAttrName(Report::Attribute::From), from.toString()); - f.setAttribute(d->getAttrName(Report::Attribute::To), to.toString()); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Amount)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), from.toString()); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), to.toString()); e.appendChild(f); } @@ -1241,14 +1241,14 @@ QStringList payeelist; if (payees(payeelist)) { if (payeelist.empty()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Payee)); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Payee)); e.appendChild(p); } else { // iterate over payees, and add each one QStringList::const_iterator it_payee = payeelist.constBegin(); while (it_payee != payeelist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Payee)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_payee); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Payee)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_payee); e.appendChild(p); ++it_payee; @@ -1263,14 +1263,14 @@ QStringList taglist; if (tags(taglist)) { if (taglist.empty()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Tag)); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Tag)); e.appendChild(p); } else { // iterate over tags, and add each one QStringList::const_iterator it_tag = taglist.constBegin(); while (it_tag != taglist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Tag)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_tag); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Tag)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_tag); e.appendChild(p); ++it_tag; @@ -1287,8 +1287,8 @@ // iterate over accounts, and add each one QList::const_iterator it_group = accountgrouplist.constBegin(); while (it_group != accountgrouplist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::AccountGroup)); - p.setAttribute(d->getAttrName(Report::Attribute::Group), kAccountTypeText[(int)*it_group]); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::AccountGroup)); + p.setAttribute(d->getAttrName(Reporting::Attribute::Group), kAccountTypeText[(int)*it_group]); e.appendChild(p); ++it_group; @@ -1304,8 +1304,8 @@ // iterate over accounts, and add each one QStringList::const_iterator it_account = accountlist.constBegin(); while (it_account != accountlist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Account)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_account); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Account)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_account); e.appendChild(p); ++it_account; @@ -1321,8 +1321,8 @@ // iterate over accounts, and add each one QStringList::const_iterator it_account = accountlist.constBegin(); while (it_account != accountlist.constEnd()) { - QDomElement p = doc->createElement(d->getElName(Report::Element::Category)); - p.setAttribute(d->getAttrName(Report::Attribute::ID), *it_account); + QDomElement p = doc->createElement(d->getElName(Reporting::Element::Category)); + p.setAttribute(d->getAttrName(Reporting::Attribute::ID), *it_account); e.appendChild(p); ++it_account; @@ -1336,11 +1336,11 @@ if (d->m_dateLock == TransactionFilter::Date::UserDefined) { QDate dateFrom, dateTo; if (dateFilter(dateFrom, dateTo)) { - QDomElement f = doc->createElement(d->getElName(Report::Element::Dates)); + QDomElement f = doc->createElement(d->getElName(Reporting::Element::Dates)); if (dateFrom.isValid()) - f.setAttribute(d->getAttrName(Report::Attribute::From), dateFrom.toString(Qt::ISODate)); + f.setAttribute(d->getAttrName(Reporting::Attribute::From), dateFrom.toString(Qt::ISODate)); if (dateTo.isValid()) - f.setAttribute(d->getAttrName(Report::Attribute::To), dateTo.toString(Qt::ISODate)); + f.setAttribute(d->getAttrName(Reporting::Attribute::To), dateTo.toString(Qt::ISODate)); e.appendChild(f); } } @@ -1358,23 +1358,23 @@ return false; // read report's internals - QString type = e.attribute(d->getAttrName(Report::Attribute::Type)); + QString type = e.attribute(d->getAttrName(Reporting::Attribute::Type)); if (type.startsWith(QLatin1String("pivottable"))) - d->m_reportType = ePivotTable; + d->m_reportType = Report::PivotTable; else if (type.startsWith(QLatin1String("querytable"))) - d->m_reportType = eQueryTable; + d->m_reportType = Report::QueryTable; else if (type.startsWith(QLatin1String("infotable"))) - d->m_reportType = eInfoTable; + d->m_reportType = Report::InfoTable; else return false; - d->m_group = e.attribute(d->getAttrName(Report::Attribute::Group)); - d->m_id = e.attribute(d->getAttrName(Report::Attribute::ID)); + d->m_group = e.attribute(d->getAttrName(Reporting::Attribute::Group)); + d->m_id = e.attribute(d->getAttrName(Reporting::Attribute::ID)); clearTransactionFilter(); // read date tab - QString datelockstr = e.attribute(d->getAttrName(Report::Attribute::DateLock), "userdefined"); + QString datelockstr = e.attribute(d->getAttrName(Reporting::Attribute::DateLock), "userdefined"); // Handle the pivot 1.2/query 1.1 case where the values were saved as // numbers bool ok = false; @@ -1387,171 +1387,171 @@ setDateFilter(static_cast(i)); // read general tab - d->m_name = e.attribute(d->getAttrName(Report::Attribute::Name)); - d->m_comment = e.attribute(d->getAttrName(Report::Attribute::Comment), "Extremely old report"); - d->m_convertCurrency = e.attribute(d->getAttrName(Report::Attribute::ConvertCurrency), "1").toUInt(); - d->m_favorite = e.attribute(d->getAttrName(Report::Attribute::Favorite), "0").toUInt(); - d->m_skipZero = e.attribute(d->getAttrName(Report::Attribute::SkipZero), "0").toUInt(); + d->m_name = e.attribute(d->getAttrName(Reporting::Attribute::Name)); + d->m_comment = e.attribute(d->getAttrName(Reporting::Attribute::Comment), "Extremely old report"); + d->m_convertCurrency = e.attribute(d->getAttrName(Reporting::Attribute::ConvertCurrency), "1").toUInt(); + d->m_favorite = e.attribute(d->getAttrName(Reporting::Attribute::Favorite), "0").toUInt(); + d->m_skipZero = e.attribute(d->getAttrName(Reporting::Attribute::SkipZero), "0").toUInt(); - if (d->m_reportType == ePivotTable) { + if (d->m_reportType == Report::PivotTable) { // read report's internals - d->m_includeBudgetActuals = e.attribute(d->getAttrName(Report::Attribute::IncludesActuals), "0").toUInt(); - d->m_includeForecast = e.attribute(d->getAttrName(Report::Attribute::IncludesForecast), "0").toUInt(); - d->m_includePrice = e.attribute(d->getAttrName(Report::Attribute::IncludesPrice), "0").toUInt(); - d->m_includeAveragePrice = e.attribute(d->getAttrName(Report::Attribute::IncludesAveragePrice), "0").toUInt(); - d->m_mixedTime = e.attribute(d->getAttrName(Report::Attribute::MixedTime), "0").toUInt(); - d->m_investments = e.attribute(d->getAttrName(Report::Attribute::Investments), "0").toUInt(); + d->m_includeBudgetActuals = e.attribute(d->getAttrName(Reporting::Attribute::IncludesActuals), "0").toUInt(); + d->m_includeForecast = e.attribute(d->getAttrName(Reporting::Attribute::IncludesForecast), "0").toUInt(); + d->m_includePrice = e.attribute(d->getAttrName(Reporting::Attribute::IncludesPrice), "0").toUInt(); + d->m_includeAveragePrice = e.attribute(d->getAttrName(Reporting::Attribute::IncludesAveragePrice), "0").toUInt(); + d->m_mixedTime = e.attribute(d->getAttrName(Reporting::Attribute::MixedTime), "0").toUInt(); + d->m_investments = e.attribute(d->getAttrName(Reporting::Attribute::Investments), "0").toUInt(); // read rows/columns tab - if (e.hasAttribute(d->getAttrName(Report::Attribute::Budget))) - d->m_budgetId = e.attribute(d->getAttrName(Report::Attribute::Budget)); + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::Budget))) + d->m_budgetId = e.attribute(d->getAttrName(Reporting::Attribute::Budget)); - i = kRowTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::RowType))); + i = Row::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::RowType))); if (i != -1) - setRowType(static_cast(i)); + setRowType(static_cast(i)); else - setRowType(eExpenseIncome); + setRowType(Row::ExpenseIncome); - if (e.hasAttribute(d->getAttrName(Report::Attribute::ShowRowTotals))) - d->m_showRowTotals = e.attribute(d->getAttrName(Report::Attribute::ShowRowTotals)).toUInt(); - else if (rowType() == eExpenseIncome) // for backward compatibility + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals))) + d->m_showRowTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowRowTotals)).toUInt(); + else if (rowType() == Row::ExpenseIncome) // for backward compatibility d->m_showRowTotals = true; - d->m_showColumnTotals = e.attribute(d->getAttrName(Report::Attribute::ShowColumnTotals), "1").toUInt(); + d->m_showColumnTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), "1").toUInt(); //check for reports with older settings which didn't have the detail attribute - i = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Report::Attribute::Detail))); + i = Detail::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::Detail))); if (i != -1) - d->m_detailLevel = static_cast(i); + d->m_detailLevel = static_cast(i); else - d->m_detailLevel = eDetailAll; + d->m_detailLevel = Detail::All; - d->m_includeMovingAverage = e.attribute(d->getAttrName(Report::Attribute::IncludesMovingAverage), "0").toUInt(); + d->m_includeMovingAverage = e.attribute(d->getAttrName(Reporting::Attribute::IncludesMovingAverage), "0").toUInt(); if (d->m_includeMovingAverage) - d->m_movingAverageDays = e.attribute(d->getAttrName(Report::Attribute::MovingAverageDays), "1").toUInt(); - d->m_includeSchedules = e.attribute(d->getAttrName(Report::Attribute::IncludesSchedules), "0").toUInt(); - d->m_includeTransfers = e.attribute(d->getAttrName(Report::Attribute::IncludesTransfers), "0").toUInt(); - d->m_includeUnusedAccounts = e.attribute(d->getAttrName(Report::Attribute::IncludesUnused), "0").toUInt(); - d->m_columnsAreDays = e.attribute(d->getAttrName(Report::Attribute::ColumnsAreDays), "0").toUInt(); + d->m_movingAverageDays = e.attribute(d->getAttrName(Reporting::Attribute::MovingAverageDays), "1").toUInt(); + d->m_includeSchedules = e.attribute(d->getAttrName(Reporting::Attribute::IncludesSchedules), "0").toUInt(); + d->m_includeTransfers = e.attribute(d->getAttrName(Reporting::Attribute::IncludesTransfers), "0").toUInt(); + d->m_includeUnusedAccounts = e.attribute(d->getAttrName(Reporting::Attribute::IncludesUnused), "0").toUInt(); + d->m_columnsAreDays = e.attribute(d->getAttrName(Reporting::Attribute::ColumnsAreDays), "0").toUInt(); // read chart tab - i = kChartTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::ChartType))); + i = Chart::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::ChartType))); if (i != -1) - d->m_chartType = static_cast(i); + d->m_chartType = static_cast(i); else - d->m_chartType = eChartNone; + d->m_chartType = Chart::None; - d->m_chartCHGridLines = e.attribute(d->getAttrName(Report::Attribute::ChartCHGridLines), "1").toUInt(); - d->m_chartSVGridLines = e.attribute(d->getAttrName(Report::Attribute::ChartSVGridLines), "1").toUInt(); - d->m_chartDataLabels = e.attribute(d->getAttrName(Report::Attribute::ChartDataLabels), "1").toUInt(); - d->m_chartByDefault = e.attribute(d->getAttrName(Report::Attribute::ChartByDefault), "0").toUInt(); - d->m_logYaxis = e.attribute(d->getAttrName(Report::Attribute::LogYAxis), "0").toUInt(); - d->m_chartLineWidth = e.attribute(d->getAttrName(Report::Attribute::ChartLineWidth), QString(m_lineWidth)).toUInt(); + d->m_chartCHGridLines = e.attribute(d->getAttrName(Reporting::Attribute::ChartCHGridLines), "1").toUInt(); + d->m_chartSVGridLines = e.attribute(d->getAttrName(Reporting::Attribute::ChartSVGridLines), "1").toUInt(); + d->m_chartDataLabels = e.attribute(d->getAttrName(Reporting::Attribute::ChartDataLabels), "1").toUInt(); + d->m_chartByDefault = e.attribute(d->getAttrName(Reporting::Attribute::ChartByDefault), "0").toUInt(); + d->m_logYaxis = e.attribute(d->getAttrName(Reporting::Attribute::LogYAxis), "0").toUInt(); + d->m_chartLineWidth = e.attribute(d->getAttrName(Reporting::Attribute::ChartLineWidth), QString(m_lineWidth)).toUInt(); // read range tab - i = kColumnTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::ColumnType))); + i = Column::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::ColumnType))); if (i != -1) - setColumnType(static_cast(i)); + setColumnType(static_cast(i)); else - setColumnType(eMonths); + setColumnType(Column::Months); - i = kDataLockText.indexOf(e.attribute(d->getAttrName(Report::Attribute::DataLock))); + i = kDataLockText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::DataLock))); if (i != -1) setDataFilter(static_cast(i)); else setDataFilter(MyMoneyReport::automatic); - d->m_dataRangeStart = e.attribute(d->getAttrName(Report::Attribute::DataRangeStart), "0"); - d->m_dataRangeEnd= e.attribute(d->getAttrName(Report::Attribute::DataRangeEnd), "0"); - d->m_dataMajorTick = e.attribute(d->getAttrName(Report::Attribute::DataMajorTick), "0"); - d->m_dataMinorTick = e.attribute(d->getAttrName(Report::Attribute::DataMinorTick), "0"); - d->m_yLabelsPrecision = e.attribute(d->getAttrName(Report::Attribute::YLabelsPrecision), "2").toUInt(); - } else if (d->m_reportType == eQueryTable) { + d->m_dataRangeStart = e.attribute(d->getAttrName(Reporting::Attribute::DataRangeStart), "0"); + d->m_dataRangeEnd= e.attribute(d->getAttrName(Reporting::Attribute::DataRangeEnd), "0"); + d->m_dataMajorTick = e.attribute(d->getAttrName(Reporting::Attribute::DataMajorTick), "0"); + d->m_dataMinorTick = e.attribute(d->getAttrName(Reporting::Attribute::DataMinorTick), "0"); + d->m_yLabelsPrecision = e.attribute(d->getAttrName(Reporting::Attribute::YLabelsPrecision), "2").toUInt(); + } else if (d->m_reportType == Report::QueryTable) { // read rows/columns tab - i = kRowTypeText.indexOf(e.attribute(d->getAttrName(Report::Attribute::RowType))); + i = Row::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::RowType))); if (i != -1) - setRowType(static_cast(i)); + setRowType(static_cast(i)); else - setRowType(eAccount); + setRowType(Row::Account); unsigned qc = 0; - QStringList columns = e.attribute(d->getAttrName(Report::Attribute::QueryColumns), "none").split(','); + QStringList columns = e.attribute(d->getAttrName(Reporting::Attribute::QueryColumns), "none").split(','); foreach (const auto column, columns) { - i = kQueryColumnsText.indexOf(column); + i = QueryColumns::kText.indexOf(column); if (i > 0) qc |= (1 << (i - 1)); } - setQueryColumns(static_cast(qc)); + setQueryColumns(static_cast(qc)); - d->m_tax = e.attribute(d->getAttrName(Report::Attribute::Tax), "0").toUInt(); - d->m_investments = e.attribute(d->getAttrName(Report::Attribute::Investments), "0").toUInt(); - d->m_loans = e.attribute(d->getAttrName(Report::Attribute::Loans), "0").toUInt(); - d->m_hideTransactions = e.attribute(d->getAttrName(Report::Attribute::HideTransactions), "0").toUInt(); - d->m_showColumnTotals = e.attribute(d->getAttrName(Report::Attribute::ShowColumnTotals), "1").toUInt(); - d->m_detailLevel = kDetailLevelText.indexOf(e.attribute(d->getAttrName(Report::Attribute::Detail), "none")) == eDetailAll ? eDetailAll : eDetailNone; + d->m_tax = e.attribute(d->getAttrName(Reporting::Attribute::Tax), "0").toUInt(); + d->m_investments = e.attribute(d->getAttrName(Reporting::Attribute::Investments), "0").toUInt(); + d->m_loans = e.attribute(d->getAttrName(Reporting::Attribute::Loans), "0").toUInt(); + d->m_hideTransactions = e.attribute(d->getAttrName(Reporting::Attribute::HideTransactions), "0").toUInt(); + d->m_showColumnTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowColumnTotals), "1").toUInt(); + d->m_detailLevel = Detail::kText.indexOf(e.attribute(d->getAttrName(Reporting::Attribute::Detail), "none")) == Detail::All ? Detail::All : Detail::None; // read performance or capital gains tab - if (d->m_queryColumns & eQCperformance) - d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Report::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumPeriod)).toInt()); + if (d->m_queryColumns & QueryColumns::Performance) + d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Reporting::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::Investment::Period)).toInt()); // read capital gains tab - if (d->m_queryColumns & eQCcapitalgain) { - d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Report::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::eSumSold)).toInt()); - if (d->m_investmentSum == MyMoneyReport::eSumSold) { - d->m_showSTLTCapitalGains = e.attribute(d->getAttrName(Report::Attribute::ShowSTLTCapitalGains), "0").toUInt(); - d->m_settlementPeriod = e.attribute(d->getAttrName(Report::Attribute::SettlementPeriod), "3").toUInt(); - d->m_tseparator = QDate::fromString(e.attribute(d->getAttrName(Report::Attribute::TermsSeparator), QDate::currentDate().addYears(-1).toString(Qt::ISODate)),Qt::ISODate); + if (d->m_queryColumns & QueryColumns::Capitalgain) { + d->m_investmentSum = static_cast(e.attribute(d->getAttrName(Reporting::Attribute::InvestmentSum), QString().setNum(MyMoneyReport::Investment::Sold)).toInt()); + if (d->m_investmentSum == MyMoneyReport::Investment::Sold) { + d->m_showSTLTCapitalGains = e.attribute(d->getAttrName(Reporting::Attribute::ShowSTLTCapitalGains), "0").toUInt(); + d->m_settlementPeriod = e.attribute(d->getAttrName(Reporting::Attribute::SettlementPeriod), "3").toUInt(); + d->m_tseparator = QDate::fromString(e.attribute(d->getAttrName(Reporting::Attribute::TermsSeparator), QDate::currentDate().addYears(-1).toString(Qt::ISODate)),Qt::ISODate); } } - } else if (d->m_reportType == eInfoTable) { - if (e.hasAttribute(d->getAttrName(Report::Attribute::ShowRowTotals))) - d->m_showRowTotals = e.attribute(d->getAttrName(Report::Attribute::ShowRowTotals)).toUInt(); + } else if (d->m_reportType == Report::InfoTable) { + if (e.hasAttribute(d->getAttrName(Reporting::Attribute::ShowRowTotals))) + d->m_showRowTotals = e.attribute(d->getAttrName(Reporting::Attribute::ShowRowTotals)).toUInt(); else d->m_showRowTotals = true; } QDomNode child = e.firstChild(); while (!child.isNull() && child.isElement()) { QDomElement c = child.toElement(); - if (d->getElName(Report::Element::Text) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Pattern))) { - setTextFilter(QRegExp(c.attribute(d->getAttrName(Report::Attribute::Pattern)), - c.attribute(d->getAttrName(Report::Attribute::CaseSensitive), "1").toUInt() + if (d->getElName(Reporting::Element::Text) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Pattern))) { + setTextFilter(QRegExp(c.attribute(d->getAttrName(Reporting::Attribute::Pattern)), + c.attribute(d->getAttrName(Reporting::Attribute::CaseSensitive), "1").toUInt() ? Qt::CaseSensitive : Qt::CaseInsensitive, - c.attribute(d->getAttrName(Report::Attribute::RegEx), "1").toUInt() + c.attribute(d->getAttrName(Reporting::Attribute::RegEx), "1").toUInt() ? QRegExp::Wildcard : QRegExp::RegExp), - c.attribute(d->getAttrName(Report::Attribute::InvertText), "0").toUInt()); + c.attribute(d->getAttrName(Reporting::Attribute::InvertText), "0").toUInt()); } - if (d->getElName(Report::Element::Type) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Type))) { - i = kTypeText.indexOf(c.attribute(d->getAttrName(Report::Attribute::Type))); + if (d->getElName(Reporting::Element::Type) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Type))) { + i = kTypeText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::Type))); if (i != -1) addType(i); } - if (d->getElName(Report::Element::State) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::State))) { - i = kStateText.indexOf(c.attribute(d->getAttrName(Report::Attribute::State))); + if (d->getElName(Reporting::Element::State) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::State))) { + i = kStateText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::State))); if (i != -1) addState(i); } - if (d->getElName(Report::Element::Number) == c.tagName()) - setNumberFilter(c.attribute(d->getAttrName(Report::Attribute::From)), c.attribute(d->getAttrName(Report::Attribute::To))); - if (d->getElName(Report::Element::Amount) == c.tagName()) - setAmountFilter(MyMoneyMoney(c.attribute(d->getAttrName(Report::Attribute::From), "0/100")), MyMoneyMoney(c.attribute(d->getAttrName(Report::Attribute::To), "0/100"))); - if (d->getElName(Report::Element::Dates) == c.tagName()) { + if (d->getElName(Reporting::Element::Number) == c.tagName()) + setNumberFilter(c.attribute(d->getAttrName(Reporting::Attribute::From)), c.attribute(d->getAttrName(Reporting::Attribute::To))); + if (d->getElName(Reporting::Element::Amount) == c.tagName()) + setAmountFilter(MyMoneyMoney(c.attribute(d->getAttrName(Reporting::Attribute::From), "0/100")), MyMoneyMoney(c.attribute(d->getAttrName(Reporting::Attribute::To), "0/100"))); + if (d->getElName(Reporting::Element::Dates) == c.tagName()) { QDate from, to; - if (c.hasAttribute(d->getAttrName(Report::Attribute::From))) - from = QDate::fromString(c.attribute(d->getAttrName(Report::Attribute::From)), Qt::ISODate); - if (c.hasAttribute(d->getAttrName(Report::Attribute::To))) - to = QDate::fromString(c.attribute(d->getAttrName(Report::Attribute::To)), Qt::ISODate); + if (c.hasAttribute(d->getAttrName(Reporting::Attribute::From))) + from = QDate::fromString(c.attribute(d->getAttrName(Reporting::Attribute::From)), Qt::ISODate); + if (c.hasAttribute(d->getAttrName(Reporting::Attribute::To))) + to = QDate::fromString(c.attribute(d->getAttrName(Reporting::Attribute::To)), Qt::ISODate); MyMoneyTransactionFilter::setDateFilter(from, to); } - if (d->getElName(Report::Element::Payee) == c.tagName()) - addPayee(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Tag) == c.tagName()) - addTag(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Category) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::ID))) - addCategory(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::Account) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::ID))) - addAccount(c.attribute(d->getAttrName(Report::Attribute::ID))); - if (d->getElName(Report::Element::AccountGroup) == c.tagName() && c.hasAttribute(d->getAttrName(Report::Attribute::Group))) { - i = kAccountTypeText.indexOf(c.attribute(d->getAttrName(Report::Attribute::Group))); + if (d->getElName(Reporting::Element::Payee) == c.tagName()) + addPayee(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Tag) == c.tagName()) + addTag(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Category) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::ID))) + addCategory(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::Account) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::ID))) + addAccount(c.attribute(d->getAttrName(Reporting::Attribute::ID))); + if (d->getElName(Reporting::Element::AccountGroup) == c.tagName() && c.hasAttribute(d->getAttrName(Reporting::Attribute::Group))) { + i = kAccountTypeText.indexOf(c.attribute(d->getAttrName(Reporting::Attribute::Group))); if (i != -1) addAccountGroup(static_cast(i)); } @@ -1587,42 +1587,42 @@ m_lineWidth = width; } -QString MyMoneyReport::toString(ERowType type) +QString MyMoneyReport::toString(Row::Type type) { switch(type) { - case eNoRows : return "eNoRows"; - case eAssetLiability : return "eAssetLiability"; - case eExpenseIncome : return "eExpenseIncome"; - case eCategory : return "eCategory"; - case eTopCategory : return "eTopCategory"; - case eAccount : return "eAccount"; - case eTag : return "eTag"; - case ePayee : return "ePayee"; - case eMonth : return "eMonth"; - case eWeek : return "eWeek"; - case eTopAccount : return "eTopAccount"; - case eAccountByTopAccount: return "eAccountByTopAccount"; - case eEquityType : return "eEquityType"; - case eAccountType : return "eAccountType"; - case eInstitution : return "eInstitution"; - case eBudget : return "eBudget"; - case eBudgetActual : return "eBudgetActual"; - case eSchedule : return "eSchedule"; - case eAccountInfo : return "eAccountInfo"; - case eAccountLoanInfo : return "eAccountLoanInfo"; - case eAccountReconcile : return "eAccountReconcile"; - case eCashFlow : return "eCashFlow"; + case Row::NoRows : return "NoRows"; + case Row::AssetLiability : return "AssetLiability"; + case Row::ExpenseIncome : return "ExpenseIncome"; + case Row::Category : return "Category"; + case Row::TopCategory : return "TopCategory"; + case Row::Account : return "Account"; + case Row::Tag : return "Tag"; + case Row::Payee : return "Payee"; + case Row::Month : return "Month"; + case Row::Week : return "Week"; + case Row::TopAccount : return "TopAccount"; + case Row::AccountByTopAccount: return "AccountByTopAccount"; + case Row::EquityType : return "EquityType"; + case Row::AccountType : return "AccountType"; + case Row::Institution : return "Institution"; + case Row::Budget : return "Budget"; + case Row::BudgetActual : return "BudgetActual"; + case Row::Schedule : return "Schedule"; + case Row::AccountInfo : return "AccountInfo"; + case Row::AccountLoanInfo : return "AccountLoanInfo"; + case Row::AccountReconcile : return "AccountReconcile"; + case Row::CashFlow : return "CashFlow"; default : return "undefined"; } } -QString MyMoneyReport::toString(MyMoneyReport::EReportType type) +QString MyMoneyReport::toString(MyMoneyReport::Report::Type type) { switch(type) { - case eNoReport: return "eNoReport"; - case ePivotTable: return "ePivotTable"; - case eQueryTable: return "eQueryTable"; - case eInfoTable: return "eInfoTable"; + case Report::NoReport: return "NoReport"; + case Report::PivotTable: return "PivotTable"; + case Report::QueryTable: return "QueryTable"; + case Report::InfoTable: return "InfoTable"; default: return "undefined"; } } diff --git a/kmymoney/mymoney/mymoneyreport_p.h b/kmymoney/mymoney/mymoneyreport_p.h --- a/kmymoney/mymoney/mymoneyreport_p.h +++ b/kmymoney/mymoney/mymoneyreport_p.h @@ -40,7 +40,7 @@ using namespace eMyMoney; -namespace Report +namespace Reporting { enum class Element { Payee, Tag, @@ -84,82 +84,82 @@ { public: - static QString getElName(const Report::Element el) + static QString getElName(const Reporting::Element el) { - static const QHash elNames { - {Report::Element::Payee, QStringLiteral("PAYEE")}, - {Report::Element::Tag, QStringLiteral("TAG")}, - {Report::Element::Account, QStringLiteral("ACCOUNT")}, - {Report::Element::Text, QStringLiteral("TEXT")}, - {Report::Element::Type, QStringLiteral("TYPE")}, - {Report::Element::State, QStringLiteral("STATE")}, - {Report::Element::Number, QStringLiteral("NUMBER")}, - {Report::Element::Amount, QStringLiteral("AMOUNT")}, - {Report::Element::Dates, QStringLiteral("DATES")}, - {Report::Element::Category, QStringLiteral("CATEGORY")}, - {Report::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} + static const QHash elNames { + {Reporting::Element::Payee, QStringLiteral("PAYEE")}, + {Reporting::Element::Tag, QStringLiteral("TAG")}, + {Reporting::Element::Account, QStringLiteral("ACCOUNT")}, + {Reporting::Element::Text, QStringLiteral("TEXT")}, + {Reporting::Element::Type, QStringLiteral("TYPE")}, + {Reporting::Element::State, QStringLiteral("STATE")}, + {Reporting::Element::Number, QStringLiteral("NUMBER")}, + {Reporting::Element::Amount, QStringLiteral("AMOUNT")}, + {Reporting::Element::Dates, QStringLiteral("DATES")}, + {Reporting::Element::Category, QStringLiteral("CATEGORY")}, + {Reporting::Element::AccountGroup, QStringLiteral("ACCOUNTGROUP")} }; return elNames[el]; } - static QString getAttrName(const Report::Attribute attr) + static QString getAttrName(const Reporting::Attribute attr) { - static const QHash attrNames { - {Report::Attribute::ID, QStringLiteral("id")}, - {Report::Attribute::Group, QStringLiteral("group")}, - {Report::Attribute::Type, QStringLiteral("type")}, - {Report::Attribute::Name, QStringLiteral("name")}, - {Report::Attribute::Comment, QStringLiteral("comment")}, - {Report::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, - {Report::Attribute::Favorite, QStringLiteral("favorite")}, - {Report::Attribute::SkipZero, QStringLiteral("skipZero")}, - {Report::Attribute::DateLock, QStringLiteral("datelock")}, - {Report::Attribute::DataLock, QStringLiteral("datalock")}, - {Report::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, - {Report::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, - {Report::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, - {Report::Attribute::IncludesPrice, QStringLiteral("includesprice")}, - {Report::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, - {Report::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, - {Report::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, - {Report::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, - {Report::Attribute::IncludesUnused, QStringLiteral("includeunused")}, - {Report::Attribute::MixedTime, QStringLiteral("mixedtime")}, - {Report::Attribute::Investments, QStringLiteral("investments")}, - {Report::Attribute::Budget, QStringLiteral("budget")}, - {Report::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, - {Report::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, - {Report::Attribute::Detail, QStringLiteral("detail")}, - {Report::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, - {Report::Attribute::ChartType, QStringLiteral("charttype")}, - {Report::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, - {Report::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, - {Report::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, - {Report::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, - {Report::Attribute::LogYAxis, QStringLiteral("logYaxis")}, - {Report::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, - {Report::Attribute::ColumnType, QStringLiteral("columntype")}, - {Report::Attribute::RowType, QStringLiteral("rowtype")}, - {Report::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, - {Report::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, - {Report::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, - {Report::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, - {Report::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, - {Report::Attribute::QueryColumns, QStringLiteral("querycolumns")}, - {Report::Attribute::Tax, QStringLiteral("tax")}, - {Report::Attribute::Loans, QStringLiteral("loans")}, - {Report::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, - {Report::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, - {Report::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, - {Report::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, - {Report::Attribute::TermsSeparator, QStringLiteral("tseparator")}, - {Report::Attribute::Pattern, QStringLiteral("pattern")}, - {Report::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, - {Report::Attribute::RegEx, QStringLiteral("regex")}, - {Report::Attribute::InvertText, QStringLiteral("inverttext")}, - {Report::Attribute::State, QStringLiteral("state")}, - {Report::Attribute::From, QStringLiteral("from")}, - {Report::Attribute::To, QStringLiteral("to")} + static const QHash attrNames { + {Reporting::Attribute::ID, QStringLiteral("id")}, + {Reporting::Attribute::Group, QStringLiteral("group")}, + {Reporting::Attribute::Type, QStringLiteral("type")}, + {Reporting::Attribute::Name, QStringLiteral("name")}, + {Reporting::Attribute::Comment, QStringLiteral("comment")}, + {Reporting::Attribute::ConvertCurrency, QStringLiteral("convertcurrency")}, + {Reporting::Attribute::Favorite, QStringLiteral("favorite")}, + {Reporting::Attribute::SkipZero, QStringLiteral("skipZero")}, + {Reporting::Attribute::DateLock, QStringLiteral("datelock")}, + {Reporting::Attribute::DataLock, QStringLiteral("datalock")}, + {Reporting::Attribute::MovingAverageDays, QStringLiteral("movingaveragedays")}, + {Reporting::Attribute::IncludesActuals, QStringLiteral("includesactuals")}, + {Reporting::Attribute::IncludesForecast, QStringLiteral("includesforecast")}, + {Reporting::Attribute::IncludesPrice, QStringLiteral("includesprice")}, + {Reporting::Attribute::IncludesAveragePrice, QStringLiteral("includesaverageprice")}, + {Reporting::Attribute::IncludesMovingAverage, QStringLiteral("includesmovingaverage")}, + {Reporting::Attribute::IncludesSchedules, QStringLiteral("includeschedules")}, + {Reporting::Attribute::IncludesTransfers, QStringLiteral("includestransfers")}, + {Reporting::Attribute::IncludesUnused, QStringLiteral("includeunused")}, + {Reporting::Attribute::MixedTime, QStringLiteral("mixedtime")}, + {Reporting::Attribute::Investments, QStringLiteral("investments")}, + {Reporting::Attribute::Budget, QStringLiteral("budget")}, + {Reporting::Attribute::ShowRowTotals, QStringLiteral("showrowtotals")}, + {Reporting::Attribute::ShowColumnTotals, QStringLiteral("showcolumntotals")}, + {Reporting::Attribute::Detail, QStringLiteral("detail")}, + {Reporting::Attribute::ColumnsAreDays, QStringLiteral("columnsaredays")}, + {Reporting::Attribute::ChartType, QStringLiteral("charttype")}, + {Reporting::Attribute::ChartCHGridLines, QStringLiteral("chartchgridlines")}, + {Reporting::Attribute::ChartSVGridLines, QStringLiteral("chartsvgridlines")}, + {Reporting::Attribute::ChartDataLabels, QStringLiteral("chartdatalabels")}, + {Reporting::Attribute::ChartByDefault, QStringLiteral("chartbydefault")}, + {Reporting::Attribute::LogYAxis, QStringLiteral("logYaxis")}, + {Reporting::Attribute::ChartLineWidth, QStringLiteral("chartlinewidth")}, + {Reporting::Attribute::ColumnType, QStringLiteral("columntype")}, + {Reporting::Attribute::RowType, QStringLiteral("rowtype")}, + {Reporting::Attribute::DataRangeStart, QStringLiteral("dataRangeStart")}, + {Reporting::Attribute::DataRangeEnd, QStringLiteral("dataRangeEnd")}, + {Reporting::Attribute::DataMajorTick, QStringLiteral("dataMajorTick")}, + {Reporting::Attribute::DataMinorTick, QStringLiteral("dataMinorTick")}, + {Reporting::Attribute::YLabelsPrecision, QStringLiteral("yLabelsPrecision")}, + {Reporting::Attribute::QueryColumns, QStringLiteral("querycolumns")}, + {Reporting::Attribute::Tax, QStringLiteral("tax")}, + {Reporting::Attribute::Loans, QStringLiteral("loans")}, + {Reporting::Attribute::HideTransactions, QStringLiteral("hidetransactions")}, + {Reporting::Attribute::InvestmentSum, QStringLiteral("investmentsum")}, + {Reporting::Attribute::SettlementPeriod, QStringLiteral("settlementperiod")}, + {Reporting::Attribute::ShowSTLTCapitalGains, QStringLiteral("showSTLTCapitalGains")}, + {Reporting::Attribute::TermsSeparator, QStringLiteral("tseparator")}, + {Reporting::Attribute::Pattern, QStringLiteral("pattern")}, + {Reporting::Attribute::CaseSensitive, QStringLiteral("casesensitive")}, + {Reporting::Attribute::RegEx, QStringLiteral("regex")}, + {Reporting::Attribute::InvertText, QStringLiteral("inverttext")}, + {Reporting::Attribute::State, QStringLiteral("state")}, + {Reporting::Attribute::From, QStringLiteral("from")}, + {Reporting::Attribute::To, QStringLiteral("to")} }; return attrNames[attr]; } @@ -181,11 +181,11 @@ /** * How much detail to show in the accounts */ - MyMoneyReport::EDetailLevel m_detailLevel; + MyMoneyReport::Detail::Level m_detailLevel; /** * Whether to sum: all, sold, bought or owned value */ - MyMoneyReport::EInvestmentSum m_investmentSum; + MyMoneyReport::Investment::Sum m_investmentSum; /** * Whether to show transactions or just totals. */ @@ -217,18 +217,18 @@ /** * What sort of algorithm should be used to run the report */ - MyMoneyReport::EReportType m_reportType; + MyMoneyReport::Report::Type m_reportType; /** * What sort of values should show up on the ROWS of this report */ - MyMoneyReport::ERowType m_rowType; + MyMoneyReport::Row::Type m_rowType; /** * What sort of values should show up on the COLUMNS of this report, * in the case of a 'PivotTable' report. Really this is used more as a * QUANTITY of months or days. Whether it's months or days is determined * by m_columnsAreDays. */ - MyMoneyReport::EColumnType m_columnType; + MyMoneyReport::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. @@ -238,7 +238,7 @@ * What sort of values should show up on the COLUMNS of this report, * in the case of a 'QueryTable' report */ - MyMoneyReport::EQueryColumns m_queryColumns; + MyMoneyReport::QueryColumns::Type m_queryColumns; /** * The plain-language description of what the date range should be locked @@ -263,7 +263,7 @@ /** * What format should be used to draw this report as a chart */ - MyMoneyReport::EChartType m_chartType; + MyMoneyReport::Chart::Type m_chartType; /** * Whether the value of individual data points should be drawn on the chart */ diff --git a/kmymoney/mymoney/tests/mymoneyreport-test.cpp b/kmymoney/mymoney/tests/mymoneyreport-test.cpp --- a/kmymoney/mymoney/tests/mymoneyreport-test.cpp +++ b/kmymoney/mymoney/tests/mymoneyreport-test.cpp @@ -36,18 +36,18 @@ void MyMoneyReportTest::testElementNames() { - for (auto i = (int)Report::Element::Payee; i <= (int)Report::Element::AccountGroup; ++i) { - auto isEmpty = MyMoneyReportPrivate::getElName(static_cast(i)).isEmpty(); + for (auto i = (int)Reporting::Element::Payee; i <= (int)Reporting::Element::AccountGroup; ++i) { + auto isEmpty = MyMoneyReportPrivate::getElName(static_cast(i)).isEmpty(); if (isEmpty) qWarning() << "Empty element's name " << i; QVERIFY(!isEmpty); } } void MyMoneyReportTest::testAttributeNames() { - for (auto i = (int)Report::Attribute::ID; i < (int)Report::Attribute::LastAttribute; ++i) { - auto isEmpty = MyMoneyReportPrivate::getAttrName(static_cast(i)).isEmpty(); + for (auto i = (int)Reporting::Attribute::ID; i < (int)Reporting::Attribute::LastAttribute; ++i) { + auto isEmpty = MyMoneyReportPrivate::getAttrName(static_cast(i)).isEmpty(); if (isEmpty) qWarning() << "Empty attribute's name " << i; QVERIFY(!isEmpty); diff --git a/kmymoney/org.kde.kmymoney.appdata.xml b/kmymoney/org.kde.kmymoney.appdata.xml --- a/kmymoney/org.kde.kmymoney.appdata.xml +++ b/kmymoney/org.kde.kmymoney.appdata.xml @@ -69,6 +69,7 @@

KMyMoney ist eine persönliche Finanzverwaltung von KDE mit vielen Funktionen, aber trotzdem leicht zu bedienen.

KMyMoney is a personal finance manager by KDE. It comes with a large set of features while being easy to use for the non-technical user.

KMyMoney es un gestor de finanzas personales creado por KDE. Contiene un gran número de funciones, aunque es fácil de usar para los usuarios no técnicos.

+

KMyMoney on KDE:n henkilökohtainen taloudenhallintaohjelma. Siinä on monia ominaisuuksia, mutta se on silti helppo myös ei-tekniselle käyttäjälle.

KMyMoney est un gestionnaire de finances personnelles par KDE. Il dispose d'un ensemble de fonctionnalités complètes tout en restant simple d'utilisation pour les utilisateurs peu techniques.

KMyMoney é un xestor de finanzas persoais de KDE. Inclúe un gran número de funcionalidades sen renunciar a ser fácil de usar para personas non técnicas.

KMyMoney è un gestore delle finanza personali di KDE. È dotato di un ampio insieme funzionalità pur essendo facile da usare per l'utente non tecnico.

@@ -167,6 +168,7 @@ Verwaltung von Konten nach den zugehörigen Institutionen Manage accounts e.g. by institutions they are held at Gestionar cuentas (por ejemplo, por las instituciones donde están depositadas) + Hallitse tilejäsi esim. rahalaitoksittain Gestion des comptes, par exemple en fonction des établissements dans lesquels ils sont détenus Xestionar contas, por exemplo polas institucións onde están abertas. Gestisci gli account, ad esempio, per gli istituti presso cui sono tenuti @@ -181,7 +183,7 @@ https://kmymoney.org - https://bugs.kde.org/enter_bug.cgi?product=kmymoney4&format=guided + https://bugs.kde.org/enter_bug.cgi?product=kmymoney&format=guided https://docs.kde.org/stable/en/extragear-office/kmymoney/index.html KDE diff --git a/kmymoney/plugins/checkprinting/kcm_checkprinting.desktop b/kmymoney/plugins/checkprinting/kcm_checkprinting.desktop --- a/kmymoney/plugins/checkprinting/kcm_checkprinting.desktop +++ b/kmymoney/plugins/checkprinting/kcm_checkprinting.desktop @@ -5,6 +5,7 @@ Name[de]=Einrichtung des Moduls zum Drucken von Schecks Name[en_GB]=Configure the check printing plugin Name[es]=Configurar el complemento de impresión de cheques +Name[fi]=Å ekkitulostusliitännäisen asetukset Name[fr]=Configurer le module externe pour l'impression de chèques Name[gl]=Complemento para configurar a impresión de cheques Name[it]=Configura l'estensione di stampa degli assegni @@ -25,6 +26,7 @@ Keywords[de]=checkprinting;kmymoney;scheckdruck Keywords[en_GB]=checkprinting;kmymoney; Keywords[es]=checkprinting;kmymoney; +Keywords[fi]=Å¡ekkitulostus;kmymoney; Keywords[fr]=checkprinting;kmymoney; Keywords[gl]=checkprinting;kmymoney;impresión;cheque; Keywords[it]=stampa assegni;kmymoney; diff --git a/kmymoney/plugins/csv/import/kcm_csvimporter.desktop b/kmymoney/plugins/csv/import/kcm_csvimporter.desktop --- a/kmymoney/plugins/csv/import/kcm_csvimporter.desktop +++ b/kmymoney/plugins/csv/import/kcm_csvimporter.desktop @@ -6,6 +6,7 @@ Name[de]=CSV-Importeinrichtung Name[en_GB]=CSV Importer configuration Name[es]=Configuración del importador CSV +Name[fi]=CSV-tuontiasetukset Name[fr]=Configuration de l'importation de CSV Name[gl]=Configuración do importador de CSV Name[it]=Configurazione dello strumento di importazione CSV @@ -29,6 +30,7 @@ Keywords[de]=csvimport;kmymoney; Keywords[en_GB]=csvimporter;kmymoney; Keywords[es]=csvimporter;kmymoney; +Keywords[fi]=csv-tuonti;kmymoney; Keywords[fr]=csvimporter;kmymoney; Keywords[gl]=csvimporter;kmymoney;importador;csv; Keywords[it]=csvimporter;kmymoney; @@ -48,6 +50,7 @@ Comment[de]=Einrichtung des CSV-Importmoduls Comment[en_GB]=Configuration for CSV Importer plugin Comment[es]=Configuración para el complemento de importación CSV +Comment[fi]=CSV-tuontiliitännäisen asetukset Comment[fr]=Configurer le module externe d'importation « CSV » Comment[gl]=Configuración do complemento de importación de CSV. Comment[it]=Configurazione dell'estensione di importazione CSV diff --git a/kmymoney/plugins/icalendar/export/kcm_icalendarexporter.desktop b/kmymoney/plugins/icalendar/export/kcm_icalendarexporter.desktop --- a/kmymoney/plugins/icalendar/export/kcm_icalendarexporter.desktop +++ b/kmymoney/plugins/icalendar/export/kcm_icalendarexporter.desktop @@ -42,6 +42,7 @@ Keywords[de]=icalendarexport;kmymoney; Keywords[en_GB]=icalendarexporter;kmymoney; Keywords[es]=icalendarexporter;kmymoney; +Keywords[fi]=icalendar-vienti;kmymoney Keywords[fr]=icalendarexporter;kmymoney; Keywords[gl]=icalendarexporter;kmymoney;exportador;icalendar; Keywords[it]=icalendarexporter;kmymoney; diff --git a/kmymoney/plugins/qif/config/kcm_qifexporter.desktop b/kmymoney/plugins/qif/config/kcm_qifexporter.desktop --- a/kmymoney/plugins/qif/config/kcm_qifexporter.desktop +++ b/kmymoney/plugins/qif/config/kcm_qifexporter.desktop @@ -6,6 +6,7 @@ Name[de]=QIF-Importeinrichtung Name[en_GB]=QIF Importer configuration Name[es]=Configuración del importador QIF +Name[fi]=QIF-tuontiasetukset Name[fr]=Configuration de l'importation de QIF Name[gl]=Configuración do importador de QIF Name[it]=Configurazione dello strumento di importazione QIF @@ -27,6 +28,7 @@ Keywords[de]=qifexport;kmymoney; Keywords[en_GB]=qifexporter;kmymoney; Keywords[es]=qifexporter;kmymoney; +Keywords[fi]=qif-vienti;kmymoney; Keywords[fr]=qifexport;kmymoney; Keywords[gl]=qifexporter;kmymoney;exportador;qif Keywords[it]=qifexporter;kmymoney; @@ -46,6 +48,7 @@ Comment[de]=Einrichtung des QIF-Importmoduls Comment[en_GB]=Configuration for QIF Importer plugin Comment[es]=Configuración para el complemento de importación QIF +Comment[fi]=QIF-tuontiliitännäisen asetukset Comment[fr]=Configurer le module externe d'importation « QIF » Comment[gl]=Configuración do complemento de importación de QIF. Comment[it]=Configurazione dell'estensione di importazione QIF diff --git a/kmymoney/plugins/qif/config/kcm_qifimporter.desktop b/kmymoney/plugins/qif/config/kcm_qifimporter.desktop --- a/kmymoney/plugins/qif/config/kcm_qifimporter.desktop +++ b/kmymoney/plugins/qif/config/kcm_qifimporter.desktop @@ -6,6 +6,7 @@ Name[de]=QIF-Importeinrichtung Name[en_GB]=QIF Importer configuration Name[es]=Configuración del importador QIF +Name[fi]=QIF-tuontiasetukset Name[fr]=Configuration de l'importation de QIF Name[gl]=Configuración do importador de QIF Name[it]=Configurazione dello strumento di importazione QIF @@ -27,6 +28,7 @@ Keywords[de]=qifimport;kmymoney; Keywords[en_GB]=qifimporter;kmymoney; Keywords[es]=qifimporter;kmymoney; +Keywords[fi]=qif-tuonti;kmymoney; Keywords[fr]=qifimport;kmymoney; Keywords[gl]=qifimporter;kmymoney;importador;qif; Keywords[it]=qifimporter;kmymoney; @@ -46,6 +48,7 @@ Comment[de]=Einrichtung des QIF-Importmoduls Comment[en_GB]=Configuration for QIF Importer plugin Comment[es]=Configuración para el complemento de importación QIF +Comment[fi]=QIF-tuontiliitännäisen asetukset Comment[fr]=Configurer le module externe d'importation « QIF » Comment[gl]=Configuración do complemento de importación de QIF. Comment[it]=Configurazione dell'estensione di importazione QIF diff --git a/kmymoney/reports/kreportchartview.cpp b/kmymoney/reports/kreportchartview.cpp --- a/kmymoney/reports/kreportchartview.cpp +++ b/kmymoney/reports/kreportchartview.cpp @@ -115,9 +115,9 @@ setAccountSeries(true); switch (config.chartType()) { - case MyMoneyReport::eChartLine: - case MyMoneyReport::eChartBar: - case MyMoneyReport::eChartStackedBar: { + case MyMoneyReport::Chart::Line: + case MyMoneyReport::Chart::Bar: + case MyMoneyReport::Chart::StackedBar: { CartesianCoordinatePlane* cartesianPlane = new CartesianCoordinatePlane(this); cartesianPlane->setAutoAdjustVerticalRangeToData(2); cartesianPlane->setRubberBandZoomingEnabled(true); @@ -183,8 +183,8 @@ yAxis->setRulerAttributes(yAxisRulerAttr); switch (config.chartType()) { - case MyMoneyReport::eChartEnd: - case MyMoneyReport::eChartLine: { + case MyMoneyReport::Chart::End: + case MyMoneyReport::Chart::Line: { KChart::LineDiagram* diagram = new KChart::LineDiagram(this, cartesianPlane); if (config.isSkippingZero()) { @@ -197,14 +197,14 @@ diagram->addAxis(yAxis); break; } - case MyMoneyReport::eChartBar: { + case MyMoneyReport::Chart::Bar: { KChart::BarDiagram* diagram = new KChart::BarDiagram(this, cartesianPlane); cartesianPlane->replaceDiagram(diagram); diagram->addAxis(xAxis); diagram->addAxis(yAxis); break; } - case MyMoneyReport::eChartStackedBar: { + case MyMoneyReport::Chart::StackedBar: { KChart::BarDiagram* diagram = new KChart::BarDiagram(this, cartesianPlane); diagram->setType(BarDiagram::Stacked); cartesianPlane->replaceDiagram(diagram); @@ -217,8 +217,8 @@ } break; } - case MyMoneyReport::eChartPie: - case MyMoneyReport::eChartRing:{ + case MyMoneyReport::Chart::Pie: + case MyMoneyReport::Chart::Ring:{ PolarCoordinatePlane* polarPlane = new PolarCoordinatePlane(this); replaceCoordinatePlane(polarPlane); @@ -234,13 +234,13 @@ setAccountSeries(false); switch (config.chartType()) { - case MyMoneyReport::eChartPie: { + case MyMoneyReport::Chart::Pie: { KChart::PieDiagram* diagram = new KChart::PieDiagram(this, polarPlane); polarPlane->replaceDiagram(diagram); setSeriesTotals(true); break; } - case MyMoneyReport::eChartRing: { + case MyMoneyReport::Chart::Ring: { KChart::RingDiagram* diagram = new KChart::RingDiagram(this, polarPlane); polarPlane->replaceDiagram(diagram); break; @@ -286,8 +286,8 @@ QMap legendTotal; switch (config.detailLevel()) { - case MyMoneyReport::eDetailNone: - case MyMoneyReport::eDetailAll: { + case MyMoneyReport::Detail::None: + case MyMoneyReport::Detail::All: { // iterate over outer groups PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { @@ -344,7 +344,7 @@ } break; - case MyMoneyReport::eDetailTop: { + case MyMoneyReport::Detail::Top: { // iterate over outer groups PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { @@ -378,7 +378,7 @@ } break; - case MyMoneyReport::eDetailGroup: { + case MyMoneyReport::Detail::Group: { // iterate over outer groups PivotGrid::const_iterator it_outergroup = grid.begin(); while (it_outergroup != grid.end()) { @@ -429,7 +429,7 @@ } break; - case MyMoneyReport::eDetailTotal: { + case MyMoneyReport::Detail::Total: { // iterate row types for (int i = 0 ; i < myRowTypeListSize; ++i) { QString legendText; @@ -468,7 +468,7 @@ } break; default: - case MyMoneyReport::eDetailEnd: + case MyMoneyReport::Detail::End: return; } @@ -502,7 +502,7 @@ m_model.setHorizontalHeaderLabels(legendNames); // set line width for line chart - if (config.chartType() == MyMoneyReport::eChartLine) { + if (config.chartType() == MyMoneyReport::Chart::Line) { AttributesModel* diagramAttributes = planeDiagram->attributesModel(); int penWidth = config.chartLineWidth(); for (int i = 0 ; i < rowNum ; ++i) { diff --git a/kmymoney/reports/listtable.cpp b/kmymoney/reports/listtable.cpp --- a/kmymoney/reports/listtable.cpp +++ b/kmymoney/reports/listtable.cpp @@ -206,7 +206,7 @@ result.append(QString::fromLatin1("").arg(row_odd ? QLatin1Char('1') : QLatin1Char('0'))); } else if (rowRank == 4 || rowRank == 5) { QList::const_iterator nextRow = std::next(it_row); - if ((m_config.rowType() == MyMoneyReport::eTag)) { //If we order by Tags don't show the Grand total as we can have multiple tags per transaction + if ((m_config.rowType() == MyMoneyReport::Row::Tag)) { //If we order by Tags don't show the Grand total as we can have multiple tags per transaction continue; } else if (rowRank == 4) { if (nextRow != m_rows.end()) { diff --git a/kmymoney/reports/objectinfotable.cpp b/kmymoney/reports/objectinfotable.cpp --- a/kmymoney/reports/objectinfotable.cpp +++ b/kmymoney/reports/objectinfotable.cpp @@ -82,15 +82,15 @@ m_group.clear(); m_subtotal.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: + case MyMoneyReport::Row::Schedule: constructScheduleTable(); m_columns << ctNextDueDate << ctName; break; - case MyMoneyReport::eAccountInfo: + case MyMoneyReport::Row::AccountInfo: constructAccountTable(); m_columns << ctInstitution << ctType << ctName; break; - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountLoanInfo: constructAccountLoanTable(); m_columns << ctInstitution << ctType << ctName; break; @@ -102,12 +102,12 @@ m_subtotal << ctValue; switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: + case MyMoneyReport::Row::Schedule: m_group << ctType; m_subtotal << ctValue; break; - case MyMoneyReport::eAccountInfo: - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountInfo: + case MyMoneyReport::Row::AccountLoanInfo: m_group << ctTopCategory << ctInstitution; m_subtotal << ctCurrentBalance; break; @@ -118,22 +118,22 @@ QVector sort = QVector::fromList(m_group) << QVector::fromList(m_columns) << ctID << ctRank; switch (m_config.rowType()) { - case MyMoneyReport::eSchedule: - if (m_config.detailLevel() == MyMoneyReport::eDetailAll) { + case MyMoneyReport::Row::Schedule: + if (m_config.detailLevel() == MyMoneyReport::Detail::All) { m_columns << ctName << ctPayee << ctPaymentType << ctOccurrence << ctNextDueDate << ctCategory; } else { m_columns << ctName << ctPayee << ctPaymentType << ctOccurrence << ctNextDueDate; } break; - case MyMoneyReport::eAccountInfo: + case MyMoneyReport::Row::AccountInfo: m_columns << ctType << ctName << ctNumber << ctDescription << ctOpeningDate << ctCurrencyName << ctBalanceWarning << ctCreditWarning << ctMaxCreditLimit << ctTax << ctFavorite; break; - case MyMoneyReport::eAccountLoanInfo: + case MyMoneyReport::Row::AccountLoanInfo: m_columns << ctType << ctName << ctNumber << ctDescription << ctOpeningDate << ctCurrencyName << ctPayee << ctLoanAmount << ctInterestRate << ctNextInterestChange @@ -201,7 +201,7 @@ //the text matches the main split bool transaction_text = m_config.match(&split); - if (m_config.detailLevel() == MyMoneyReport::eDetailAll) { + if (m_config.detailLevel() == MyMoneyReport::Detail::All) { //get the information for all splits QList splits = transaction.splits(); QList::const_iterator split_it = splits.constBegin(); diff --git a/kmymoney/reports/pivottable.cpp b/kmymoney/reports/pivottable.cpp --- a/kmymoney/reports/pivottable.cpp +++ b/kmymoney/reports/pivottable.cpp @@ -136,7 +136,7 @@ // // Initialize outer groups of the grid // - if (m_config.rowType() == MyMoneyReport::eAssetLiability) { + if (m_config.rowType() == MyMoneyReport::Row::AssetLiability) { m_grid.insert(MyMoneyAccount::accountTypeToString(eMyMoney::Account::Type::Asset), PivotOuterGroup(m_numColumns)); m_grid.insert(MyMoneyAccount::accountTypeToString(eMyMoney::Account::Type::Liability), PivotOuterGroup(m_numColumns, PivotOuterGroup::m_kDefaultSortOrder, true /* inverted */)); } else { @@ -252,7 +252,7 @@ // whether asset & liability transactions are actually to be considered // transfers - bool al_transfers = (m_config.rowType() == MyMoneyReport::eExpenseIncome) && (m_config.isIncludingTransfers()); + bool al_transfers = (m_config.rowType() == MyMoneyReport::Row::ExpenseIncome) && (m_config.isIncludingTransfers()); //this is to store balance for loan accounts when not included in the report QMap loanBalances; @@ -919,10 +919,10 @@ 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.columnType() == MyMoneyReport::eBiMonths - || m_config.columnType() == MyMoneyReport::eMonths - || m_config.columnType() == MyMoneyReport::eYears - || m_config.columnType() == MyMoneyReport::eQuarters) { + if (m_config.columnType() == MyMoneyReport::Column::BiMonths + || m_config.columnType() == MyMoneyReport::Column::Months + || m_config.columnType() == MyMoneyReport::Column::Years + || m_config.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 @@ -950,10 +950,10 @@ ++column; } else { switch (m_config.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.columnType()))) { @@ -1171,7 +1171,7 @@ // Outer Row Group Totals // - const bool isIncomeExpense = (m_config.rowType() == MyMoneyReport::eExpenseIncome); + const bool isIncomeExpense = (m_config.rowType() == MyMoneyReport::Row::ExpenseIncome); const bool invert_total = (*it_outergroup).m_inverted; auto column = 0; while (column < m_numColumns) { @@ -1481,7 +1481,7 @@ bool finishrow = true; QString finalRow; bool isUsed = false; - if (m_config.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1)) { + if (m_config.detailLevel() == MyMoneyReport::Detail::All && ((*it_innergroup).size() > 1)) { // Print the individual rows result += innergroupdata; @@ -1648,7 +1648,7 @@ // Skip the body of the report if the report only calls for totals to be shown - if (m_config.detailLevel() != MyMoneyReport::eDetailTotal) { + if (m_config.detailLevel() != MyMoneyReport::Detail::Total) { // // Outer groups // @@ -1683,7 +1683,7 @@ result += QString("%2\n").arg(colspan).arg((*it_outergroup).m_displayName); // Skip the inner groups if the report only calls for outer group totals to be shown - if (m_config.detailLevel() != MyMoneyReport::eDetailGroup) { + if (m_config.detailLevel() != MyMoneyReport::Detail::Group) { // // Inner Groups @@ -1791,7 +1791,7 @@ bool finishrow = true; QString finalRow; bool isUsed = false; - if (m_config.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1)) { + if (m_config.detailLevel() == MyMoneyReport::Detail::All && ((*it_innergroup).size() > 1)) { // Print the individual rows result += innergroupdata; @@ -1818,7 +1818,7 @@ isUsed |= !rowname.isClosed(); finalRow = QString("%5%6") .arg(rownum & 0x01 ? "even" : "odd") - .arg(m_config.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "") + .arg(m_config.detailLevel() == MyMoneyReport::Detail::All ? "id=\"solo\"" : "") .arg(rowname.hierarchyDepth() - 1) .arg(rowname.name().replace(QRegExp(" "), " ")) .arg((m_config.isConvertCurrency() || !rowname.isForeignCurrency()) ? QString() : QString(" (%1)").arg(rowname.currency().id())); @@ -2022,7 +2022,7 @@ } //run forecast - if (m_config.rowType() == MyMoneyReport::eAssetLiability) { //asset and liability + if (m_config.rowType() == MyMoneyReport::Row::AssetLiability) { //asset and liability forecast.doForecast(); } else { //income and expenses MyMoneyBudget budget; @@ -2129,7 +2129,7 @@ int column = m_startColumn; //check whether columns are days or months - if (m_config.columnType() == MyMoneyReport::eDays) { + if (m_config.columnType() == MyMoneyReport::Column::Days) { while (column < m_numColumns) { MyMoneyMoney totalPrice = MyMoneyMoney(); @@ -2160,23 +2160,23 @@ //set the right start date depending on the column type switch (m_config.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; } diff --git a/kmymoney/reports/querytable.cpp b/kmymoney/reports/querytable.cpp --- a/kmymoney/reports/querytable.cpp +++ b/kmymoney/reports/querytable.cpp @@ -269,27 +269,27 @@ m_subtotal.clear(); m_postcolumns.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eAccountByTopAccount: - case MyMoneyReport::eEquityType: - case MyMoneyReport::eAccountType: - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::AccountByTopAccount: + case MyMoneyReport::Row::EquityType: + case MyMoneyReport::Row::AccountType: + case MyMoneyReport::Row::Institution: constructAccountTable(); m_columns << ctAccount; break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: constructTransactionTable(); m_columns << ctAccountID << ctPostDate; break; - case MyMoneyReport::ePayee: - case MyMoneyReport::eTag: - case MyMoneyReport::eMonth: - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Payee: + case MyMoneyReport::Row::Tag: + case MyMoneyReport::Row::Month: + case MyMoneyReport::Row::Week: constructTransactionTable(); m_columns << ctPostDate << ctAccount; break; - case MyMoneyReport::eCashFlow: + case MyMoneyReport::Row::CashFlow: constructSplitsTable(); m_columns << ctPostDate; break; @@ -302,46 +302,46 @@ m_subtotal << ctValue; switch (m_config.rowType()) { - case MyMoneyReport::eCashFlow: + case MyMoneyReport::Row::CashFlow: m_group << ctCategoryType << ctTopCategory << ctCategory; break; - case MyMoneyReport::eCategory: + case MyMoneyReport::Row::Category: m_group << ctCategoryType << ctTopCategory << ctCategory; break; - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::TopCategory: m_group << ctCategoryType << ctTopCategory; break; - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::TopAccount: m_group << ctTopAccount << ctAccount; break; - case MyMoneyReport::eAccount: + case MyMoneyReport::Row::Account: m_group << ctAccount; break; - case MyMoneyReport::eAccountReconcile: + case MyMoneyReport::Row::AccountReconcile: m_group << ctAccount << ctReconcileFlag; break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: m_group << ctPayee; break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: m_group << ctTag; break; - case MyMoneyReport::eMonth: + case MyMoneyReport::Row::Month: m_group << ctMonth; break; - case MyMoneyReport::eWeek: + case MyMoneyReport::Row::Week: m_group << ctWeek; break; - case MyMoneyReport::eAccountByTopAccount: + case MyMoneyReport::Row::AccountByTopAccount: m_group << ctTopAccount; break; - case MyMoneyReport::eEquityType: + case MyMoneyReport::Row::EquityType: m_group << ctEquityType; break; - case MyMoneyReport::eAccountType: + case MyMoneyReport::Row::AccountType: m_group << ctType; break; - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::Institution: m_group << ctInstitution << ctTopAccount; break; default: @@ -352,10 +352,10 @@ m_columns.clear(); switch (m_config.rowType()) { - case MyMoneyReport::eAccountByTopAccount: - case MyMoneyReport::eEquityType: - case MyMoneyReport::eAccountType: - case MyMoneyReport::eInstitution: + case MyMoneyReport::Row::AccountByTopAccount: + case MyMoneyReport::Row::EquityType: + case MyMoneyReport::Row::AccountType: + case MyMoneyReport::Row::Institution: m_columns << ctAccount; break; @@ -365,48 +365,48 @@ unsigned qc = m_config.queryColumns(); - if (qc & MyMoneyReport::eQCnumber) + if (qc & MyMoneyReport::QueryColumns::Number) m_columns << ctNumber; - if (qc & MyMoneyReport::eQCpayee) + if (qc & MyMoneyReport::QueryColumns::Payee) m_columns << ctPayee; - if (qc & MyMoneyReport::eQCtag) + if (qc & MyMoneyReport::QueryColumns::Tag) m_columns << ctTag; - if (qc & MyMoneyReport::eQCcategory) + if (qc & MyMoneyReport::QueryColumns::Category) m_columns << ctCategory; - if (qc & MyMoneyReport::eQCaccount) + if (qc & MyMoneyReport::QueryColumns::Account) m_columns << ctAccount; - if (qc & MyMoneyReport::eQCreconciled) + if (qc & MyMoneyReport::QueryColumns::Reconciled) m_columns << ctReconcileFlag; - if (qc & MyMoneyReport::eQCmemo) + if (qc & MyMoneyReport::QueryColumns::Memo) m_columns << ctMemo; - if (qc & MyMoneyReport::eQCaction) + if (qc & MyMoneyReport::QueryColumns::Action) m_columns << ctAction; - if (qc & MyMoneyReport::eQCshares) + if (qc & MyMoneyReport::QueryColumns::Shares) m_columns << ctShares; - if (qc & MyMoneyReport::eQCprice) + if (qc & MyMoneyReport::QueryColumns::Price) m_columns << ctPrice; - if (qc & MyMoneyReport::eQCperformance) { + if (qc & MyMoneyReport::QueryColumns::Performance) { m_subtotal.clear(); switch (m_config.investmentSum()) { - case MyMoneyReport::eSumOwnedAndSold: + case MyMoneyReport::Investment::OwnedAndSold: m_columns << ctBuys << ctSells << ctReinvestIncome << ctCashIncome << ctEndingBalance << ctReturn << ctReturnInvestment; m_subtotal << ctBuys << ctSells << ctReinvestIncome << ctCashIncome << ctEndingBalance << ctReturn << ctReturnInvestment; break; - case MyMoneyReport::eSumOwned: + case MyMoneyReport::Investment::Owned: m_columns << ctBuys << ctReinvestIncome << ctMarketValue << ctReturn << ctReturnInvestment; m_subtotal << ctBuys << ctReinvestIncome << ctMarketValue << ctReturn << ctReturnInvestment; break; - case MyMoneyReport::eSumSold: + case MyMoneyReport::Investment::Sold: m_columns << ctBuys << ctSells << ctCashIncome << ctReturn << ctReturnInvestment; m_subtotal << ctBuys << ctSells << ctCashIncome << ctReturn << ctReturnInvestment; break; - case MyMoneyReport::eSumPeriod: + case MyMoneyReport::Investment::Period: default: m_columns << ctStartingBalance << ctBuys << ctSells << ctReinvestIncome << ctCashIncome << ctEndingBalance @@ -417,18 +417,18 @@ break; } } - if (qc & MyMoneyReport::eQCcapitalgain) { + if (qc & MyMoneyReport::QueryColumns::Capitalgain) { m_subtotal.clear(); switch (m_config.investmentSum()) { - case MyMoneyReport::eSumOwned: + case MyMoneyReport::Investment::Owned: m_columns << ctShares << ctBuyPrice << ctLastPrice << ctBuys << ctMarketValue << ctPercentageGain << ctCapitalGain; m_subtotal << ctShares << ctBuyPrice << ctLastPrice << ctBuys << ctMarketValue << ctPercentageGain << ctCapitalGain; break; - case MyMoneyReport::eSumSold: + case MyMoneyReport::Investment::Sold: default: m_columns << ctBuys << ctSells << ctCapitalGain; m_subtotal << ctBuys << ctSells << ctCapitalGain; @@ -441,11 +441,11 @@ break; } } - if (qc & MyMoneyReport::eQCloan) { + if (qc & MyMoneyReport::QueryColumns::Loan) { m_columns << ctPayment << ctInterest << ctFees; m_postcolumns << ctBalance; } - if (qc & MyMoneyReport::eQCbalance) + if (qc & MyMoneyReport::QueryColumns::Balance) m_postcolumns << ctBalance; TableRow::setSortCriteria(sort); @@ -659,27 +659,27 @@ bool tag_special_case = false; switch (m_config.rowType()) { - case MyMoneyReport::eCategory: - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::Category: + case MyMoneyReport::Row::TopCategory: use_summary = false; use_transfers = false; hide_details = false; break; - case MyMoneyReport::ePayee: + case MyMoneyReport::Row::Payee: use_summary = false; use_transfers = false; - hide_details = (m_config.detailLevel() == MyMoneyReport::eDetailNone); + hide_details = (m_config.detailLevel() == MyMoneyReport::Detail::None); break; - case MyMoneyReport::eTag: + case MyMoneyReport::Row::Tag: use_summary = false; use_transfers = false; - hide_details = (m_config.detailLevel() == MyMoneyReport::eDetailNone); + hide_details = (m_config.detailLevel() == MyMoneyReport::Detail::None); tag_special_case = true; break; default: use_summary = true; use_transfers = true; - hide_details = (m_config.detailLevel() == MyMoneyReport::eDetailNone); + hide_details = (m_config.detailLevel() == MyMoneyReport::Detail::None); break; } @@ -762,7 +762,7 @@ // split entries (qS) normally. bool loan_special_case = false; - if (m_config.queryColumns() & MyMoneyReport::eQCloan) { + if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { ReportAccount splitAcc((*it_split).accountId()); loan_special_case = splitAcc.isLoan(); } @@ -1004,8 +1004,8 @@ //this applies when the transaction has only 2 splits, or each split is going to be //shown separately, eg. transactions by category switch (m_config.rowType()) { - case MyMoneyReport::eCategory: - case MyMoneyReport::eTopCategory: + case MyMoneyReport::Row::Category: + case MyMoneyReport::Row::TopCategory: if (splitAcc.isIncomeExpense()) qA[ctValue] = (-(*it_split).shares() * xr).convert(fraction).toString(); // needed for category reports, in case of multicurrency transaction it breaks it break; @@ -1142,15 +1142,15 @@ // now run through our accts list and add opening and closing balances switch (m_config.rowType()) { - case MyMoneyReport::eAccount: - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::Account: + case MyMoneyReport::Row::TopAccount: break; - // case MyMoneyReport::eCategory: - // case MyMoneyReport::eTopCategory: - // case MyMoneyReport::ePayee: - // case MyMoneyReport::eMonth: - // case MyMoneyReport::eWeek: + // case MyMoneyReport::Row::Category: + // case MyMoneyReport::Row::TopCategory: + // case MyMoneyReport::Row::Payee: + // case MyMoneyReport::Row::Month: + // case MyMoneyReport::Row::Week: default: return; } @@ -1288,7 +1288,7 @@ newStartingDate = startingDate; newEndingDate = endingDate; - if (report.queryColumns() & MyMoneyReport::eQCcapitalgain) { + if (report.queryColumns() & MyMoneyReport::QueryColumns::Capitalgain) { // Saturday and Sunday aren't valid settlement dates if (endingDate.dayOfWeek() == Qt::Saturday) endingDate = endingDate.addDays(-1); @@ -1425,9 +1425,9 @@ } while ( ( - (report.investmentSum() == MyMoneyReport::eSumOwned && !shList[BuysOfOwned].isZero()) || - (report.investmentSum() == MyMoneyReport::eSumSold && !shList.at(Sells).isZero() && shList.at(Sells).abs() > shList.at(BuysOfSells).abs()) || - (report.investmentSum() == MyMoneyReport::eSumOwnedAndSold && (!shList[BuysOfOwned].isZero() || (!shList.at(Sells).isZero() && shList.at(Sells).abs() > shList.at(BuysOfSells).abs()))) + (report.investmentSum() == MyMoneyReport::Investment::Owned && !shList[BuysOfOwned].isZero()) || + (report.investmentSum() == MyMoneyReport::Investment::Sold && !shList.at(Sells).isZero() && shList.at(Sells).abs() > shList.at(BuysOfSells).abs()) || + (report.investmentSum() == MyMoneyReport::Investment::OwnedAndSold && (!shList[BuysOfOwned].isZero() || (!shList.at(Sells).isZero() && shList.at(Sells).abs() > shList.at(BuysOfSells).abs()))) ) && account.openingDate() <= newEndingDate ); @@ -1524,7 +1524,7 @@ MyMoneyMoney reinvestIncomeTotal; switch (m_config.investmentSum()) { - case MyMoneyReport::eSumOwnedAndSold: + case MyMoneyReport::Investment::OwnedAndSold: buysTotal = cfList.at(BuysOfSells).total() + cfList.at(BuysOfOwned).total(); sellsTotal = cfList.at(Sells).total(); cashIncomeTotal = cfList.at(CashIncome).total(); @@ -1544,7 +1544,7 @@ result[ctReinvestIncome] = reinvestIncomeTotal.toString(); result[ctEndingBalance] = endingBal.toString(); break; - case MyMoneyReport::eSumOwned: + case MyMoneyReport::Investment::Owned: buysTotal = cfList.at(BuysOfOwned).total(); startingBal = MyMoneyMoney(); if (buysTotal.isZero() && endingBal.isZero()) @@ -1555,7 +1555,7 @@ result[ctReinvestIncome] = reinvestIncomeTotal.toString(); result[ctMarketValue] = endingBal.toString(); break; - case MyMoneyReport::eSumSold: + case MyMoneyReport::Investment::Sold: buysTotal = cfList.at(BuysOfSells).total(); sellsTotal = cfList.at(Sells).total(); cashIncomeTotal = cfList.at(CashIncome).total(); @@ -1570,7 +1570,7 @@ result[ctSells] = sellsTotal.toString(); result[ctCashIncome] = cashIncomeTotal.toString(); break; - case MyMoneyReport::eSumPeriod: + case MyMoneyReport::Investment::Period: default: buysTotal = cfList.at(Buys).total(); sellsTotal = cfList.at(Sells).total(); @@ -1617,7 +1617,7 @@ MyMoneyMoney longTermSellsOfBuys = cfList.at(LongTermSellsOfBuys).total(); switch (m_config.investmentSum()) { - case MyMoneyReport::eSumOwned: + case MyMoneyReport::Investment::Owned: { if (shList.at(BuysOfOwned).isZero()) return; @@ -1654,7 +1654,7 @@ result[ctPercentageGain] = ((buysTotal + endingBal)/buysTotal.abs()).toString(); break; } - case MyMoneyReport::eSumSold: + case MyMoneyReport::Investment::Sold: default: buysTotal = cfList.at(BuysOfSells).total() - cfList.at(ReinvestIncome).total(); sellsTotal = cfList.at(Sells).total(); @@ -1708,7 +1708,7 @@ TableRow qaccountrow; CashFlowList accountCashflow; // for total calculation switch(m_config.queryColumns()) { - case MyMoneyReport::eQCperformance: + case MyMoneyReport::QueryColumns::Performance: { constructPerformanceRow(account, qaccountrow, accountCashflow); if (!qaccountrow.isEmpty()) { @@ -1728,7 +1728,7 @@ } break; } - case MyMoneyReport::eQCcapitalgain: + case MyMoneyReport::QueryColumns::Capitalgain: constructCapitalGainRow(account, qaccountrow); break; default: @@ -1780,7 +1780,7 @@ } } - if (m_config.queryColumns() == MyMoneyReport::eQCperformance && m_config.isShowingColumnTotals()) { + if (m_config.queryColumns() == MyMoneyReport::QueryColumns::Performance && m_config.isShowingColumnTotals()) { TableRow qtotalsrow; qtotalsrow[ctRank] = QLatin1Char('4'); // add identification of row as total QMap currencyGrandCashFlow; @@ -1891,7 +1891,7 @@ // reference (loan) account (qA). however, we process the matching // split entries (qS) normally. bool loan_special_case = false; - if (m_config.queryColumns() & MyMoneyReport::eQCloan) { + if (m_config.queryColumns() & MyMoneyReport::QueryColumns::Loan) { ReportAccount splitAcc((*it_split).accountId()); loan_special_case = splitAcc.isLoan(); } @@ -2064,15 +2064,15 @@ // now run through our accts list and add opening and closing balances switch (m_config.rowType()) { - case MyMoneyReport::eAccount: - case MyMoneyReport::eTopAccount: + case MyMoneyReport::Row::Account: + case MyMoneyReport::Row::TopAccount: break; - // case MyMoneyReport::eCategory: - // case MyMoneyReport::eTopCategory: - // case MyMoneyReport::ePayee: - // case MyMoneyReport::eMonth: - // case MyMoneyReport::eWeek: + // case MyMoneyReport::Row::Category: + // case MyMoneyReport::Row::TopCategory: + // case MyMoneyReport::Row::Payee: + // case MyMoneyReport::Row::Month: + // case MyMoneyReport::Row::Week: default: return; } diff --git a/kmymoney/reports/tests/pivottable-test.cpp b/kmymoney/reports/tests/pivottable-test.cpp --- a/kmymoney/reports/tests/pivottable-test.cpp +++ b/kmymoney/reports/tests/pivottable-test.cpp @@ -99,7 +99,7 @@ { try { MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 7, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -124,7 +124,7 @@ // that it calculates the totals correctly. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -140,7 +140,7 @@ // the period of the report. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2005, 8, 1), QDate(2005, 12, 31)); filter.setName("Net Worth Opening Prior 1"); XMLandback(filter); @@ -177,7 +177,7 @@ // so the report should be zero. MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 2, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -207,7 +207,7 @@ TransactionHelper t13(QDate(2017, 7, 1), MyMoneySplit::ActionDeposit, MyMoneyMoney(-100000), acBasicAccount, ctBasicIncome); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2016, 1, 1), QDate(2017, 12, 31)); filter.addAccount(acBasicAccount); XMLandback(filter); @@ -234,7 +234,7 @@ // test a spending report with no entries MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); XMLandback(filter); PivotTable spending_f1(filter); QVERIFY(spending_f1.m_grid.m_total[eActual].m_total == moZero); @@ -250,7 +250,7 @@ TransactionHelper t(QDate(2004, 10, 31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.setName("Spending with Single Transaction.html"); XMLandback(filter); @@ -264,7 +264,7 @@ QVERIFY(spending_f.m_grid.m_total[eActual].m_total == (-moSolo)); filter.clearTransactionFilter(); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -280,9 +280,9 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); - filter.setDetailLevel(MyMoneyReport::eDetailAll); + filter.setDetailLevel(MyMoneyReport::Detail::All); filter.setName("Spending with Sub-Account"); XMLandback(filter); PivotTable spending_f(filter); @@ -297,7 +297,7 @@ QVERIFY(spending_f.m_grid.m_total[eActual].m_total == (-moParent - moChild)); filter.clearTransactionFilter(); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.setName("Net Worth with Sub-Account"); XMLandback(filter); @@ -316,7 +316,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addCategory(acChild); filter.addCategory(acSolo); @@ -337,7 +337,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acChecking); filter.addCategory(acChild); @@ -355,7 +355,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acChecking); QVERIFY(file->transactionList(filter).count() == 1); @@ -377,7 +377,7 @@ TransactionHelper t3(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 9, 1), QDate(2005, 1, 1).addDays(-1)); filter.addAccount(acCredit); filter.addCategory(acChild); @@ -463,9 +463,9 @@ #endif MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); - filter.setDetailLevel(MyMoneyReport::eDetailAll); + filter.setDetailLevel(MyMoneyReport::Detail::All); filter.setConvertCurrency(true); filter.setName("Multiple Currency Spending Rerport (with currency conversion)"); XMLandback(filter); @@ -488,7 +488,7 @@ // Test the report type where we DO NOT convert the currency filter.setConvertCurrency(false); - filter.setDetailLevel(MyMoneyReport::eDetailAll); + filter.setDetailLevel(MyMoneyReport::Detail::All); filter.setName("Multiple Currency Spending Report (WITHOUT currency conversion)"); XMLandback(filter); PivotTable spending_fnc(filter); @@ -504,7 +504,7 @@ filter.setConvertCurrency(true); filter.clearTransactionFilter(); filter.setName("Multiple currency net worth"); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); @@ -544,7 +544,7 @@ TransactionHelper t2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setAmountFilter(moChild, moChild); XMLandback(filter); @@ -560,7 +560,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addPayee(MyMoneyFile::instance()->payeeByName("Thomas Baumgart").id()); filter.setName("Spending with Payee Filter"); @@ -579,7 +579,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, QString(), QString()); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addPayee(QString()); XMLandback(filter); @@ -596,7 +596,7 @@ TransactionHelper t4(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setTextFilter(QRegExp("Thomas")); XMLandback(filter); @@ -610,7 +610,7 @@ TransactionHelper t3(QDate(2004, 11, 1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.addType((int)eMyMoney::TransactionFilter::Type::Payments); XMLandback(filter); PivotTable spending_f(filter); @@ -631,7 +631,7 @@ QVERIFY(spending_f3.m_grid.m_total[eActual].m_total == moZero); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31)); XMLandback(filter); PivotTable networth_f4(filter); @@ -665,7 +665,7 @@ t2.update(); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.addState((int)eMyMoney::TransactionFilter::State::Cleared); XMLandback(filter); @@ -726,7 +726,7 @@ t4.update(); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); filter.setNumberFilter("1", "3"); XMLandback(filter); @@ -749,7 +749,7 @@ TransactionHelper t3y3(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(), QDate(2004, 7, 1)); XMLandback(filter); PivotTable spending_f(filter); @@ -781,10 +781,10 @@ TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eExpenseIncome); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); filter.setDateFilter(QDate(2003, 12, 31), QDate(2005, 12, 31)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(MyMoneyReport::eBiMonths); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::BiMonths); XMLandback(filter); PivotTable spending_b(filter); @@ -802,7 +802,7 @@ QVERIFY(spending_b.m_grid.m_total[eActual][11] == -moParent2); QVERIFY(spending_b.m_grid.m_total[eActual][12] == moZero); - filter.setColumnType(MyMoneyReport::eQuarters); + filter.setColumnType(MyMoneyReport::Column::Quarters); XMLandback(filter); PivotTable spending_q(filter); @@ -816,7 +816,7 @@ QVERIFY(spending_q.m_grid.m_total[eActual][7] == -moParent2); QVERIFY(spending_q.m_grid.m_total[eActual][8] == moZero); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setName("Net Worth by Quarter"); XMLandback(filter); PivotTable networth_q(filter); @@ -832,17 +832,17 @@ QVERIFY(networth_q.m_grid.m_total[eActual][8] == -moParent2 - moParent1 - moSolo - moSolo - moParent - moSolo - moParent + moCheckingOpen + moCreditOpen); 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.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::Years); XMLandback(filter); PivotTable spending_y(filter); QVERIFY(spending_y.m_grid.m_total[eActual][0] == moZero); QVERIFY(spending_y.m_grid.m_total[eActual][1] == -moSolo - moParent - moSolo - moParent); QVERIFY(spending_y.m_grid.m_total[eActual][2] == -moSolo - moParent); QVERIFY(spending_y.m_grid.m_total[eActual].m_total == -moSolo - moParent - moSolo - moParent - moSolo - moParent); - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); XMLandback(filter); PivotTable networth_y(filter); @@ -865,8 +865,8 @@ TransactionHelper t3d3(QDate(2004, 8, 4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 7, 14)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(MyMoneyReport::eMonths); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(MyMoneyReport::Column::Months); filter.setColumnsAreDays(true); filter.setName("Spending by Days"); @@ -882,8 +882,8 @@ QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedKingdom)); filter.setDateFilter(QDate(2004, 7, 2), QDate(2004, 8, 1)); - filter.setRowType(MyMoneyReport::eExpenseIncome); - filter.setColumnType(static_cast(7)); + filter.setRowType(MyMoneyReport::Row::ExpenseIncome); + filter.setColumnType(static_cast(7)); filter.setColumnsAreDays(true); filter.setName("Spending by Weeks"); @@ -934,7 +934,7 @@ // MyMoneyReport networth_r; - networth_r.setRowType(MyMoneyReport::eAssetLiability); + networth_r.setRowType(MyMoneyReport::Row::AssetLiability); networth_r.setDateFilter(QDate(2004, 1, 1), QDate(2004, 12, 31).addDays(-1)); XMLandback(networth_r); PivotTable networth(networth_r); @@ -987,22 +987,22 @@ BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, "Yearly Budgeted vs. Actual", "Default Report"); PivotTable table(report); } // 2. Budget on B, not applying to sub accounts, transactions on B and B:1 { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, "Yearly Budgeted vs. Actual", "Default Report"); PivotTable table(report); } @@ -1015,10 +1015,10 @@ { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, true, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop , + MyMoneyReport::Detail::Top , "Yearly Budgeted vs. Actual", "Default Report"); PivotTable table(report); } @@ -1032,10 +1032,10 @@ budget += BudgetEntryHelper(QDate(2006, 1, 1), acParent, false, MyMoneyMoney(100.0)); 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 report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, "Yearly Budgeted vs. Actual", "Default Report"); PivotTable table(report); } @@ -1049,19 +1049,19 @@ { BudgetHelper budget; budget += BudgetEntryHelper(QDate(2006, 1, 1), acSolo, false, MyMoneyMoney(100.0)); - MyMoneyReport report(MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport report(MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, "Yearly Budgeted vs. Actual", "Default Report"); PivotTable table(report); } } void PivotTableTest::testHtmlEncoding() { MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAssetLiability); + filter.setRowType(MyMoneyReport::Row::AssetLiability); filter.setDateFilter(QDate(2004, 1, 1), QDate(2005, 1, 1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); diff --git a/kmymoney/reports/tests/querytable-test.cpp b/kmymoney/reports/tests/querytable-test.cpp --- a/kmymoney/reports/tests/querytable-test.cpp +++ b/kmymoney/reports/tests/querytable-test.cpp @@ -109,9 +109,9 @@ unsigned cols; MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eCategory); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); // + filter.setRowType(MyMoneyReport::Row::Category); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); // filter.setName("Transactions by Category"); XMLandback(filter); QueryTable qtbl_1(filter); @@ -134,9 +134,9 @@ QVERIFY(MyMoneyMoney(rows[17][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[18][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eTopCategory); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); // + filter.setRowType(MyMoneyReport::Row::TopCategory); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); // filter.setName("Transactions by Top Category"); XMLandback(filter); QueryTable qtbl_2(filter); @@ -161,10 +161,10 @@ QVERIFY(MyMoneyMoney(rows[14][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[15][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -194,10 +194,10 @@ QVERIFY(MyMoneyMoney(rows[17][ListTable::ctValue]) == -(moParent1 + moParent2 + moChild) * 3 + moCreditOpen); QVERIFY(MyMoneyMoney(rows[18][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::ePayee); + filter.setRowType(MyMoneyReport::Row::Payee); filter.setName("Transactions by Payee"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Memo | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_4(filter); @@ -219,10 +219,10 @@ QVERIFY(MyMoneyMoney(rows[12][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3); QVERIFY(MyMoneyMoney(rows[13][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eMonth); + filter.setRowType(MyMoneyReport::Row::Month); filter.setName("Transactions by Month"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_5(filter); @@ -246,10 +246,10 @@ QVERIFY(MyMoneyMoney(rows[9][ListTable::ctValue]) == -moParent1 + moCheckingOpen); QVERIFY(MyMoneyMoney(rows[22][ListTable::ctValue]) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen); - filter.setRowType(MyMoneyReport::eWeek); + filter.setRowType(MyMoneyReport::Row::Week); filter.setName("Transactions by Week"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_6(filter); @@ -334,7 +334,7 @@ // MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eInstitution); + filter.setRowType(MyMoneyReport::Row::Institution); filter.setName("Accounts by Institution (No transactions)"); XMLandback(filter); QueryTable qtbl_1(filter); @@ -373,7 +373,7 @@ TransactionHelper t3y2(QDate(2005, 9, 1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent); TransactionHelper t4y2(QDate(2004, 11, 7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild); - filter.setRowType(MyMoneyReport::eInstitution); + filter.setRowType(MyMoneyReport::Row::Institution); filter.setName("Accounts by Institution (With Transactions)"); XMLandback(filter); QueryTable qtbl_2(filter); @@ -392,7 +392,7 @@ // Account TYPES // - filter.setRowType(MyMoneyReport::eAccountType); + filter.setRowType(MyMoneyReport::Row::AccountType); filter.setName("Accounts by Type"); XMLandback(filter); QueryTable qtbl_3(filter); @@ -457,10 +457,10 @@ // MyMoneyReport invtran_r( - MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::TopAccount, + MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, eMyMoney::TransactionFilter::Date::UserDefined, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Transactions"), i18n("Test Report") ); @@ -557,10 +557,10 @@ // MyMoneyReport invhold_r( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, eMyMoney::TransactionFilter::Date::UserDefined, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Performance by Account"), i18n("Test Report") ); @@ -640,10 +640,10 @@ // MyMoneyReport invhold_r( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, eMyMoney::TransactionFilter::Date::UserDefined, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Performance by Account"), i18n("Test Report") ); @@ -680,11 +680,11 @@ TransactionHelper t1(QDate(2017, 8, 1), MyMoneySplit::ActionWithdrawal, amountWithdrawn, acCadChecking, acSolo, "CAD"); MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setDateFilter(QDate(2017, 8, 1), QDate(2017, 8, 2)); filter.setName("Transactions by Account"); - auto cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); // + auto cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl(filter); @@ -728,10 +728,10 @@ MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); // + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -790,10 +790,10 @@ MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eAccount); + filter.setRowType(MyMoneyReport::Row::Account); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; - filter.setQueryColumns(static_cast(cols)); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance; + filter.setQueryColumns(static_cast(cols)); // don't convert values to the default currency filter.setConvertCurrency(false); XMLandback(filter); @@ -884,10 +884,10 @@ unsigned cols; MyMoneyReport filter; - filter.setRowType(MyMoneyReport::eCategory); + filter.setRowType(MyMoneyReport::Row::Category); filter.setName("Tax Transactions"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; - filter.setQueryColumns(static_cast(cols)); + cols = MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account; + filter.setQueryColumns(static_cast(cols)); filter.setTax(true); XMLandback(filter); diff --git a/kmymoney/views/kforecastview_p.h b/kmymoney/views/kforecastview_p.h --- a/kmymoney/views/kforecastview_p.h +++ b/kmymoney/views/kforecastview_p.h @@ -657,20 +657,20 @@ void loadChartView() { - MyMoneyReport::EDetailLevel detailLevel[4] = { MyMoneyReport::eDetailAll, MyMoneyReport::eDetailTop, MyMoneyReport::eDetailGroup, MyMoneyReport::eDetailTotal }; + MyMoneyReport::Detail::Level detailLevel[4] = { MyMoneyReport::Detail::All, MyMoneyReport::Detail::Top, MyMoneyReport::Detail::Group, MyMoneyReport::Detail::Total }; MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, eMyMoney::TransactionFilter::Date::UserDefined, // overridden by the setDateFilter() call below detailLevel[ui->m_comboDetail->currentIndex()], i18n("Net Worth Forecast"), i18n("Generated Report")); reportCfg.setChartByDefault(true); reportCfg.setChartCHGridLines(false); reportCfg.setChartSVGridLines(false); - reportCfg.setChartType(MyMoneyReport::eChartLine); + reportCfg.setChartType(MyMoneyReport::Chart::Line); reportCfg.setIncludingSchedules(false); // FIXME: this causes a crash //reportCfg.setColumnsAreDays( true ); diff --git a/kmymoney/views/kgloballedgerview.cpp b/kmymoney/views/kgloballedgerview.cpp --- a/kmymoney/views/kgloballedgerview.cpp +++ b/kmymoney/views/kgloballedgerview.cpp @@ -154,7 +154,16 @@ } } else { - slotSelectAccount(d->m_accountComboBox->getSelected()); + if (!d->m_lastSelectedAccountID.isEmpty()) { + try { + const auto acc = MyMoneyFile::instance()->account(d->m_lastSelectedAccountID); + slotSelectAccount(acc.id()); + } catch (const MyMoneyException &) { + d->m_lastSelectedAccountID.clear(); // account is invalid + } + } else { + slotSelectAccount(d->m_accountComboBox->getSelected()); + } // emit objectSelected(d->m_currentAccount); KMyMoneyRegister::SelectedTransactions list(d->m_register); @@ -629,14 +638,7 @@ if (typeid(obj) != typeid(MyMoneyAccount)) return/* false */; - if (d->m_recursion) - return /* false */; - - d->m_recursion = true; - const auto& acc = dynamic_cast(obj); - /*bool rc =*/ slotSelectAccount(acc.id(), QString()); - d->m_recursion = false; -// return rc; + d->m_lastSelectedAccountID = obj.id(); } void KGlobalLedgerView::slotSelectAccount(const QString& id) @@ -658,6 +660,7 @@ if (d->m_currentAccount.isInvest()) { d->m_currentAccount = MyMoneyFile::instance()->account(d->m_currentAccount.parentAccountId()); } + d->m_lastSelectedAccountID = d->m_currentAccount.id(); d->m_newAccountLoaded = true; refresh(); } catch (const MyMoneyException &) { diff --git a/kmymoney/views/kgloballedgerview_p.h b/kmymoney/views/kgloballedgerview_p.h --- a/kmymoney/views/kgloballedgerview_p.h +++ b/kmymoney/views/kgloballedgerview_p.h @@ -387,14 +387,14 @@ void loadAccounts() { const auto file = MyMoneyFile::instance(); - auto const model = Models::instance()->accountsModel(); // check if the current account still exists and make it the // current account - if (!m_currentAccount.id().isEmpty()) { + if (!m_lastSelectedAccountID.isEmpty()) { try { - m_currentAccount = file->account(m_currentAccount.id()); + m_currentAccount = file->account(m_lastSelectedAccountID); } catch (const MyMoneyException &) { + m_lastSelectedAccountID.clear(); m_currentAccount = MyMoneyAccount(); return; } @@ -409,7 +409,7 @@ if (m_currentAccount.id().isEmpty()) { // find the first favorite account - QModelIndexList list = model->match(model->index(0, 0), + QModelIndexList list = m_filterProxyModel->match(m_filterProxyModel->index(0, 0), (int)eAccountsModel::Role::Favorite, QVariant(true), 1, @@ -423,7 +423,7 @@ if (m_currentAccount.id().isEmpty()) { // there are no favorite accounts find any account - QModelIndexList list = model->match(model->index(0, 0), + QModelIndexList list = m_filterProxyModel->match(m_filterProxyModel->index(0, 0), Qt::DisplayRole, QVariant(QString("*")), -1, @@ -434,7 +434,7 @@ QVariant accountId = (*it).data((int)eAccountsModel::Role::ID); if (accountId.isValid()) { MyMoneyAccount a = file->account(accountId.toString()); - if (!a.isInvest()) { + if (!a.isInvest() && !a.isClosed()) { m_currentAccount = a; break; } @@ -1583,6 +1583,7 @@ * This member holds the currently selected account */ MyMoneyAccount m_currentAccount; + QString m_lastSelectedAccountID; MyMoneyAccount m_reconciliationAccount; diff --git a/kmymoney/views/khomeview_p.h b/kmymoney/views/khomeview_p.h --- a/kmymoney/views/khomeview_p.h +++ b/kmymoney/views/khomeview_p.h @@ -497,18 +497,18 @@ m_html += QString("
%1
\n
 
\n").arg(i18n("Net Worth Forecast")); MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::UserDefined, // overridden by the setDateFilter() call below - MyMoneyReport::eDetailTotal, + MyMoneyReport::Detail::Total, i18n("Net Worth Forecast"), i18n("Generated Report")); reportCfg.setChartByDefault(true); reportCfg.setChartCHGridLines(false); reportCfg.setChartSVGridLines(false); reportCfg.setChartDataLabels(false); - reportCfg.setChartType(MyMoneyReport::eChartLine); + reportCfg.setChartType(MyMoneyReport::Chart::Line); reportCfg.setIncludingSchedules(false); reportCfg.addAccountGroup(Account::Type::Asset); reportCfg.addAccountGroup(Account::Type::Liability); @@ -1423,10 +1423,10 @@ //config report just like "Monthly Budgeted vs Actual MyMoneyReport reportCfg = MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Monthly Budgeted vs. Actual"), i18n("Generated Report")); diff --git a/kmymoney/views/kreportsview.cpp b/kmymoney/views/kreportsview.cpp --- a/kmymoney/views/kreportsview.cpp +++ b/kmymoney/views/kreportsview.cpp @@ -661,10 +661,10 @@ // currently selected account. if (!d->m_currentAccount.id().isEmpty()) { MyMoneyReport report( - MyMoneyReport::eAccount, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category, eMyMoney::TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("%1 YTD Account Transactions", d->m_currentAccount.name()), i18n("Generated Report") ); diff --git a/kmymoney/views/kreportsview_p.h b/kmymoney/views/kreportsview_p.h --- a/kmymoney/views/kreportsview_p.h +++ b/kmymoney/views/kreportsview_p.h @@ -355,13 +355,13 @@ delete m_table; m_table = 0; - if (m_report.reportType() == MyMoneyReport::ePivotTable) { + if (m_report.reportType() == MyMoneyReport::Report::PivotTable) { m_table = new PivotTable(m_report); m_chartEnabled = true; - } else if (m_report.reportType() == MyMoneyReport::eQueryTable) { + } else if (m_report.reportType() == MyMoneyReport::Report::QueryTable) { m_table = new QueryTable(m_report); m_chartEnabled = false; - } else if (m_report.reportType() == MyMoneyReport::eInfoTable) { + } else if (m_report.reportType() == MyMoneyReport::Report::InfoTable) { m_table = new ObjectInfoTable(m_report); m_chartEnabled = false; } @@ -807,121 +807,121 @@ ReportGroup list("Income and Expenses", i18n("Income and Expenses")); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Income and Expenses This Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Income and Expenses This Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eYears, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Years, TransactionFilter::Date::All, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Income and Expenses By Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Income and Expenses Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setChartDataLabels(false); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailGroup, + MyMoneyReport::Detail::Group, i18n("Income and Expenses Pie Chart"), i18n("Default Report") )); list.back().setChartByDefault(true); - list.back().setChartType(MyMoneyReport::eChartPie); + list.back().setChartType(MyMoneyReport::Chart::Pie); list.back().setShowingRowTotals(false); groups.push_back(list); } { ReportGroup list("Net Worth", i18n("Net Worth")); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Net Worth By Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Net Worth Today"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eYears, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Years, TransactionFilter::Date::All, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Net Worth By Year"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next7Days, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("7-day Cash Flow Forecast"), i18n("Default Report") )); list.back().setIncludingSchedules(true); list.back().setColumnsAreDays(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, - MyMoneyReport::eDetailTotal, + MyMoneyReport::Detail::Total, i18n("Net Worth Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.push_back(MyMoneyReport( - MyMoneyReport::eInstitution, - MyMoneyReport::eQCnone, + MyMoneyReport::Row::Institution, + MyMoneyReport::QueryColumns::None, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Account Balances by Institution"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountType, - MyMoneyReport::eQCnone, + MyMoneyReport::Row::AccountType, + MyMoneyReport::QueryColumns::None, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Account Balances by Type"), i18n("Default Report") )); @@ -932,80 +932,80 @@ ReportGroup list("Transactions", i18n("Transactions")); list.push_back(MyMoneyReport( - MyMoneyReport::eAccount, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag | MyMoneyReport::eQCbalance, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag | MyMoneyReport::QueryColumns::Balance, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Account"), i18n("Default Report") )); //list.back().setConvertCurrency(false); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Category"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Payee"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eTag, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory, + MyMoneyReport::Row::Tag, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Tag"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eMonth, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Month, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Month"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eWeek, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCtag, + MyMoneyReport::Row::Week, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Tag, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Week"), i18n("Default Report") )); list.push_back(MyMoneyReport( - MyMoneyReport::eAccount, - MyMoneyReport::eQCloan, + MyMoneyReport::Row::Account, + MyMoneyReport::QueryColumns::Loan, TransactionFilter::Date::All, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Loan Transactions"), i18n("Default Report") )); list.back().setLoansOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountReconcile, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance, + MyMoneyReport::Row::AccountReconcile, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Balance, TransactionFilter::Date::Last3Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Transactions by Reconciliation Status"), i18n("Default Report") )); groups.push_back(list); } { ReportGroup list("CashFlow", i18n("Cash Flow")); list.push_back(MyMoneyReport( - MyMoneyReport::eCashFlow, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::CashFlow, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Cash Flow Transactions This Month"), i18n("Default Report") )); @@ -1015,116 +1015,116 @@ ReportGroup list("Investments", i18n("Investments")); list.push_back(MyMoneyReport( - MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction | MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::TopAccount, + MyMoneyReport::QueryColumns::Action | MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Transactions"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Holdings by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCshares | MyMoneyReport::eQCprice, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Shares | MyMoneyReport::QueryColumns::Price, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Holdings by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Performance, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Performance by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCperformance, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Performance, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Performance by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCcapitalgain, + MyMoneyReport::Row::AccountByTopAccount, + MyMoneyReport::QueryColumns::Capitalgain, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Capital Gains by Account"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eEquityType, - MyMoneyReport::eQCcapitalgain, + MyMoneyReport::Row::EquityType, + MyMoneyReport::QueryColumns::Capitalgain, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Capital Gains by Type"), i18n("Default Report") )); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Holdings Pie"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartPie); + list.back().setChartType(MyMoneyReport::Chart::Pie); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Worth Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setColumnsAreDays(true); list.back().setInvestmentsOnly(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Price Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setColumnsAreDays(true); list.back().setInvestmentsOnly(true); list.back().setIncludingBudgetActuals(false); @@ -1136,17 +1136,17 @@ list.back().setShowingRowTotals(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last12Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Moving Average Price Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setColumnsAreDays(true); list.back().setInvestmentsOnly(true); list.back().setIncludingBudgetActuals(false); @@ -1158,34 +1158,34 @@ list.back().setShowingRowTotals(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last30Days, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Moving Average"), i18n("Default Report") )); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setColumnsAreDays(true); list.back().setInvestmentsOnly(true); list.back().setIncludingBudgetActuals(false); list.back().setIncludingMovingAverage(true); list.back().setMovingAverageDays(10); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Last30Days, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Investment Moving Average vs Actual"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); list.back().setColumnsAreDays(true); list.back().setInvestmentsOnly(true); list.back().setIncludingBudgetActuals(true); @@ -1197,37 +1197,37 @@ ReportGroup list("Taxes", i18n("Taxes")); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Tax Transactions by Category"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Tax Transactions by Payee"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::eCategory, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Category, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Payee | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::LastFiscalYear, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Tax Transactions by Category Last Fiscal Year"), i18n("Default Report") )); list.back().setTax(true); list.push_back(MyMoneyReport( - MyMoneyReport::ePayee, - MyMoneyReport::eQCnumber | MyMoneyReport::eQCcategory | MyMoneyReport::eQCaccount, + MyMoneyReport::Row::Payee, + MyMoneyReport::QueryColumns::Number | MyMoneyReport::QueryColumns::Category | MyMoneyReport::QueryColumns::Account, TransactionFilter::Date::LastFiscalYear, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Tax Transactions by Payee Last Fiscal Year"), i18n("Default Report") )); @@ -1238,21 +1238,21 @@ ReportGroup list("Budgeting", i18n("Budgeting")); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToDate, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Budgeted vs. Actual This Year"), i18n("Default Report") )); list.back().setShowingRowTotals(true); list.back().setBudget("Any", true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::YearToMonth, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Budgeted vs. Actual This Year (YTM)"), i18n("Default Report") )); @@ -1264,147 +1264,147 @@ } list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Monthly Budgeted vs. Actual"), i18n("Default Report") )); list.back().setBudget("Any", true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Yearly Budgeted vs. Actual"), i18n("Default Report") )); list.back().setBudget("Any", true); list.back().setShowingRowTotals(true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudget, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Budget, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentMonth, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Monthly Budget"), i18n("Default Report") )); list.back().setBudget("Any", false); list.push_back(MyMoneyReport( - MyMoneyReport::eBudget, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Budget, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Yearly Budget"), i18n("Default Report") )); list.back().setBudget("Any", false); list.back().setShowingRowTotals(true); list.push_back(MyMoneyReport( - MyMoneyReport::eBudgetActual, - MyMoneyReport::eMonths, + MyMoneyReport::Row::BudgetActual, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, - MyMoneyReport::eDetailGroup, + MyMoneyReport::Detail::Group, i18n("Yearly Budgeted vs Actual Graph"), i18n("Default Report") )); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); list.back().setBudget("Any", true); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); groups.push_back(list); } { ReportGroup list("Forecast", i18n("Forecast")); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Forecast By Month"), i18n("Default Report") )); list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::NextQuarter, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Forecast Next Quarter"), i18n("Default Report") )); list.back().setColumnsAreDays(true); list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eExpenseIncome, - MyMoneyReport::eMonths, + MyMoneyReport::Row::ExpenseIncome, + MyMoneyReport::Column::Months, TransactionFilter::Date::CurrentYear, - MyMoneyReport::eDetailTop, + MyMoneyReport::Detail::Top, i18n("Income and Expenses Forecast This Year"), i18n("Default Report") )); list.back().setIncludingForecast(true); list.push_back(MyMoneyReport( - MyMoneyReport::eAssetLiability, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AssetLiability, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next3Months, - MyMoneyReport::eDetailTotal, + MyMoneyReport::Detail::Total, i18n("Net Worth Forecast Graph"), i18n("Default Report") )); list.back().setColumnsAreDays(true); list.back().setIncludingForecast(true); list.back().setChartByDefault(true); list.back().setChartCHGridLines(false); list.back().setChartSVGridLines(false); - list.back().setChartType(MyMoneyReport::eChartLine); + list.back().setChartType(MyMoneyReport::Chart::Line); groups.push_back(list); } { ReportGroup list("Information", i18n("General Information")); list.push_back(MyMoneyReport( - MyMoneyReport::eSchedule, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Schedule, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Schedule Information"), i18n("Default Report") )); - list.back().setDetailLevel(MyMoneyReport::eDetailAll); + list.back().setDetailLevel(MyMoneyReport::Detail::All); list.push_back(MyMoneyReport( - MyMoneyReport::eSchedule, - MyMoneyReport::eMonths, + MyMoneyReport::Row::Schedule, + MyMoneyReport::Column::Months, TransactionFilter::Date::Next12Months, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Schedule Summary Information"), i18n("Default Report") )); - list.back().setDetailLevel(MyMoneyReport::eDetailTop); + list.back().setDetailLevel(MyMoneyReport::Detail::Top); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountInfo, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AccountInfo, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Account Information"), i18n("Default Report") )); list.back().setConvertCurrency(false); list.push_back(MyMoneyReport( - MyMoneyReport::eAccountLoanInfo, - MyMoneyReport::eMonths, + MyMoneyReport::Row::AccountLoanInfo, + MyMoneyReport::Column::Months, TransactionFilter::Date::Today, - MyMoneyReport::eDetailAll, + MyMoneyReport::Detail::All, i18n("Loan Information"), i18n("Default Report") )); diff --git a/kmymoney/widgets/reporttabimpl.cpp b/kmymoney/widgets/reporttabimpl.cpp --- a/kmymoney/widgets/reporttabimpl.cpp +++ b/kmymoney/widgets/reporttabimpl.cpp @@ -94,11 +94,11 @@ ui = new Ui::ReportTabChart; ui->setupUi(this); - ui->m_comboType->addItem(i18nc("type of graphic chart", "Line"), MyMoneyReport::eChartLine); - ui->m_comboType->addItem(i18nc("type of graphic chart", "Bar"), MyMoneyReport::eChartBar); - ui->m_comboType->addItem(i18nc("type of graphic chart", "Stacked Bar"), MyMoneyReport::eChartStackedBar); - ui->m_comboType->addItem(i18nc("type of graphic chart", "Pie"), MyMoneyReport::eChartPie); - ui->m_comboType->addItem(i18nc("type of graphic chart", "Ring"), MyMoneyReport::eChartRing); + ui->m_comboType->addItem(i18nc("type of graphic chart", "Line"), MyMoneyReport::Chart::Line); + ui->m_comboType->addItem(i18nc("type of graphic chart", "Bar"), MyMoneyReport::Chart::Bar); + ui->m_comboType->addItem(i18nc("type of graphic chart", "Stacked Bar"), MyMoneyReport::Chart::StackedBar); + ui->m_comboType->addItem(i18nc("type of graphic chart", "Pie"), MyMoneyReport::Chart::Pie); + ui->m_comboType->addItem(i18nc("type of graphic chart", "Ring"), MyMoneyReport::Chart::Ring); connect(ui->m_comboType, static_cast(&QComboBox::currentIndexChanged), this, &ReportTabChart::slotChartTypeChanged); emit ui->m_comboType->currentIndexChanged(ui->m_comboType->currentIndex()); } @@ -110,8 +110,8 @@ void ReportTabChart::slotChartTypeChanged(int index) { - if (index == MyMoneyReport::EChartType::eChartPie || - index == MyMoneyReport::EChartType::eChartRing) { + if (index == MyMoneyReport::Chart::Pie || + index == MyMoneyReport::Chart::Ring) { ui->m_checkCHGridLines->setText(i18n("Show circular grid lines")); ui->m_checkSVGridLines->setText(i18n("Show sagittal grid lines")); ui->m_logYaxis->setChecked(false); @@ -272,7 +272,7 @@ void ReportTabCapitalGain::slotInvestmentSumChanged(int index) { Q_UNUSED(index); - if (ui->m_investmentSum->currentData() == MyMoneyReport::eSumOwned) { + if (ui->m_investmentSum->currentData() == MyMoneyReport::Investment::Owned) { ui->m_settlementPeriod->setValue(0); ui->m_settlementPeriod->setEnabled(false); ui->m_showSTLTCapitalGains->setChecked(false); diff --git a/kmymoney/x-kmymoney.xml b/kmymoney/x-kmymoney.xml --- a/kmymoney/x-kmymoney.xml +++ b/kmymoney/x-kmymoney.xml @@ -7,6 +7,7 @@ KMyMoney-Datei KMyMoney File Archivo de KMyMoney + KMyMoney-tiedosto Fichier KMyMoney KMyMoney-bestand Ficheiro do KMyMoney