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.cpp224
1 files changed, 112 insertions, 112 deletions
diff --git a/kmymoney2/reports/pivottable.cpp b/kmymoney2/reports/pivottable.cpp
index be8c05d..bf048cb 100644
--- a/kmymoney2/reports/pivottable.cpp
+++ b/kmymoney2/reports/pivottable.cpp
@@ -19,11 +19,11 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <layout.h>
+#include <tqlayout.h>
#include <tqdatetime.h>
#include <tqregexp.h>
#include <tqdragobject.h>
-#include <clipboard.h>
+#include <tqclipboard.h>
#include <tqapplication.h>
#include <tqprinter.h>
#include <tqpainter.h>
@@ -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(TQString("Found %1 matching transactions").arg(transactions.count()));
+ DEBUG_OUTPUT(TQString("Found %1 matching transactions").tqarg(transactions.count()));
// Include scheduled transactions if required
@@ -230,8 +230,8 @@ void PivotTable::init(void)
while ( it_date != paymentDates.end() )
{
//if the payment occurs in the past, enter it tomorrow
- if(TQDate::currentDate() >= *it_date) {
- tx.setPostDate(TQDate::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(TQString("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;
}
@@ -286,8 +286,8 @@ void PivotTable::init(void)
TQDate dueDate = sched.nextDueDate();
//if the payment is overdue, use current date
- if(dueDate < TQDate::currentDate())
- dueDate = TQDate::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));
@@ -468,7 +468,7 @@ void PivotTable::collapseColumns(void)
void PivotTable::accumulateColumn(unsigned destcolumn, unsigned sourcecolumn)
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- DEBUG_OUTPUT(TQString("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(TQString("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(TQString("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(TQString("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(TQString("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();
}
@@ -562,10 +562,10 @@ void PivotTable::calculateColumnHeadings(void)
if (((dow % columnpitch) == 0) || (day == m_endDate))
{
m_columnHeadings.append(TQString("%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()));
+ .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);
@@ -626,7 +626,7 @@ void PivotTable::createAccountRows(void)
// and if the report includes this account
if ( m_config_f.includes( *it_account ) )
{
- DEBUG_OUTPUT(TQString("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)
TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
@@ -677,13 +677,13 @@ void PivotTable::calculateOpeningBalances( void )
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(TQString("DOES NOT INCLUDE account %1").arg(account.name()));
+ DEBUG_OUTPUT(TQString("DOES NOT INCLUDE account %1").tqarg(account.name()));
++it_account;
continue;
}
}
- DEBUG_OUTPUT(TQString("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)
TQString outergroup = KMyMoneyUtils::accountTypeToString(account.accountGroup());
@@ -699,7 +699,7 @@ void PivotTable::calculateOpeningBalances( void )
}
else
{
- DEBUG_OUTPUT(TQString("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(TQString("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(TQString("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 );
@@ -787,9 +787,9 @@ MyMoneyMoney PivotTable::cellBalance(const TQString& outergroup, const ReportAcc
TQString innergroup( row.topParentName() );
if ( m_numColumns <= _column )
- throw new MYMONEYEXCEPTION(TQString("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(TQString("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 TQString& outergroup, const ReportAcc
while ( column < _column)
{
if ( m_grid[outergroup][innergroup][row][eActual].count() <= column )
- throw new MYMONEYEXCEPTION(TQString("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);
@@ -831,7 +831,7 @@ void PivotTable::calculateBudgetMapping( void )
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() == TQDate::currentDate().year() ) {
+ if( (*budgets_it).budgetStart().year() == TQDate::tqcurrentDate().year() ) {
budget = file->budget( (*budgets_it).id());
break;
}
@@ -1009,7 +1009,7 @@ void PivotTable::convertToBaseCurrency( void )
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(TQString("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()));
TQDate valuedate = columnDate(column);
@@ -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) ,TQString("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,7 +1058,7 @@ void PivotTable::convertToDeepCurrency( void )
while ( column < m_numColumns )
{
if ( it_row.data()[eActual].count() <= column )
- throw new MYMONEYEXCEPTION(TQString("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()));
TQDate valuedate = columnDate(column);
@@ -1085,7 +1085,7 @@ void PivotTable::convertToDeepCurrency( void )
it_row.data()[ePrice][column] = PivotCell(priceValue.convert(10000));
}
- DEBUG_OUTPUT_IF(conversionfactor != MyMoneyMoney(1,1) ,TQString("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(TQString("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(TQString("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(TQString("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(TQString("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(TQString("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(TQString("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];
@@ -1228,7 +1228,7 @@ void PivotTable::calculateTotals( void )
void PivotTable::assignCell( const TQString& outergroup, const ReportAccount& _row, unsigned column, MyMoneyMoney value, bool budget, bool stockSplit )
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- DEBUG_OUTPUT(TQString("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
@@ -1252,9 +1252,9 @@ void PivotTable::assignCell( const TQString& outergroup, const ReportAccount& _r
TQString innergroup( row.topParentName() );
if ( m_numColumns <= column )
- throw new MYMONEYEXCEPTION(TQString("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(TQString("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
@@ -1281,19 +1281,19 @@ void PivotTable::createRow( const TQString& outergroup, const ReportAccount& row
if ( ! m_grid.contains(outergroup) )
{
- DEBUG_OUTPUT(TQString("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) )
{
- DEBUG_OUTPUT(TQString("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) )
{
- DEBUG_OUTPUT(TQString("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() )
@@ -1325,11 +1325,11 @@ TQString PivotTable::renderCSV( void ) const
// Report Title
//
- TQString result = TQString("\"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 @@ TQString PivotTable::renderCSV( void ) const
unsigned column = 1;
while ( column < m_numColumns )
- result += TQString(",%1").arg(TQString(m_columnHeadings[column++]));
+ result += TQString(",%1").tqarg(TQString(m_columnHeadings[column++]));
if ( m_config_f.isShowingRowTotals() )
- result += TQString(",%1").arg(i18n("Total"));
+ result += TQString(",%1").tqarg(i18n("Total"));
result += "\n";
@@ -1396,14 +1396,14 @@ TQString 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 += TQString(",\"%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 += TQString(",\"%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));
}
//
@@ -1417,7 +1417,7 @@ TQString PivotTable::renderCSV( void ) const
// 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 += TQString(" (%1)").arg(rowname.currencyId());
+ innergroupdata += TQString(" (%1)").tqarg(rowname.currencyId());
innergroupdata += "\"";
@@ -1461,7 +1461,7 @@ TQString PivotTable::renderCSV( void ) const
finalRow = "\"" + TQString().fill(' ',rowname.hierarchyDepth() - 1) + rowname.name();
if (!m_config_f.isConvertCurrency() && rowname.isForeignCurrency() )
- finalRow += TQString(" (%1)").arg(rowname.currencyId());
+ finalRow += TQString(" (%1)").tqarg(rowname.currencyId());
finalRow += "\"";
}
@@ -1477,14 +1477,14 @@ TQString PivotTable::renderCSV( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
isUsed |= (*it_innergroup).m_total[ m_rowTypeList[i] ][column].isUsed();
- finalRow += TQString(",\"%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 += TQString(",\"%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 @@ TQString PivotTable::renderCSV( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
- result += TQString("%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 += TQString(",\"%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 += TQString(",\"%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 @@ TQString PivotTable::renderCSV( void ) const
unsigned totalcolumn = 1;
while ( totalcolumn < m_numColumns ) {
for(unsigned i = 0; i < m_rowTypeList.size(); ++i)
- result += TQString(",\"%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 += TQString(",\"%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";
@@ -1553,26 +1553,26 @@ TQString PivotTable::renderHTML( void ) const
{
DEBUG_ENTER(__PRETTY_FUNCTION__);
- TQString colspan = TQString(" 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
//
- TQString result = TQString("<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 += TQString("<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 += 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 += 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 += 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");
@@ -1585,19 +1585,19 @@ TQString PivotTable::renderHTML( void ) const
// Table Header
//
result += TQString("\n\n<table class=\"report\" cellspacing=\"0\">\n"
- "<thead><tr class=\"itemheader\">\n<th>%1</th>").arg(i18n("Account"));
+ "<thead><tr class=\"itemheader\">\n<th>%1</th>").tqarg(i18n("Account"));
TQString headerspan;
int span = m_rowTypeList.size();
- headerspan = TQString(" colspan=\"%1\"").arg(span);
+ headerspan = TQString(" colspan=\"%1\"").tqarg(span);
unsigned column = 1;
while ( column < m_numColumns )
- result += TQString("<th%1>%2</th>").arg(headerspan,TQString(m_columnHeadings[column++]).replace(TQRegExp(" "),"<br>"));
+ result += TQString("<th%1>%2</th>").tqarg(headerspan,TQString(m_columnHeadings[column++]).replace(TQRegExp(" "),"<br>"));
if ( m_config_f.isShowingRowTotals() )
- result += TQString("<th%1>%2</th>").arg(headerspan).arg(i18n("Total"));
+ result += TQString("<th%1>%2</th>").tqarg(headerspan).tqarg(i18n("Total"));
result += "</tr></thead>\n";
@@ -1617,16 +1617,16 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>")
- .arg(i18n( m_columnTypeHeaderList[i] ))
- .arg(i == 0 ? lb : TQString() );
+ .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 += TQString("<td%2>%1</td>")
- .arg(i18n( m_columnTypeHeaderList[i] ))
- .arg(i == 0 ? leftborder : TQString() );
+ .tqarg(i18n( m_columnTypeHeaderList[i] ))
+ .tqarg(i == 0 ? leftborder : TQString() );
}
}
result += "</tr>";
@@ -1667,7 +1667,7 @@ TQString PivotTable::renderHTML( void ) const
// Outer Group Header
//
- result += TQString("<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 )
@@ -1704,8 +1704,8 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
rowdata += TQString("<td%2>%1</td>")
- .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : TQString());
+ .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column]))
+ .tqarg(i == 0 ? lb : TQString());
isUsed |= it_row.data()[ m_rowTypeList[i] ][column].isUsed();
}
@@ -1717,8 +1717,8 @@ TQString PivotTable::renderHTML( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
rowdata += TQString("<td%2>%1</td>")
- .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : TQString());
+ .tqarg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
@@ -1731,12 +1731,12 @@ TQString PivotTable::renderHTML( void ) const
// don't show closed accounts if they have not been used
if(!rowname.isClosed() || isUsed) {
innergroupdata += TQString("<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(TQRegExp(" "), "&nbsp;"))
- .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").arg(rowname.currency().id()));
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg(rowname.isTopLevel() ? " id=\"topparent\"" : "")
+ .tqarg("") //.tqarg((*it_row).m_total.isZero() ? colspan : "") // colspan the distance if this row will be blank
+ .tqarg(rowname.hierarchyDepth() - 1)
+ .tqarg(rowname.name().replace(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
@@ -1766,8 +1766,8 @@ TQString PivotTable::renderHTML( void ) const
{
// Start the TOTALS row
finalRow = TQString("<tr class=\"row-%1\" id=\"subtotal\"><td class=\"left\">&nbsp;&nbsp;%2</td>")
- .arg(rownum & 0x01 ? "even" : "odd")
- .arg(i18n("Total"));
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg(i18n("Total"));
// don't suppress display of totals
isUsed = true;
}
@@ -1788,11 +1788,11 @@ TQString PivotTable::renderHTML( void ) const
ReportAccount rowname = (*it_innergroup).begin().key();
isUsed |= !rowname.isClosed();
finalRow = TQString("<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(TQRegExp(" "), "&nbsp;"))
- .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?TQString():TQString(" (%1)").arg(rowname.currency().id()));
+ .tqarg(rownum & 0x01 ? "even" : "odd")
+ .tqarg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" )
+ .tqarg(rowname.hierarchyDepth() - 1)
+ .tqarg(rowname.name().replace(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
@@ -1808,8 +1808,8 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
finalRow += TQString("<td%2>%1</td>")
- .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : TQString());
+ .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();
}
@@ -1820,8 +1820,8 @@ TQString PivotTable::renderHTML( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
finalRow += TQString("<td%2>%1</td>")
- .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : TQString());
+ .tqarg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
@@ -1844,7 +1844,7 @@ TQString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
- result += TQString("<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 )
{
@@ -1854,8 +1854,8 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>")
- .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column]))
- .arg(i == 0 ? lb : TQString());
+ .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column]))
+ .tqarg(i == 0 ? lb : TQString());
}
column++;
@@ -1865,8 +1865,8 @@ TQString PivotTable::renderHTML( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>")
- .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : TQString());
+ .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
result += "</tr>\n";
@@ -1885,7 +1885,7 @@ TQString PivotTable::renderHTML( void ) const
if ( m_config_f.isShowingColumnTotals() )
{
result += TQString("<tr class=\"spacer\"><td>&nbsp;</td></tr>\n");
- result += TQString("<tr class=\"reportfooter\"><td class=\"left\">%1</td>").arg(i18n("Grand Total"));
+ result += TQString("<tr class=\"reportfooter\"><td class=\"left\">%1</td>").tqarg(i18n("Grand Total"));
unsigned totalcolumn = 1;
while ( totalcolumn < m_numColumns )
{
@@ -1895,8 +1895,8 @@ TQString PivotTable::renderHTML( void ) const
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>")
- .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn]))
- .arg(i == 0 ? lb : TQString());
+ .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn]))
+ .tqarg(i == 0 ? lb : TQString());
}
totalcolumn++;
@@ -1906,8 +1906,8 @@ TQString PivotTable::renderHTML( void ) const
{
for(unsigned i = 0; i < m_rowTypeList.size(); ++i) {
result += TQString("<td%2>%1</td>")
- .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total))
- .arg(i == 0 ? leftborder : TQString());
+ .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total))
+ .tqarg(i == 0 ? leftborder : TQString());
}
}
@@ -2213,7 +2213,7 @@ 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(TQDate::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;
@@ -2275,9 +2275,9 @@ TQString PivotTable::coloredAmount(const MyMoneyMoney& amount, const TQString& c
TQString result;
if( amount.isNegative() )
result += TQString("<font color=\"rgb(%1,%2,%3)\">")
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().red())
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().green())
- .arg(KMyMoneyGlobalSettings::listNegativeValueColor().blue());
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().red())
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().green())
+ .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().blue());
result += amount.formatMoney(currencySymbol, prec);
if( amount.isNegative() )
result += TQString("</font>");
@@ -2335,10 +2335,10 @@ void PivotTable::calculateForecast(void)
forecast.setIncludeUnusedAccounts(true);
//setup forecast dates
- if(m_endDate > TQDate::currentDate()) {
+ if(m_endDate > TQDate::tqcurrentDate()) {
forecast.setForecastEndDate(m_endDate);
- forecast.setForecastStartDate(TQDate::currentDate());
- forecast.setForecastDays(TQDate::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 < TQDate::currentDate()) {
+ if(m_beginDate < TQDate::tqcurrentDate()) {
forecast.setHistoryEndDate(m_beginDate.addDays(-1));
forecast.setHistoryStartDate(forecast.historyEndDate().addDays(-forecast.accountsCycle()*forecast.forecastCycles()));
}