summaryrefslogtreecommitdiffstats
path: root/kmymoney2/reports/pivottable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/reports/pivottable.cpp')
-rw-r--r--kmymoney2/reports/pivottable.cpp536
1 files changed, 268 insertions, 268 deletions
diff --git a/kmymoney2/reports/pivottable.cpp b/kmymoney2/reports/pivottable.cpp
index c12ca57..2f51a9c 100644
--- a/kmymoney2/reports/pivottable.cpp
+++ b/kmymoney2/reports/pivottable.cpp
@@ -19,16 +19,16 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qlayout.h>
-#include <qdatetime.h>
-#include <qregexp.h>
-#include <qdragobject.h>
-#include <qclipboard.h>
-#include <qapplication.h>
-#include <qprinter.h>
-#include <qpainter.h>
-#include <qfile.h>
-#include <qdom.h>
+#include <tqlayout.h>
+#include <tqdatetime.h>
+#include <tqregexp.h>
+#include <tqdragobject.h>
+#include <tqclipboard.h>
+#include <tqapplication.h>
+#include <tqprinter.h>
+#include <tqpainter.h>
+#include <tqfile.h>
+#include <tqdom.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -61,11 +61,11 @@
namespace reports {
-QString Debug::m_sTabs;
+TQString Debug::m_sTabs;
bool Debug::m_sEnabled = DEBUG_ENABLED_BY_DEFAULT;
-QString Debug::m_sEnableKey;
+TQString Debug::m_sEnableKey;
-Debug::Debug( const QString& _name ): m_methodName( _name ), m_enabled( m_sEnabled )
+Debug::Debug( const TQString& _name ): m_methodName( _name ), m_enabled( m_sEnabled )
{
if (!m_enabled && _name == m_sEnableKey)
m_enabled = true;
@@ -89,7 +89,7 @@ Debug::~Debug()
}
}
-void Debug::output( const QString& _text )
+void Debug::output( const TQString& _text )
{
if ( m_enabled )
qDebug( "%s%s(): %s", m_sTabs.latin1(), m_methodName.latin1(), _text.latin1() );
@@ -131,8 +131,8 @@ void PivotTable::init(void)
{
// strip out the 'days' component of the begin and end dates.
// we're only using these variables to contain year and month.
- m_beginDate = QDate( m_beginDate.year(), m_beginDate.month(), 1 );
- m_endDate = QDate( m_endDate.year(), m_endDate.month(), 1 );
+ m_beginDate = TQDate( m_beginDate.year(), m_beginDate.month(), 1 );
+ m_endDate = TQDate( m_endDate.year(), m_endDate.month(), 1 );
}
m_numColumns = columnValue(m_endDate) - columnValue(m_beginDate) + 2;
@@ -184,7 +184,7 @@ void PivotTable::init(void)
// Populate all transactions into the row/column pivot grid
//
- QValueList<MyMoneyTransaction> transactions;
+ TQValueList<MyMoneyTransaction> transactions;
m_config_f.setReportAllSplits(false);
m_config_f.setConsiderCategory(true);
try {
@@ -193,7 +193,7 @@ void PivotTable::init(void)
qDebug("ERR: %s thrown in %s(%ld)", e->what().data(), e->file().data(), e->line());
throw e;
}
- DEBUG_OUTPUT(QString("Found %1 matching transactions").arg(transactions.count()));
+ DEBUG_OUTPUT(TQString("Found %1 matching transactions").tqarg(transactions.count()));
// Include scheduled transactions if required
@@ -202,14 +202,14 @@ void PivotTable::init(void)
// Create a custom version of the report filter, excluding date
// We'll use this to compare the transaction against
MyMoneyTransactionFilter schedulefilter(m_config_f);
- schedulefilter.setDateFilter(QDate(),QDate());
+ schedulefilter.setDateFilter(TQDate(),TQDate());
// Get the real dates from the config filter
- QDate configbegin, configend;
+ TQDate configbegin, configend;
m_config_f.validDateRange(configbegin, configend);
- QValueList<MyMoneySchedule> schedules = file->scheduleList();
- QValueList<MyMoneySchedule>::const_iterator it_schedule = schedules.begin();
+ TQValueList<MyMoneySchedule> schedules = file->scheduleList();
+ TQValueList<MyMoneySchedule>::const_iterator it_schedule = schedules.begin();
while ( it_schedule != schedules.end() )
{
// If the transaction meets the filter
@@ -221,17 +221,17 @@ void PivotTable::init(void)
tx.setValue("kmm-schedule-id", (*it_schedule).id());
// Get the dates when a payment will be made within the report window
- QDate nextpayment = (*it_schedule).adjustedNextPayment(configbegin);
+ TQDate nextpayment = (*it_schedule).adjustedNextPayment(configbegin);
if ( nextpayment.isValid() )
{
// Add one transaction for each date
- QValueList<QDate> paymentDates = (*it_schedule).paymentDates(nextpayment,configend);
- QValueList<QDate>::const_iterator it_date = paymentDates.begin();
+ TQValueList<TQDate> paymentDates = (*it_schedule).paymentDates(nextpayment,configend);
+ TQValueList<TQDate>::const_iterator it_date = paymentDates.begin();
while ( it_date != paymentDates.end() )
{
//if the payment occurs in the past, enter it tomorrow
- if(QDate::currentDate() >= *it_date) {
- tx.setPostDate(QDate::currentDate().addDays(1));
+ if(TQDate::tqcurrentDate() >= *it_date) {
+ tx.setPostDate(TQDate::tqcurrentDate().addDays(1));
} else {
tx.setPostDate(*it_date);
}
@@ -240,7 +240,7 @@ void PivotTable::init(void)
transactions += tx;
}
- DEBUG_OUTPUT(QString("Added transaction for schedule %1 on %2").arg((*it_schedule).id()).arg((*it_date).toString()));
+ DEBUG_OUTPUT(TQString("Added transaction for schedule %1 on %2").tqarg((*it_schedule).id()).tqarg((*it_date).toString()));
++it_date;
}
@@ -256,13 +256,13 @@ void PivotTable::init(void)
bool al_transfers = ( m_config_f.rowType() == MyMoneyReport::eExpenseIncome ) && ( m_config_f.isIncludingTransfers() );
//this is to store balance for loan accounts when not included in the report
- QMap<QString, MyMoneyMoney> loanBalances;
+ TQMap<TQString, MyMoneyMoney> loanBalances;
- QValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
+ TQValueList<MyMoneyTransaction>::const_iterator it_transaction = transactions.begin();
unsigned colofs = columnValue(m_beginDate) - 1;
while ( it_transaction != transactions.end() )
{
- QDate postdate = (*it_transaction).postDate();
+ TQDate postdate = (*it_transaction).postDate();
unsigned column = columnValue(postdate) - colofs;
MyMoneyTransaction tx = (*it_transaction);
@@ -275,19 +275,19 @@ void PivotTable::init(void)
if(!split.id().isEmpty()) {
ReportAccount splitAccount = file->account(split.accountId());
MyMoneyAccount::accountTypeE type = splitAccount.accountGroup();
- QString outergroup = KMyMoneyUtils::accountTypeToString(type);
+ TQString outergroup = KMyMoneyUtils::accountTypeToString(type);
//if the account is included in the report, calculate the balance from the cells
if(m_config_f.includes( splitAccount )) {
loanBalances[splitAccount.id()] = cellBalance(outergroup, splitAccount, column, false);
} else {
//if it is not in the report and also not in loanBalances, get the balance from the file
- if(!loanBalances.contains(splitAccount.id())) {
- QDate dueDate = sched.nextDueDate();
+ if(!loanBalances.tqcontains(splitAccount.id())) {
+ TQDate dueDate = sched.nextDueDate();
//if the payment is overdue, use current date
- if(dueDate < QDate::currentDate())
- dueDate = QDate::currentDate();
+ if(dueDate < TQDate::tqcurrentDate())
+ dueDate = TQDate::tqcurrentDate();
//get the balance from the file for the date
loanBalances[splitAccount.id()] = file->balance(splitAccount.id(), dueDate.addDays(-1));
@@ -298,7 +298,7 @@ void PivotTable::init(void)
//if the loan split is not included in the report, update the balance for the next occurrence
if(!m_config_f.includes( splitAccount )) {
- QValueList<MyMoneySplit>::ConstIterator it_loanSplits;
+ TQValueList<MyMoneySplit>::ConstIterator it_loanSplits;
for(it_loanSplits = tx.splits().begin(); it_loanSplits != tx.splits().end(); ++it_loanSplits) {
if((*it_loanSplits).isAmortizationSplit() && (*it_loanSplits).accountId() == splitAccount.id() )
loanBalances[splitAccount.id()] = loanBalances[splitAccount.id()] + (*it_loanSplits).shares();
@@ -307,8 +307,8 @@ void PivotTable::init(void)
}
}
- QValueList<MyMoneySplit> splits = tx.splits();
- QValueList<MyMoneySplit>::const_iterator it_split = splits.begin();
+ TQValueList<MyMoneySplit> splits = tx.splits();
+ TQValueList<MyMoneySplit>::const_iterator it_split = splits.begin();
while ( it_split != splits.end() )
{
ReportAccount splitAccount = (*it_split).accountId();
@@ -323,7 +323,7 @@ void PivotTable::init(void)
MyMoneyMoney value;
// the outer group is the account class (major account type)
MyMoneyAccount::accountTypeE type = splitAccount.accountGroup();
- QString outergroup = KMyMoneyUtils::accountTypeToString(type);
+ TQString outergroup = KMyMoneyUtils::accountTypeToString(type);
value = (*it_split).shares();
bool stockSplit = tx.isStockSplit();
@@ -468,7 +468,7 @@ void PivotTable::collapseColumns(void)
void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn)
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- DEBUG_OUTPUT(QString("From Column %1 to %2").arg(sourcecolumn).arg(destcolumn));
+ DEBUG_OUTPUT(TQString("From Column %1 to %2").tqarg(sourcecolumn).tqarg(destcolumn));
// iterate over outer groups
PivotGrid::iterator it_outergroup = m_grid.begin();
@@ -483,9 +483,9 @@ void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn)
while ( it_row != (*it_innergroup).end() )
{
if ( (*it_row)[eActual].count() <= sourcecolumn )
- throw new MYMONEYEXCEPTION(QString("Sourcecolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(sourcecolumn).arg((*it_row)[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Sourcecolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(sourcecolumn).tqarg((*it_row)[eActual].count()));
if ( (*it_row)[eActual].count() <= destcolumn )
- throw new MYMONEYEXCEPTION(QString("Destcolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(sourcecolumn).arg((*it_row)[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Destcolumn %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(sourcecolumn).tqarg((*it_row)[eActual].count()));
(*it_row)[eActual][destcolumn] += (*it_row)[eActual][sourcecolumn];
++it_row;
@@ -500,7 +500,7 @@ void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn)
void PivotTable::clearColumn(unsigned column)
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- DEBUG_OUTPUT(QString("Column %1").arg(column));
+ DEBUG_OUTPUT(TQString("Column %1").tqarg(column));
// iterate over outer groups
PivotGrid::iterator it_outergroup = m_grid.begin();
@@ -515,7 +515,7 @@ void PivotTable::clearColumn(unsigned column)
while ( it_row != (*it_innergroup).end() )
{
if ( (*it_row)[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::accumulateColumn").arg(column).arg((*it_row)[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::accumulateColumn").tqarg(column).tqarg((*it_row)[eActual].count()));
(*it_row++)[eActual][column] = PivotCell();
}
@@ -540,19 +540,19 @@ void PivotTable::calculateColumnHeadings(void)
{
if ( columnpitch == 1 )
{
- QDate columnDate = m_beginDate;
+ TQDate columnDate = m_beginDate;
unsigned column = 1;
while ( column++ < m_numColumns )
{
- QString heading = KGlobal::locale()->calendar()->monthName(columnDate.month(), columnDate.year(), true) + " " + QString::number(columnDate.day());
+ TQString heading = KGlobal::locale()->calendar()->monthName(columnDate.month(), columnDate.year(), true) + " " + TQString::number(columnDate.day());
columnDate = columnDate.addDays(1);
m_columnHeadings.append( heading);
}
}
else
{
- QDate day = m_beginDate;
- QDate prv = m_beginDate;
+ TQDate day = m_beginDate;
+ TQDate prv = m_beginDate;
// use the user's locale to determine the week's start
unsigned dow = (day.dayOfWeek() +8 -KGlobal::locale()->weekStartDay())%7;
@@ -561,11 +561,11 @@ void PivotTable::calculateColumnHeadings(void)
{
if (((dow % columnpitch) == 0) || (day == m_endDate))
{
- m_columnHeadings.append(QString("%1&nbsp;%2 - %3&nbsp;%4")
- .arg(KGlobal::locale()->calendar()->monthName(prv.month(), prv.year(), true))
- .arg(prv.day())
- .arg(KGlobal::locale()->calendar()->monthName(day.month(), day.year(), true))
- .arg(day.day()));
+ m_columnHeadings.append(TQString("%1&nbsp;%2 - %3&nbsp;%4")
+ .tqarg(KGlobal::locale()->calendar()->monthName(prv.month(), prv.year(), true))
+ .tqarg(prv.day())
+ .tqarg(KGlobal::locale()->calendar()->monthName(day.month(), day.year(), true))
+ .tqarg(day.day()));
prv = day.addDays(1);
}
day = day.addDays(1);
@@ -582,7 +582,7 @@ void PivotTable::calculateColumnHeadings(void)
unsigned year = m_beginDate.year();
unsigned column = 1;
while ( column++ < m_numColumns )
- m_columnHeadings.append(QString::number(year++));
+ m_columnHeadings.append(TQString::number(year++));
}
else
{
@@ -592,11 +592,11 @@ void PivotTable::calculateColumnHeadings(void)
unsigned column = 1;
while ( column++ < m_numColumns )
{
- QString heading = KGlobal::locale()->calendar()->monthName(1+segment*columnpitch, 2000, true);
+ TQString heading = KGlobal::locale()->calendar()->monthName(1+segment*columnpitch, 2000, true);
if ( columnpitch != 1 )
heading += "-" + KGlobal::locale()->calendar()->monthName((1+segment)*columnpitch, 2000, true);
if ( includeyear )
- heading += " " + QString::number(year);
+ heading += " " + TQString::number(year);
m_columnHeadings.append( heading);
if ( ++segment >= 12/columnpitch )
{
@@ -613,10 +613,10 @@ void PivotTable::createAccountRows(void)
DEBUG_ENTER(__PRETTY_FUNCTION__);
MyMoneyFile* file = MyMoneyFile::instance();
- QValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
file->accountList(accounts);
- QValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
+ TQValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
while ( it_account != accounts.end() )
{
@@ -626,10 +626,10 @@ void PivotTable::createAccountRows(void)
// and if the report includes this account
if ( m_config_f.includes( *it_account ) )
{
- DEBUG_OUTPUT(QString("Includes account %1").arg(account.name()));
+ DEBUG_OUTPUT(TQString("Includes account %1").tqarg(account.name()));
// the row group is the account class (major account type)
- QString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
+ TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
// place into the 'opening' column...
assignCell( outergroup, account, 0, MyMoneyMoney() );
}
@@ -644,8 +644,8 @@ void PivotTable::calculateOpeningBalances( void )
// First, determine the inclusive dates of the report. Normally, that's just
// the begin & end dates of m_config_f. However, if either of those dates are
// blank, we need to use m_beginDate and/or m_endDate instead.
- QDate from = m_config_f.fromDate();
- QDate to = m_config_f.toDate();
+ TQDate from = m_config_f.fromDate();
+ TQDate to = m_config_f.toDate();
if ( ! from.isValid() )
from = m_beginDate;
if ( ! to.isValid() )
@@ -653,10 +653,10 @@ void PivotTable::calculateOpeningBalances( void )
MyMoneyFile* file = MyMoneyFile::instance();
- QValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
file->accountList(accounts);
- QValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
+ TQValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
while ( it_account != accounts.end() )
{
@@ -674,18 +674,18 @@ void PivotTable::calculateOpeningBalances( void )
filter.addAccount(account.id());
filter.setDateFilter(m_beginDate, m_endDate);
filter.setReportAllSplits(false);
- QValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter);
//if a closed account has no transactions in that timeframe, do not include it
if(transactions.size() == 0 ) {
- DEBUG_OUTPUT(QString("DOES NOT INCLUDE account %1").arg(account.name()));
+ DEBUG_OUTPUT(TQString("DOES NOT INCLUDE account %1").tqarg(account.name()));
++it_account;
continue;
}
}
- DEBUG_OUTPUT(QString("Includes account %1").arg(account.name()));
+ DEBUG_OUTPUT(TQString("Includes account %1").tqarg(account.name()));
// the row group is the account class (major account type)
- QString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
+ TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
// extract the balance of the account for the given begin date, which is
// the opening balance plus the sum of all transactions prior to the begin
@@ -699,7 +699,7 @@ void PivotTable::calculateOpeningBalances( void )
}
else
{
- DEBUG_OUTPUT(QString("DOES NOT INCLUDE account %1").arg(account.name()));
+ DEBUG_OUTPUT(TQString("DOES NOT INCLUDE account %1").tqarg(account.name()));
}
++it_account;
@@ -713,7 +713,7 @@ void PivotTable::calculateRunningSums( PivotInnerGroup::iterator& it_row)
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").arg(column).arg(it_row.data()[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").tqarg(column).tqarg(it_row.data()[eActual].count()));
runningsum = it_row.data()[eActual][column].calculateRunningSum(runningsum);
@@ -742,7 +742,7 @@ void PivotTable::calculateRunningSums( void )
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").arg(column).arg(it_row.data()[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateRunningSums").tqarg(column).tqarg(it_row.data()[eActual].count()));
runningsum = ( it_row.data()[eActual][column] += runningsum );
@@ -758,11 +758,11 @@ void PivotTable::calculateRunningSums( void )
}
}
-MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAccount& _row, unsigned _column, bool budget)
+MyMoneyMoney PivotTable::cellBalance(const TQString& outergroup, const ReportAccount& _row, unsigned _column, bool budget)
{
if(m_runningSumsCalculated) {
qDebug("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()");
- throw new MYMONEYEXCEPTION(QString("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()"));
+ throw new MYMONEYEXCEPTION(TQString("You must not call PivotTable::cellBalance() after calling PivotTable::calculateRunningSums()"));
}
// for budget reports, if this is the actual value, map it to the account which
@@ -770,7 +770,7 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco
ReportAccount row = _row;
if ( !budget && m_config_f.hasBudget() )
{
- QString newrow = m_budgetMap[row.id()];
+ TQString newrow = m_budgetMap[row.id()];
// if there was no mapping found, then the budget report is not interested
// in this account.
@@ -780,16 +780,16 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco
row = newrow;
}
- // ensure the row already exists (and its parental hierarchy)
+ // ensure the row already exists (and its tqparental hierarchy)
createRow( outergroup, row, true );
- // Determine the inner group from the top-most parent account
- QString innergroup( row.topParentName() );
+ // Determine the inner group from the top-most tqparent account
+ TQString innergroup( row.topParentName() );
if ( m_numColumns <= _column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of m_numColumns range (%2) in PivotTable::cellBalance").arg(_column).arg(m_numColumns));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of m_numColumns range (%2) in PivotTable::cellBalance").tqarg(_column).tqarg(m_numColumns));
if ( m_grid[outergroup][innergroup][row][eActual].count() <= _column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::cellBalance").arg(_column).arg(m_grid[outergroup][innergroup][row][eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::cellBalance").tqarg(_column).tqarg(m_grid[outergroup][innergroup][row][eActual].count()));
MyMoneyMoney balance;
if ( budget )
@@ -801,7 +801,7 @@ MyMoneyMoney PivotTable::cellBalance(const QString& outergroup, const ReportAcco
while ( column < _column)
{
if ( m_grid[outergroup][innergroup][row][eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::cellBalance").arg(column).arg(m_grid[outergroup][innergroup][row][eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::cellBalance").tqarg(column).tqarg(m_grid[outergroup][innergroup][row][eActual].count()));
balance = m_grid[outergroup][innergroup][row][eActual][column].cellBalance(balance);
@@ -827,11 +827,11 @@ void PivotTable::calculateBudgetMapping( void )
MyMoneyBudget budget = MyMoneyBudget();
//if no budget has been selected
if (m_config_f.budget() == "Any" ) {
- QValueList<MyMoneyBudget> budgets = file->budgetList();
- QValueList<MyMoneyBudget>::const_iterator budgets_it = budgets.begin();
+ TQValueList<MyMoneyBudget> budgets = file->budgetList();
+ TQValueList<MyMoneyBudget>::const_iterator budgets_it = budgets.begin();
while( budgets_it != budgets.end() ) {
//pick the first budget that matches the report start year
- if( (*budgets_it).budgetStart().year() == QDate::currentDate().year() ) {
+ if( (*budgets_it).budgetStart().year() == TQDate::tqcurrentDate().year() ) {
budget = file->budget( (*budgets_it).id());
break;
}
@@ -852,24 +852,24 @@ void PivotTable::calculateBudgetMapping( void )
//kdDebug(2) << "Budget " << budget.name() << ": " << endl;
// Go through all accounts in the system to build the mapping
- QValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
file->accountList(accounts);
- QValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
+ TQValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
while ( it_account != accounts.end() )
{
//include only the accounts selected for the report
if ( m_config_f.includes ( *it_account ) ) {
- QString id = ( *it_account ).id();
- QString acid = id;
+ TQString id = ( *it_account ).id();
+ TQString acid = id;
// If the budget contains this account outright
- if ( budget.contains ( id ) )
+ if ( budget.tqcontains ( id ) )
{
// Add it to the mapping
m_budgetMap[acid] = id;
// kdDebug(2) << ReportAccount(acid).debugName() << " self-maps / type =" << budget.account(id).budgetLevel() << endl;
}
- // Otherwise, search for a parent account which includes sub-accounts
+ // Otherwise, search for a tqparent account which includes sub-accounts
else
{
//if includeBudgetActuals, include all accounts regardless of whether in budget or not
@@ -879,8 +879,8 @@ void PivotTable::calculateBudgetMapping( void )
}
do
{
- id = file->account ( id ).parentAccountId();
- if ( budget.contains ( id ) )
+ id = file->account ( id ).tqparentAccountId();
+ if ( budget.tqcontains ( id ) )
{
if ( budget.account ( id ).budgetSubaccounts() )
{
@@ -897,8 +897,8 @@ void PivotTable::calculateBudgetMapping( void )
} // end while looping through the accounts in the file
// Place the budget values into the budget grid
- QValueList<MyMoneyBudget::AccountGroup> baccounts = budget.getaccounts();
- QValueList<MyMoneyBudget::AccountGroup>::const_iterator it_bacc = baccounts.begin();
+ TQValueList<MyMoneyBudget::AccountGroup> baccounts = budget.getaccounts();
+ TQValueList<MyMoneyBudget::AccountGroup>::const_iterator it_bacc = baccounts.begin();
while ( it_bacc != baccounts.end() )
{
ReportAccount splitAccount = (*it_bacc).id();
@@ -906,12 +906,12 @@ void PivotTable::calculateBudgetMapping( void )
//include the budget account only if it is included in the report
if ( m_config_f.includes ( splitAccount ) ) {
MyMoneyAccount::accountTypeE type = splitAccount.accountGroup();
- QString outergroup = KMyMoneyUtils::accountTypeToString(type);
+ TQString outergroup = KMyMoneyUtils::accountTypeToString(type);
// reverse sign to match common notation for cash flow direction, only for expense/income splits
MyMoneyMoney reverse((splitAccount.accountType() == MyMoneyAccount::Expense) ? -1 : 1, 1);
- const QMap<QDate, MyMoneyBudget::PeriodGroup>& periods = (*it_bacc).getPeriods();
+ const TQMap<TQDate, MyMoneyBudget::PeriodGroup>& periods = (*it_bacc).getPeriods();
MyMoneyMoney value = (*periods.begin()).amount() * reverse;
MyMoneyMoney price = MyMoneyMoney(1,1);
unsigned column = 1;
@@ -933,7 +933,7 @@ void PivotTable::calculateBudgetMapping( void )
|| m_config_f.columnType() == MyMoneyReport::eQuarters) {
//value = value * MyMoneyMoney(m_config_f.columnType(), 1);
- QDate budgetDate = budget.budgetStart();
+ TQDate 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
//no currency conversion is done here because that is done for all columns later
@@ -954,7 +954,7 @@ void PivotTable::calculateBudgetMapping( void )
// place each value in the appropriate column
// budget periods are supposed to come in order just like columns
{
- QMap<QDate, MyMoneyBudget::PeriodGroup>::const_iterator it_period = periods.begin();
+ TQMap<TQDate, MyMoneyBudget::PeriodGroup>::const_iterator it_period = periods.begin();
while ( it_period != periods.end() && column < m_numColumns)
{
if((*it_period).startDate() > columnDate(column) ) {
@@ -1009,9 +1009,9 @@ void PivotTable::convertToBaseCurrency( void )
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::convertToBaseCurrency").arg(column).arg(it_row.data()[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::convertToBaseCurrency").tqarg(column).tqarg(it_row.data()[eActual].count()));
- QDate valuedate = columnDate(column);
+ TQDate valuedate = columnDate(column);
//get base price for that date
MyMoneyMoney conversionfactor = it_row.key().baseCurrencyPrice(valuedate);
@@ -1025,7 +1025,7 @@ void PivotTable::convertToBaseCurrency( void )
//convert to lowest fraction
it_row.data()[ m_rowTypeList[i] ][column] = PivotCell(value.convert(fraction));
- DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,QString("Factor of %1, value was %2, now %3").arg(conversionfactor).arg(DEBUG_SENSITIVE(oldval)).arg(DEBUG_SENSITIVE(it_row.data()[m_rowTypeList[i]][column].toDouble())));
+ DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,TQString("Factor of %1, value was %2, now %3").tqarg(conversionfactor).tqarg(DEBUG_SENSITIVE(oldval)).tqarg(DEBUG_SENSITIVE(it_row.data()[m_rowTypeList[i]][column].toDouble())));
}
}
@@ -1058,9 +1058,9 @@ void PivotTable::convertToDeepCurrency( void )
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::convertToDeepCurrency").arg(column).arg(it_row.data()[eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::convertToDeepCurrency").tqarg(column).tqarg(it_row.data()[eActual].count()));
- QDate valuedate = columnDate(column);
+ TQDate valuedate = columnDate(column);
//get conversion factor for the account and date
MyMoneyMoney conversionfactor = it_row.key().deepCurrencyPrice(valuedate);
@@ -1085,7 +1085,7 @@ void PivotTable::convertToDeepCurrency( void )
it_row.data()[ePrice][column] = PivotCell(priceValue.convert(10000));
}
- DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,QString("Factor of %1, value was %2, now %3").arg(conversionfactor).arg(DEBUG_SENSITIVE(oldval)).arg(DEBUG_SENSITIVE(it_row.data()[eActual][column].toDouble())));
+ DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,TQString("Factor of %1, value was %2, now %3").tqarg(conversionfactor).tqarg(DEBUG_SENSITIVE(oldval)).tqarg(DEBUG_SENSITIVE(it_row.data()[eActual][column].toDouble())));
++column;
}
@@ -1139,9 +1139,9 @@ void PivotTable::calculateTotals( void )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
if ( it_row.data()[ m_rowTypeList[i] ].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, row columns").arg(column).arg(it_row.data()[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, row columns").tqarg(column).tqarg(it_row.data()[ m_rowTypeList[i] ].count()));
if ( (*it_innergroup).m_total[ m_rowTypeList[i] ].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
//calculate total
MyMoneyMoney value = it_row.data()[ m_rowTypeList[i] ][column];
@@ -1162,9 +1162,9 @@ void PivotTable::calculateTotals( void )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
if ( (*it_innergroup).m_total[ m_rowTypeList[i] ].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, inner group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
if ( (*it_outergroup).m_total[ m_rowTypeList[i] ].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, outer group totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, outer group totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
//calculate totals
MyMoneyMoney value = (*it_innergroup).m_total[ m_rowTypeList[i] ][column];
@@ -1187,7 +1187,7 @@ void PivotTable::calculateTotals( void )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
if ( m_grid.m_total[ m_rowTypeList[i] ].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").arg(column).arg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").tqarg(column).tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].count()));
//calculate actual totals
MyMoneyMoney value = (*it_outergroup).m_total[ m_rowTypeList[i] ][column];
@@ -1215,7 +1215,7 @@ void PivotTable::calculateTotals( void )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
if ( m_grid.m_total[ m_rowTypeList[i] ].count() <= totalcolumn )
- throw new MYMONEYEXCEPTION(QString("Total column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").arg(totalcolumn).arg(m_grid.m_total[ m_rowTypeList[i] ].count()));
+ throw new MYMONEYEXCEPTION(TQString("Total column %1 out of grid range (%2) in PivotTable::calculateTotals, grid totals").tqarg(totalcolumn).tqarg(m_grid.m_total[ m_rowTypeList[i] ].count()));
//calculate actual totals
MyMoneyMoney value = m_grid.m_total[ m_rowTypeList[i] ][totalcolumn];
@@ -1225,17 +1225,17 @@ void PivotTable::calculateTotals( void )
}
}
-void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _row, unsigned column, MyMoneyMoney value, bool budget, bool stockSplit )
+void PivotTable::assignCell( const TQString& outergroup, const ReportAccount& _row, unsigned column, MyMoneyMoney value, bool budget, bool stockSplit )
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- DEBUG_OUTPUT(QString("Parameters: %1,%2,%3,%4,%5").arg(outergroup).arg(_row.debugName()).arg(column).arg(DEBUG_SENSITIVE(value.toDouble())).arg(budget));
+ DEBUG_OUTPUT(TQString("Parameters: %1,%2,%3,%4,%5").tqarg(outergroup).tqarg(_row.debugName()).tqarg(column).tqarg(DEBUG_SENSITIVE(value.toDouble())).tqarg(budget));
// for budget reports, if this is the actual value, map it to the account which
// holds its budget
ReportAccount row = _row;
if ( !budget && m_config_f.hasBudget() )
{
- QString newrow = m_budgetMap[row.id()];
+ TQString newrow = m_budgetMap[row.id()];
// if there was no mapping found, then the budget report is not interested
// in this account.
@@ -1245,16 +1245,16 @@ void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _ro
row = newrow;
}
- // ensure the row already exists (and its parental hierarchy)
+ // ensure the row already exists (and its tqparental hierarchy)
createRow( outergroup, row, true );
- // Determine the inner group from the top-most parent account
- QString innergroup( row.topParentName() );
+ // Determine the inner group from the top-most tqparent account
+ TQString innergroup( row.topParentName() );
if ( m_numColumns <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of m_numColumns range (%2) in PivotTable::assignCell").arg(column).arg(m_numColumns));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of m_numColumns range (%2) in PivotTable::assignCell").tqarg(column).tqarg(m_numColumns));
if ( m_grid[outergroup][innergroup][row][eActual].count() <= column )
- throw new MYMONEYEXCEPTION(QString("Column %1 out of grid range (%2) in PivotTable::assignCell").arg(column).arg(m_grid[outergroup][innergroup][row][eActual].count()));
+ throw new MYMONEYEXCEPTION(TQString("Column %1 out of grid range (%2) in PivotTable::assignCell").tqarg(column).tqarg(m_grid[outergroup][innergroup][row][eActual].count()));
if(!stockSplit) {
// Determine whether the value should be inverted before being placed in the row
@@ -1272,44 +1272,44 @@ void PivotTable::assignCell( const QString& outergroup, const ReportAccount& _ro
}
-void PivotTable::createRow( const QString& outergroup, const ReportAccount& row, bool recursive )
+void PivotTable::createRow( const TQString& outergroup, const ReportAccount& row, bool recursive )
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- // Determine the inner group from the top-most parent account
- QString innergroup( row.topParentName() );
+ // Determine the inner group from the top-most tqparent account
+ TQString innergroup( row.topParentName() );
- if ( ! m_grid.contains(outergroup) )
+ if ( ! m_grid.tqcontains(outergroup) )
{
- DEBUG_OUTPUT(QString("Adding group [%1]").arg(outergroup));
+ DEBUG_OUTPUT(TQString("Adding group [%1]").tqarg(outergroup));
m_grid[outergroup] = PivotOuterGroup(m_numColumns);
}
- if ( ! m_grid[outergroup].contains(innergroup) )
+ if ( ! m_grid[outergroup].tqcontains(innergroup) )
{
- DEBUG_OUTPUT(QString("Adding group [%1][%2]").arg(outergroup).arg(innergroup));
+ DEBUG_OUTPUT(TQString("Adding group [%1][%2]").tqarg(outergroup).tqarg(innergroup));
m_grid[outergroup][innergroup] = PivotInnerGroup(m_numColumns);
}
- if ( ! m_grid[outergroup][innergroup].contains(row) )
+ if ( ! m_grid[outergroup][innergroup].tqcontains(row) )
{
- DEBUG_OUTPUT(QString("Adding row [%1][%2][%3]").arg(outergroup).arg(innergroup).arg(row.debugName()));
+ DEBUG_OUTPUT(TQString("Adding row [%1][%2][%3]").tqarg(outergroup).tqarg(innergroup).tqarg(row.debugName()));
m_grid[outergroup][innergroup][row] = PivotGridRowSet(m_numColumns);
if ( recursive && !row.isTopLevel() )
- createRow( outergroup, row.parent(), recursive );
+ createRow( outergroup, row.tqparent(), recursive );
}
}
-unsigned PivotTable::columnValue(const QDate& _date) const
+unsigned PivotTable::columnValue(const TQDate& _date) const
{
if (m_config_f.isColumnsAreDays())
- return (QDate().daysTo(_date));
+ return (TQDate().daysTo(_date));
else
return (_date.year() * 12 + _date.month());
}
-QDate PivotTable::columnDate(int column) const
+TQDate PivotTable::columnDate(int column) const
{
if (m_config_f.isColumnsAreDays())
return m_beginDate.addDays( m_config_f.columnPitch() * column - 1 );
@@ -1317,7 +1317,7 @@ QDate PivotTable::columnDate(int column) const
return m_beginDate.addMonths( m_config_f.columnPitch() * column ).addDays(-1);
}
-QString PivotTable::renderCSV( void ) const
+TQString PivotTable::renderCSV( void ) const
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
@@ -1325,11 +1325,11 @@ QString PivotTable::renderCSV( void ) const
// Report Title
//
- QString result = QString("\"Report: %1\"\n").arg(m_config_f.name());
+ TQString result = TQString("\"Report: %1\"\n").tqarg(m_config_f.name());
if ( m_config_f.isConvertCurrency() )
- result += i18n("All currencies converted to %1\n").arg(MyMoneyFile::instance()->baseCurrency().name());
+ result += i18n("All currencies converted to %1\n").tqarg(MyMoneyFile::instance()->baseCurrency().name());
else
- result += i18n("All values shown in %1 unless otherwise noted\n").arg(MyMoneyFile::instance()->baseCurrency().name());
+ result += i18n("All values shown in %1 unless otherwise noted\n").tqarg(MyMoneyFile::instance()->baseCurrency().name());
//
// Table Header
@@ -1339,10 +1339,10 @@ QString PivotTable::renderCSV( void ) const
unsigned column = 1;
while ( column < m_numColumns )
- result += QString(",%1").arg(QString(m_columnHeadings[column++]));
+ result += TQString(",%1").tqarg(TQString(m_columnHeadings[column++]));
if ( m_config_f.isShowingRowTotals() )
- result += QString(",%1").arg(i18n("Total"));
+ result += TQString(",%1").tqarg(i18n("Total"));
result += "\n";
@@ -1374,7 +1374,7 @@ QString PivotTable::renderCSV( void ) const
// Rows
//
- QString innergroupdata;
+ TQString innergroupdata;
PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin();
while ( it_row != (*it_innergroup).end() )
{
@@ -1385,7 +1385,7 @@ QString PivotTable::renderCSV( void ) const
// Columns
//
- QString rowdata;
+ TQString rowdata;
unsigned column = 1;
bool isUsed = false;
@@ -1396,14 +1396,14 @@ QString PivotTable::renderCSV( void ) const
//show columns
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
isUsed |= it_row.data()[ m_rowTypeList[i] ][column].isUsed();
- rowdata += QString(",\"%1\"").arg(it_row.data()[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
+ rowdata += TQString(",\"%1\"").tqarg(it_row.data()[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
}
column++;
}
if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- rowdata += QString(",\"%1\"").arg((*it_row)[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
+ rowdata += TQString(",\"%1\"").tqarg((*it_row)[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
}
//
@@ -1411,13 +1411,13 @@ QString PivotTable::renderCSV( void ) const
//
if(!rowname.isClosed() || isUsed) {
- innergroupdata += "\"" + QString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name();
+ innergroupdata += "\"" + TQString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name();
// if we don't convert the currencies to the base currency and the
// current row contains a foreign currency, then we append the currency
// to the name of the account
if (!m_config_f.isConvertCurrency() && rowname.isForeignCurrency() )
- innergroupdata += QString(" (%1)").arg(rowname.currencyId());
+ innergroupdata += TQString(" (%1)").tqarg(rowname.currencyId());
innergroupdata += "\"";
@@ -1434,7 +1434,7 @@ QString PivotTable::renderCSV( void ) const
//
bool finishrow = true;
- QString finalRow;
+ TQString finalRow;
bool isUsed = false;
if ( m_config_f.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1 ))
{
@@ -1459,9 +1459,9 @@ QString PivotTable::renderCSV( void ) const
ReportAccount rowname = (*it_innergroup).begin().key();
isUsed |= !rowname.isClosed();
- finalRow = "\"" + QString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name();
+ finalRow = "\"" + TQString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name();
if (!m_config_f.isConvertCurrency() && rowname.isForeignCurrency() )
- finalRow += QString(" (%1)").arg(rowname.currencyId());
+ finalRow += TQString(" (%1)").tqarg(rowname.currencyId());
finalRow += "\"";
}
@@ -1477,14 +1477,14 @@ QString PivotTable::renderCSV( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
isUsed |= (*it_innergroup).m_total[ m_rowTypeList[i] ][column].isUsed();
- finalRow += QString(",\"%1\"").arg((*it_innergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
+ finalRow += TQString(",\"%1\"").tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
}
column++;
}
if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- finalRow += QString(",\"%1\"").arg((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
+ finalRow += TQString(",\"%1\"").tqarg((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
}
finalRow += "\n";
@@ -1504,18 +1504,18 @@ QString PivotTable::renderCSV( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
- result += QString("%1 %2").arg(i18n("Total")).arg(it_outergroup.key());
+ result += TQString("%1 %2").tqarg(i18n("Total")).tqarg(it_outergroup.key());
unsigned column = 1;
while ( column < m_numColumns ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- result += QString(",\"%1\"").arg((*it_outergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
+ result += TQString(",\"%1\"").tqarg((*it_outergroup).m_total[ m_rowTypeList[i] ][column].formatMoney(fraction, false));
column++;
}
if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- result += QString(",\"%1\"").arg((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
+ result += TQString(",\"%1\"").tqarg((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
}
result += "\n";
@@ -1533,14 +1533,14 @@ QString PivotTable::renderCSV( void ) const
unsigned totalcolumn = 1;
while ( totalcolumn < m_numColumns ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- result += QString(",\"%1\"").arg(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn].formatMoney(fraction, false));
+ result += TQString(",\"%1\"").tqarg(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn].formatMoney(fraction, false));
totalcolumn++;
}
if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- result += QString(",\"%1\"").arg(m_grid.m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
+ result += TQString(",\"%1\"").tqarg(m_grid.m_total[ m_rowTypeList[i] ].m_total.formatMoney(fraction, false));
}
result += "\n";
@@ -1549,55 +1549,55 @@ QString PivotTable::renderCSV( void ) const
return result;
}
-QString PivotTable::renderHTML( void ) const
+TQString PivotTable::renderHTML( void ) const
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- QString colspan = QString(" colspan=\"%1\"").arg(m_numColumns + 1 + (m_config_f.isShowingRowTotals() ? 1 : 0) );
+ TQString colspan = TQString(" colspan=\"%1\"").tqarg(m_numColumns + 1 + (m_config_f.isShowingRowTotals() ? 1 : 0) );
//
// Report Title
//
- QString result = QString("<h2 class=\"report\">%1</h2>\n").arg(m_config_f.name());
+ TQString result = TQString("<h2 class=\"report\">%1</h2>\n").tqarg(m_config_f.name());
//actual dates of the report
- result += QString("<div class=\"subtitle\">");
- result += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config_f.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config_f.toDate(), true));
- result += QString("</div>\n");
- result += QString("<div class=\"gap\">&nbsp;</div>\n");
+ result += TQString("<div class=\"subtitle\">");
+ result += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config_f.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config_f.toDate(), true));
+ result += TQString("</div>\n");
+ result += TQString("<div class=\"gap\">&nbsp;</div>\n");
//currency conversion message
- result += QString("<div class=\"subtitle\">");
+ result += TQString("<div class=\"subtitle\">");
if ( m_config_f.isConvertCurrency() )
- result += i18n("All currencies converted to %1").arg(MyMoneyFile::instance()->baseCurrency().name());
+ result += i18n("All currencies converted to %1").tqarg(MyMoneyFile::instance()->baseCurrency().name());
else
- result += i18n("All values shown in %1 unless otherwise noted").arg(MyMoneyFile::instance()->baseCurrency().name());
- result += QString("</div>\n");
- result += QString("<div class=\"gap\">&nbsp;</div>\n");
+ result += i18n("All values shown in %1 unless otherwise noted").tqarg(MyMoneyFile::instance()->baseCurrency().name());
+ result += TQString("</div>\n");
+ result += TQString("<div class=\"gap\">&nbsp;</div>\n");
// setup a leftborder for better readability of budget vs actual reports
- QString leftborder;
+ TQString leftborder;
if (m_rowTypeList.size() > 1)
leftborder = " class=\"leftborder\"";
//
// Table Header
//
- result += QString("\n\n<table class=\"report\" cellspacing=\"0\">\n"
- "<thead><tr class=\"itemheader\">\n<th>%1</th>").arg(i18n("Account"));
+ result += TQString("\n\n<table class=\"report\" cellspacing=\"0\">\n"
+ "<thead><tr class=\"itemheader\">\n<th>%1</th>").tqarg(i18n("Account"));
- QString headerspan;
+ TQString headerspan;
int span = m_rowTypeList.size();
- headerspan = QString(" colspan=\"%1\"").arg(span);
+ headerspan = TQString(" colspan=\"%1\"").tqarg(span);
unsigned column = 1;
while ( column < m_numColumns )
- result += QString("<th%1>%2</th>").arg(headerspan,QString(m_columnHeadings[column++]).replace(QRegExp(" "),"<br>"));
+ result += TQString("<th%1>%2</th>").tqarg(headerspan,TQString(m_columnHeadings[column++]).tqreplace(TQRegExp(" "),"<br>"));
if ( m_config_f.isShowingRowTotals() )
- result += QString("<th%1>%2</th>").arg(headerspan).arg(i18n("Total"));
+ result += TQString("<th%1>%2</th>").tqarg(headerspan).tqarg(i18n("Total"));
result += "</tr></thead>\n";
@@ -1611,22 +1611,22 @@ QString PivotTable::renderHTML( void ) const
unsigned column = 1;
while ( column < m_numColumns )
{
- QString lb;
+ TQString lb;
if(column != 1)
lb = leftborder;
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(i18n( m_columnTypeHeaderList[i] ))
- .arg(i == 0 ? lb : QString() );
+ result += TQString("<td%2>%1</td>")
+ .tqarg(i18n( m_columnTypeHeaderList[i] ))
+ .tqarg(i == 0 ? lb : TQString() );
}
column++;
}
if ( m_config_f.isShowingRowTotals() ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(i18n( m_columnTypeHeaderList[i] ))
- .arg(i == 0 ? leftborder : QString() );
+ result += TQString("<td%2>%1</td>")
+ .tqarg(i18n( m_columnTypeHeaderList[i] ))
+ .tqarg(i == 0 ? leftborder : TQString() );
}
}
result += "</tr>";
@@ -1646,7 +1646,7 @@ QString PivotTable::renderHTML( void ) const
//
// I hope this doesn't bog the performance of reports, given that we're copying the entire report
// data. If this is a perf hit, we could change to storing outergroup pointers, I think.
- QValueList<PivotOuterGroup> outergroups;
+ TQValueList<PivotOuterGroup> outergroups;
PivotGrid::const_iterator it_outergroup_map = m_grid.begin();
while ( it_outergroup_map != m_grid.end() )
{
@@ -1660,14 +1660,14 @@ QString PivotTable::renderHTML( void ) const
}
qHeapSort(outergroups);
- QValueList<PivotOuterGroup>::const_iterator it_outergroup = outergroups.begin();
+ TQValueList<PivotOuterGroup>::const_iterator it_outergroup = outergroups.begin();
while ( it_outergroup != outergroups.end() )
{
//
// Outer Group Header
//
- result += QString("<tr class=\"sectionheader\"><td class=\"left\"%1>%2</td></tr>\n").arg(colspan).arg((*it_outergroup).m_displayName);
+ result += TQString("<tr class=\"sectionheader\"><td class=\"left\"%1>%2</td></tr>\n").tqarg(colspan).tqarg((*it_outergroup).m_displayName);
// Skip the inner groups if the report only calls for outer group totals to be shown
if ( m_config_f.detailLevel() != MyMoneyReport::eDetailGroup )
@@ -1685,7 +1685,7 @@ QString PivotTable::renderHTML( void ) const
// Rows
//
- QString innergroupdata;
+ TQString innergroupdata;
PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin();
while ( it_row != (*it_innergroup).end() )
{
@@ -1693,19 +1693,19 @@ QString PivotTable::renderHTML( void ) const
// Columns
//
- QString rowdata;
+ TQString rowdata;
unsigned column = 1;
bool isUsed = it_row.data()[eActual][0].isUsed();
while ( column < m_numColumns )
{
- QString lb;
+ TQString lb;
if(column != 1)
lb = leftborder;
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- rowdata += QString("<td%2>%1</td>")
- .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : QString());
+ rowdata += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column]))
+ .tqarg(i == 0 ? lb : TQString());
isUsed |= it_row.data()[ m_rowTypeList[i] ][column].isUsed();
}
@@ -1716,9 +1716,9 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingRowTotals() )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- rowdata += QString("<td%2>%1</td>")
- .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : QString());
+ rowdata += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
@@ -1730,13 +1730,13 @@ QString PivotTable::renderHTML( void ) const
// don't show closed accounts if they have not been used
if(!rowname.isClosed() || isUsed) {
- innergroupdata += QString("<tr class=\"row-%1\"%2><td%3 class=\"left\" style=\"text-indent: %4.0em\">%5%6</td>")
- .arg(rownum & 0x01 ? "even" : "odd")
- .arg(rowname.isTopLevel() ? " id=\"topparent\"" : "")
- .arg("") //.arg((*it_row).m_total.isZero() ? colspan : "") // colspan the distance if this row will be blank
- .arg(rowname.hierarchyDepth() - 1)
- .arg(rowname.name().replace(QRegExp(" "), "&nbsp;"))
- .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id()));
+ innergroupdata += TQString("<tr class=\"row-%1\"%2><td%3 class=\"left\" style=\"text-indent: %4.0em\">%5%6</td>")
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg(rowname.isTopLevel() ? " id=\"toptqparent\"" : "")
+ .tqarg("") //.tqarg((*it_row).m_total.isZero() ? colspan : "") // colspan the distance if this row will be blank
+ .tqarg(rowname.hierarchyDepth() - 1)
+ .tqarg(rowname.name().tqreplace(TQRegExp(" "), "&nbsp;"))
+ .tqarg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").tqarg(rowname.currency().id()));
// Don't print this row if it's going to be all zeros
// TODO: Uncomment this, and deal with the case where the data
@@ -1755,7 +1755,7 @@ QString PivotTable::renderHTML( void ) const
//
bool finishrow = true;
- QString finalRow;
+ TQString finalRow;
bool isUsed = false;
if ( m_config_f.detailLevel() == MyMoneyReport::eDetailAll && ((*it_innergroup).size() > 1 ))
{
@@ -1765,9 +1765,9 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
// Start the TOTALS row
- finalRow = QString("<tr class=\"row-%1\" id=\"subtotal\"><td class=\"left\">&nbsp;&nbsp;%2</td>")
- .arg(rownum & 0x01 ? "even" : "odd")
- .arg(i18n("Total"));
+ finalRow = TQString("<tr class=\"row-%1\" id=\"subtotal\"><td class=\"left\">&nbsp;&nbsp;%2</td>")
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg(i18n("Total"));
// don't suppress display of totals
isUsed = true;
}
@@ -1787,12 +1787,12 @@ QString PivotTable::renderHTML( void ) const
// This works for me (ipwizard)
ReportAccount rowname = (*it_innergroup).begin().key();
isUsed |= !rowname.isClosed();
- finalRow = QString("<tr class=\"row-%1\"%2><td class=\"left\" style=\"text-indent: %3.0em;\">%5%6</td>")
- .arg(rownum & 0x01 ? "even" : "odd")
- .arg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" )
- .arg(rowname.hierarchyDepth() - 1)
- .arg(rowname.name().replace(QRegExp(" "), "&nbsp;"))
- .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id()));
+ finalRow = TQString("<tr class=\"row-%1\"%2><td class=\"left\" style=\"text-indent: %3.0em;\">%5%6</td>")
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" )
+ .tqarg(rowname.hierarchyDepth() - 1)
+ .tqarg(rowname.name().tqreplace(TQRegExp(" "), "&nbsp;"))
+ .tqarg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").tqarg(rowname.currency().id()));
}
// Finish the row started above, unless told not to
@@ -1802,14 +1802,14 @@ QString PivotTable::renderHTML( void ) const
isUsed |= (*it_innergroup).m_total[eActual][0].isUsed();
while ( column < m_numColumns )
{
- QString lb;
+ TQString lb;
if(column != 1)
lb = leftborder;
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- finalRow += QString("<td%2>%1</td>")
- .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : QString());
+ finalRow += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column]))
+ .tqarg(i == 0 ? lb : TQString());
isUsed |= (*it_innergroup).m_total[ m_rowTypeList[i] ][column].isUsed();
}
@@ -1819,9 +1819,9 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingRowTotals() )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- finalRow += QString("<td%2>%1</td>")
- .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : QString());
+ finalRow += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
@@ -1844,18 +1844,18 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
- result += QString("<tr class=\"sectionfooter\"><td class=\"left\">%1&nbsp;%2</td>").arg(i18n("Total")).arg((*it_outergroup).m_displayName);
+ result += TQString("<tr class=\"sectionfooter\"><td class=\"left\">%1&nbsp;%2</td>").tqarg(i18n("Total")).tqarg((*it_outergroup).m_displayName);
unsigned column = 1;
while ( column < m_numColumns )
{
- QString lb;
+ TQString lb;
if(column != 1)
lb = leftborder;
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : QString());
+ result += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column]))
+ .tqarg(i == 0 ? lb : TQString());
}
column++;
@@ -1864,9 +1864,9 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingRowTotals() )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : QString());
+ result += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
result += "</tr>\n";
@@ -1884,19 +1884,19 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
- result += QString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
- result += QString("<tr class=\"reportfooter\"><td class=\"left\">%1</td>").arg(i18n("Grand Total"));
+ result += TQString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
+ result += TQString("<tr class=\"reportfooter\"><td class=\"left\">%1</td>").tqarg(i18n("Grand Total"));
unsigned totalcolumn = 1;
while ( totalcolumn < m_numColumns )
{
- QString lb;
+ TQString lb;
if(totalcolumn != 1)
lb = leftborder;
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn]))
- .arg(i == 0 ? lb : QString());
+ result += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn]))
+ .tqarg(i == 0 ? lb : TQString());
}
totalcolumn++;
@@ -1905,27 +1905,27 @@ QString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingRowTotals() )
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
- result += QString("<td%2>%1</td>")
- .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : QString());
+ result += TQString("<td%2>%1</td>")
+ .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
result += "</tr>\n";
}
- result += QString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
- result += QString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
+ result += TQString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
+ result += TQString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
result += "</table>\n";
return result;
}
-void PivotTable::dump( const QString& file, const QString& /* context */) const
+void PivotTable::dump( const TQString& file, const TQString& /* context */) const
{
- QFile g( file );
+ TQFile g( file );
g.open( IO_WriteOnly );
- QTextStream(&g) << renderHTML();
+ TQTextStream(&g) << renderHTML();
g.close();
}
@@ -2030,13 +2030,13 @@ void PivotTable::drawChart( KReportChartView& _view ) const
_view.setAccountSeries( accountSeries );
// Set up X axis labels (ie "abscissa" to use the technical term)
- QStringList& abscissaNames = _view.abscissaNames();
+ TQStringList& abscissaNames = _view.abscissaNames();
abscissaNames.clear();
if ( accountSeries )
{
unsigned column = 1;
while ( column < m_numColumns ) {
- abscissaNames += QString(m_columnHeadings[column++]).replace("&nbsp;", " ");
+ abscissaNames += TQString(m_columnHeadings[column++]).tqreplace("&nbsp;", " ");
}
}
else
@@ -2064,7 +2064,7 @@ void PivotTable::drawChart( KReportChartView& _view ) const
//
// Rows
//
- QString innergroupdata;
+ TQString innergroupdata;
PivotInnerGroup::const_iterator it_row = (*it_innergroup).begin();
while ( it_row != (*it_innergroup).end() )
{
@@ -2213,14 +2213,14 @@ void PivotTable::drawChart( KReportChartView& _view ) const
{
// the first column of report which represents a date in the future, or one past the
// last column if all columns are in the present day. Only relevant when accountSeries==true
- unsigned futurecolumn = columnValue(QDate::currentDate()) - columnValue(m_beginDate) + 1;
+ unsigned futurecolumn = columnValue(TQDate::tqcurrentDate()) - columnValue(m_beginDate) + 1;
// kdDebug(2) << "futurecolumn: " << futurecolumn << endl;
// kdDebug(2) << "m_numColumns: " << m_numColumns << endl;
// Properties for line charts whose values are in the future.
KDChartPropertySet propSetFutureValue("future value", KDChartParams::KDCHART_PROPSET_NORMAL_DATA);
- propSetFutureValue.setLineStyle(KDChartPropertySet::OwnID, Qt::DotLine);
+ propSetFutureValue.setLineStyle(KDChartPropertySet::OwnID, TQt::DotLine);
const int idPropFutureValue = _view.params()->registerProperties(propSetFutureValue);
for(int col = futurecolumn; col < m_numColumns; ++col) {
@@ -2270,17 +2270,17 @@ unsigned PivotTable::drawChartRowSet(unsigned rowNum, const bool seriesTotals, c
return ++rowNum;
}
-QString PivotTable::coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol, int prec) const
+TQString PivotTable::coloredAmount(const MyMoneyMoney& amount, const TQString& currencySymbol, int prec) const
{
- QString result;
+ TQString result;
if( amount.isNegative() )
- result += QString("<font color=\"rgb(%1,%2,%3)\">")
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().red())
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().green())
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().blue());
+ result += TQString("<font color=\"rgb(%1,%2,%3)\">")
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().red())
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().green())
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().blue());
result += amount.formatMoney(currencySymbol, prec);
if( amount.isNegative() )
- result += QString("</font>");
+ result += TQString("</font>");
return result;
}
@@ -2335,10 +2335,10 @@ void PivotTable::calculateForecast(void)
forecast.setIncludeUnusedAccounts(true);
//setup forecast dates
- if(m_endDate > QDate::currentDate()) {
+ if(m_endDate > TQDate::tqcurrentDate()) {
forecast.setForecastEndDate(m_endDate);
- forecast.setForecastStartDate(QDate::currentDate());
- forecast.setForecastDays(QDate::currentDate().daysTo(m_endDate));
+ forecast.setForecastStartDate(TQDate::tqcurrentDate());
+ forecast.setForecastDays(TQDate::tqcurrentDate().daysTo(m_endDate));
} else {
forecast.setForecastStartDate(m_beginDate);
forecast.setForecastEndDate(m_endDate);
@@ -2346,7 +2346,7 @@ void PivotTable::calculateForecast(void)
}
//adjust history dates if beginning date is before today
- if(m_beginDate < QDate::currentDate()) {
+ if(m_beginDate < TQDate::tqcurrentDate()) {
forecast.setHistoryEndDate(m_beginDate.addDays(-1));
forecast.setHistoryStartDate(forecast.historyEndDate().addDays(-forecast.accountsCycle()*forecast.forecastCycles()));
}
@@ -2365,7 +2365,7 @@ void PivotTable::calculateForecast(void)
while ( it_row != (*it_innergroup).end() )
{
unsigned column = 1;
- QDate forecastDate = m_beginDate;
+ TQDate forecastDate = m_beginDate;
//check whether columns are days or months
if(m_config_f.isColumnsAreDays())
{
@@ -2380,7 +2380,7 @@ void PivotTable::calculateForecast(void)
while(column < m_numColumns) {
//set forecastDate to last day of each month
//TODO we really need a date manipulation util
- forecastDate = QDate(forecastDate.year(), forecastDate.month(), forecastDate.daysInMonth());
+ forecastDate = TQDate(forecastDate.year(), forecastDate.month(), forecastDate.daysInMonth());
//check that forecastDate is not over ending date
if(forecastDate > m_endDate)
forecastDate = m_endDate;
@@ -2466,9 +2466,9 @@ void PivotTable::calculateMovingAverage (void)
while(column < m_numColumns) {
MyMoneyMoney totalPrice = MyMoneyMoney( 0, 1 );
- QDate averageStart = columnDate(column).addDays(-delta);
- QDate averageEnd = columnDate(column).addDays(delta);
- for(QDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) {
+ TQDate averageStart = columnDate(column).addDays(-delta);
+ TQDate averageEnd = columnDate(column).addDays(delta);
+ for(TQDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) {
if(m_config_f.isConvertCurrency()) {
totalPrice += it_row.key().deepCurrencyPrice(averageDate) * it_row.key().baseCurrencyPrice(averageDate);
} else {
@@ -2489,28 +2489,28 @@ void PivotTable::calculateMovingAverage (void)
} else {
//if columns are months
while(column < m_numColumns) {
- QDate averageStart = columnDate(column);
+ TQDate averageStart = columnDate(column);
//set the right start date depending on the column type
switch(m_config_f.columnType()) {
case MyMoneyReport::eYears:
{
- averageStart = QDate(columnDate(column).year(), 1, 1);
+ averageStart = TQDate(columnDate(column).year(), 1, 1);
break;
}
case MyMoneyReport::eBiMonths:
{
- averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
+ averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
break;
}
case MyMoneyReport::eQuarters:
{
- averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
+ averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1).addMonths(-1);
break;
}
case MyMoneyReport::eMonths:
{
- averageStart = QDate(columnDate(column).year(), columnDate(column).month(), 1);
+ averageStart = TQDate(columnDate(column).year(), columnDate(column).month(), 1);
break;
}
case MyMoneyReport::eWeeks:
@@ -2524,8 +2524,8 @@ void PivotTable::calculateMovingAverage (void)
//gather the actual data and calculate the average
MyMoneyMoney totalPrice = MyMoneyMoney(0, 1);
- QDate averageEnd = columnDate(column);
- for(QDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) {
+ TQDate averageEnd = columnDate(column);
+ for(TQDate averageDate = averageStart; averageDate <= averageEnd; averageDate = averageDate.addDays(1)) {
if(m_config_f.isConvertCurrency()) {
totalPrice += it_row.key().deepCurrencyPrice(averageDate) * it_row.key().baseCurrencyPrice(averageDate);
} else {
@@ -2582,15 +2582,15 @@ void PivotTable::includeInvestmentSubAccounts()
// if we're not in expert mode, we need to make sure
// that all stock accounts for the selected investment
// account are also selected
- QStringList accountList;
+ TQStringList accountList;
if(m_config_f.accounts(accountList)) {
if(!KMyMoneyGlobalSettings::expertMode()) {
- QStringList::const_iterator it_a, it_b;
+ TQStringList::const_iterator it_a, it_b;
for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) {
MyMoneyAccount acc = MyMoneyFile::instance()->account(*it_a);
if(acc.accountType() == MyMoneyAccount::Investment) {
for(it_b = acc.accountList().begin(); it_b != acc.accountList().end(); ++it_b) {
- if(!accountList.contains(*it_b)) {
+ if(!accountList.tqcontains(*it_b)) {
m_config_f.addAccount(*it_b);
}
}