From fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 5 Jul 2011 06:00:29 +0000 Subject: TQt4 port kmymoney This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmymoney2/reports/kreportchartview.cpp | 36 +-- kmymoney2/reports/kreportchartview.h | 16 +- kmymoney2/reports/listtable.cpp | 172 +++++----- kmymoney2/reports/listtable.h | 34 +- kmymoney2/reports/objectinfotable.cpp | 36 +-- kmymoney2/reports/objectinfotable.h | 4 +- kmymoney2/reports/pivotgrid.cpp | 26 +- kmymoney2/reports/pivotgrid.h | 24 +- kmymoney2/reports/pivotgridtest.cpp | 30 +- kmymoney2/reports/pivottable.cpp | 536 ++++++++++++++++---------------- kmymoney2/reports/pivottable.h | 42 +-- kmymoney2/reports/pivottabletest.cpp | 322 +++++++++---------- kmymoney2/reports/querytable.cpp | 192 ++++++------ kmymoney2/reports/querytable.h | 22 +- kmymoney2/reports/querytabletest.cpp | 212 ++++++------- kmymoney2/reports/querytabletest.h | 4 +- kmymoney2/reports/reportaccount.cpp | 94 +++--- kmymoney2/reports/reportaccount.h | 54 ++-- kmymoney2/reports/reportdebug.h | 14 +- kmymoney2/reports/reportstestcommon.cpp | 186 +++++------ kmymoney2/reports/reportstestcommon.h | 102 +++--- kmymoney2/reports/reporttable.h | 6 +- 22 files changed, 1082 insertions(+), 1082 deletions(-) (limited to 'kmymoney2/reports') diff --git a/kmymoney2/reports/kreportchartview.cpp b/kmymoney2/reports/kreportchartview.cpp index 21b08fa..e9c9060 100644 --- a/kmymoney2/reports/kreportchartview.cpp +++ b/kmymoney2/reports/kreportchartview.cpp @@ -34,12 +34,12 @@ using namespace reports; -KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChartWidget(parent,name) +KReportChartView::KReportChartView( TQWidget* tqparent, const char* name ): KDChartWidget(tqparent,name) { // ******************************************************************** // Set KMyMoney's Chart Parameter Defaults // ******************************************************************** - this->setPaletteBackgroundColor( Qt::white ); + this->setPaletteBackgroundColor( TQt::white ); KDChartParams* _params = new KDChartParams(); _params->setChartType( KDChartParams::Line ); @@ -49,7 +49,7 @@ KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChart /** // use line marker, but only circles. _params->setLineMarker( true ); - _params->setLineMarkerSize( QSize(8,8) ); + _params->setLineMarkerSize( TQSize(8,8) ); _params->setLineMarkerStyle( 0, KDChartParams::LineMarkerCircle ); _params->setLineMarkerStyle( 1, KDChartParams::LineMarkerCircle ); _params->setLineMarkerStyle( 2, KDChartParams::LineMarkerCircle ); @@ -90,21 +90,21 @@ KReportChartView::KReportChartView( QWidget* parent, const char* name ): KDChart // ******************************************************************** // Tooltip Setup // ******************************************************************** - label = new QLabel( this ); + label = new TQLabel( this ); label->hide(); - // mouse tracking on will force the mouseMoveEvent() method to be called from Qt + // mouse tracking on will force the mouseMoveEvent() method to be called from TQt label->setMouseTracking( true ); - label->setFrameStyle( QFrame::PopupPanel | QFrame::Raised ); - label->setAlignment( AlignRight ); + label->setFrameStyle( TQFrame::PopupPanel | TQFrame::Raised ); + label->tqsetAlignment( AlignRight ); label->setAutoResize( true ); } /** * This function implements mouseMoveEvents */ -void KReportChartView::mouseMoveEvent( QMouseEvent* event ) +void KReportChartView::mouseMoveEvent( TQMouseEvent* event ) { - QPoint translate, pos; // some movement helpers + TQPoint translate, pos; // some movement helpers uint dataset; // the current dataset (eg. category) uint datasets; // the total number of datasets double value; // the value of the region @@ -121,10 +121,10 @@ void KReportChartView::mouseMoveEvent( QMouseEvent* event ) // ..by going through every data region and checking whether it // contains the mouse pointer KDChartDataRegion* current = 0; - QPtrListIterator < KDChartDataRegion > it( *(this->dataRegions()) ); + TQPtrListIterator < KDChartDataRegion > it( *(this->dataRegions()) ); while ( ( current = it.current() ) ) { ++it; - if ( current->contains( event->pos() ) ) + if ( current->tqcontains( event->pos() ) ) { // we found the data region that contains the mouse value = this->data()->cellVal(current->row, current->col).toDouble(); @@ -150,18 +150,18 @@ void KReportChartView::mouseMoveEvent( QMouseEvent* event ) if(datasets > 1) { // set the tooltip text - label->setText(QString("

%1

%2
(%3\%)") - .arg(this->params()->legendText( dataset )) - .arg(value, 0, 'f', 2) - .arg(pivot_sum, 0, 'f', 2) + label->setText(TQString("

%1

%2
(%3\%)") + .tqarg(this->params()->legendText( dataset )) + .tqarg(value, 0, 'f', 2) + .tqarg(pivot_sum, 0, 'f', 2) ); } else // if there is only one dataset, don't show percentage { // set the tooltip text - label->setText(QString("

%1

%2") - .arg(this->params()->legendText( dataset )) - .arg(value, 0, 'f', 2) + label->setText(TQString("

%1

%2") + .tqarg(this->params()->legendText( dataset )) + .tqarg(value, 0, 'f', 2) ); } diff --git a/kmymoney2/reports/kreportchartview.h b/kmymoney2/reports/kreportchartview.h index a1bf786..d04e291 100644 --- a/kmymoney2/reports/kreportchartview.h +++ b/kmymoney2/reports/kreportchartview.h @@ -34,7 +34,7 @@ #undef new #endif -#include +#include #include #include #include @@ -51,11 +51,11 @@ namespace reports { class KReportChartView: public KDChartWidget { public: - KReportChartView( QWidget* parent, const char* name ); + KReportChartView( TQWidget* tqparent, const char* name ); ~KReportChartView() {} static bool implemented(void) { return true; } void setNewData( const KDChartTableData& newdata ) { this->setData(new KDChartTableData(newdata)); } - QStringList& abscissaNames(void) { return m_abscissaNames; } + TQStringList& abscissaNames(void) { return m_abscissaNames; } void refreshLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosBottom,&m_abscissaNames,0); } void setProperty(int row, int col, int id); // void setCircularLabels(void) { this->params()->setAxisLabelStringParams( KDChartAxisParams::AxisPosCircular,&m_abscissaNames,0); } @@ -64,14 +64,14 @@ public: bool getAccountSeries(void) {return _accountSeries; } protected: - virtual void mouseMoveEvent( QMouseEvent* event ); + virtual void mouseMoveEvent( TQMouseEvent* event ); private: - QStringList m_abscissaNames; + TQStringList m_abscissaNames; bool _accountSeries; // label to display when hovering on a data region - QLabel *label; + TQLabel *label; }; } // end namespace reports @@ -80,10 +80,10 @@ private: namespace reports { -class KReportChartView : public QWidget +class KReportChartView : public TQWidget { public: - KReportChartView( QWidget* parent, const char* name ): QWidget(parent,name) {} + KReportChartView( TQWidget* tqparent, const char* name ): TQWidget(tqparent,name) {} ~KReportChartView() {} static bool implemented(void) { return false; } }; diff --git a/kmymoney2/reports/listtable.cpp b/kmymoney2/reports/listtable.cpp index 797b392..16db407 100644 --- a/kmymoney2/reports/listtable.cpp +++ b/kmymoney2/reports/listtable.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -43,7 +43,7 @@ namespace reports { - QStringList ListTable::TableRow::m_sortCriteria; + TQStringList ListTable::TableRow::m_sortCriteria; // **************************************************************************** // @@ -54,7 +54,7 @@ namespace reports { class GroupIterator { public: - GroupIterator ( const QString& _group, const QString& _subtotal, unsigned _depth ) : m_depth ( _depth ), m_groupField ( _group ), m_subtotalField ( _subtotal ) {} + GroupIterator ( const TQString& _group, const TQString& _subtotal, unsigned _depth ) : m_depth ( _depth ), m_groupField ( _group ), m_subtotalField ( _subtotal ) {} GroupIterator ( void ) {} void update ( const ListTable::TableRow& _row ) { @@ -73,20 +73,20 @@ namespace reports { const MyMoneyMoney& subtotal ( void ) const { return m_previousSubtotal; } const MyMoneyMoney& currenttotal ( void ) const { return m_currentSubtotal; } unsigned depth ( void ) const { return m_depth; } - const QString& name ( void ) const { return m_currentGroup; } - const QString& oldName ( void ) const { return m_previousGroup; } - const QString& groupField ( void ) const { return m_groupField; } - const QString& subtotalField ( void ) const { return m_subtotalField; } + const TQString& name ( void ) const { return m_currentGroup; } + const TQString& oldName ( void ) const { return m_previousGroup; } + const TQString& groupField ( void ) const { return m_groupField; } + const TQString& subtotalField ( void ) const { return m_subtotalField; } // ***DV*** HACK make the currentGroup test different but look the same void force ( void ) { m_currentGroup += " "; } private: MyMoneyMoney m_currentSubtotal; MyMoneyMoney m_previousSubtotal; unsigned m_depth; - QString m_currentGroup; - QString m_previousGroup; - QString m_groupField; - QString m_subtotalField; + TQString m_currentGroup; + TQString m_previousGroup; + TQString m_groupField; + TQString m_subtotalField; }; // **************************************************************************** @@ -99,7 +99,7 @@ namespace reports { { bool result = false; - QStringList::const_iterator it_criterion = m_sortCriteria.begin(); + TQStringList::const_iterator it_criterion = m_sortCriteria.begin(); while ( it_criterion != m_sortCriteria.end() ) { if ( this->operator[] ( *it_criterion ) < _compare[ *it_criterion ] ) @@ -145,28 +145,28 @@ namespace reports { { } - void ListTable::render ( QString& result, QString& csv ) const + void ListTable::render ( TQString& result, TQString& csv ) const { MyMoneyMoney grandtotal; MyMoneyFile* file = MyMoneyFile::instance(); result = ""; csv = ""; - result += QString ( "

%1

\n" ).arg ( m_config.name() ); + result += TQString ( "

%1

\n" ).arg ( m_config.name() ); csv += "\"Report: " + m_config.name() + "\"\n"; //actual dates of the report - result += QString("
"); + result += TQString("
"); if(!m_config.fromDate().isNull()) { - result += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config.toDate(), true)); - result += QString("
\n"); - result += QString("
 
\n"); + result += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config.toDate(), true)); + result += TQString("
\n"); + result += TQString("
 
\n"); - csv += i18n("Report date range", "%1 through %2").arg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).arg(KGlobal::locale()->formatDate(m_config.toDate(), true)); - csv += QString("\n"); + csv += i18n("Report date range", "%1 through %2").tqarg(KGlobal::locale()->formatDate(m_config.fromDate(), true)).tqarg(KGlobal::locale()->formatDate(m_config.toDate(), true)); + csv += TQString("\n"); } - result += QString ( "
" ); + result += TQString ( "
" ); if ( m_config.isConvertCurrency() ) { result += i18n ( "All currencies converted to %1" ).arg ( file->baseCurrency().name() ); @@ -177,23 +177,23 @@ namespace reports { result += i18n ( "All values shown in %1 unless otherwise noted" ).arg ( file->baseCurrency().name() ); csv += i18n ( "All values shown in %1 unless otherwise noted\n" ).arg ( file->baseCurrency().name() ); } - result += QString ( "
\n" ); - result += QString ( "
 
\n" ); + result += TQString ( "
\n" ); + result += TQString ( "
 
\n" ); // retrieve the configuration parameters from the report definition. // the things that we care about for query reports are: // how to group the rows, what columns to display, and what field // to subtotal on - QStringList groups = QStringList::split ( ",", m_group ); - QStringList columns = QStringList::split ( ",", m_columns ); + TQStringList groups = TQStringList::split ( ",", m_group ); + TQStringList columns = TQStringList::split ( ",", m_columns ); columns += m_subtotal; - QStringList postcolumns = QStringList::split ( ",", m_postcolumns ); + TQStringList postcolumns = TQStringList::split ( ",", m_postcolumns ); columns += postcolumns; // // Table header // - QMap i18nHeaders; + TQMap i18nHeaders; i18nHeaders["postdate"] = i18n ( "Date" ); i18nHeaders["value"] = i18n ( "Amount" ); i18nHeaders["number"] = i18n ( "Num" ); @@ -246,24 +246,24 @@ namespace reports { i18nHeaders["currentbalance"] = i18n ( "Current Balance" ); // the list of columns which represent money, so we can display them correctly - QStringList moneyColumns = QStringList::split ( ",", "value,shares,price,latestprice,netinvvalue,buys,sells,cashincome,reinvestincome,startingbal,fees,interest,payment,balance,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,loanamount,periodicpayment,finalpayment,currentbalance" ); + TQStringList moneyColumns = TQStringList::split ( ",", "value,shares,price,latestprice,netinvvalue,buys,sells,cashincome,reinvestincome,startingbal,fees,interest,payment,balance,balancewarning,maxbalancelimit,creditwarning,maxcreditlimit,loanamount,periodicpayment,finalpayment,currentbalance" ); // the list of columns which represent shares, which is like money except the // transaction currency will not be displayed - QStringList sharesColumns = QStringList::split ( ",", "shares" ); + TQStringList sharesColumns = TQStringList::split ( ",", "shares" ); // the list of columns which represent a percentage, so we can display them correctly - QStringList percentColumns = QStringList::split ( ",", "return,returninvestment,interestrate" ); + TQStringList percentColumns = TQStringList::split ( ",", "return,returninvestment,interestrate" ); // the list of columns which represent dates, so we can display them correctly - QStringList dateColumns = QStringList::split ( ",", "postdate,entrydate,nextduedate,openingdate,nextinterestchange" ); + TQStringList dateColumns = TQStringList::split ( ",", "postdate,entrydate,nextduedate,openingdate,nextinterestchange" ); result += "\n"; - QStringList::const_iterator it_column = columns.begin(); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - QString i18nName = i18nHeaders[*it_column]; + TQString i18nName = i18nHeaders[*it_column]; if ( i18nName.isEmpty() ) i18nName = *it_column; result += ""; @@ -286,8 +286,8 @@ namespace reports { // header. The group iterator keeps track of a subtotal also. int depth = 1; - QValueList groupIteratorList; - QStringList::const_iterator it_grouplevel = groups.begin(); + TQValueList groupIteratorList; + TQStringList::const_iterator it_grouplevel = groups.begin(); while ( it_grouplevel != groups.end() ) { groupIteratorList += GroupIterator ( ( *it_grouplevel ), m_subtotal, depth++ ); @@ -302,7 +302,7 @@ namespace reports { // ***DV*** MyMoneyMoney startingBalance; - for ( QValueList::const_iterator it_row = m_rows.begin(); + for ( TQValueList::const_iterator it_row = m_rows.begin(); it_row != m_rows.end(); ++it_row ) { @@ -310,7 +310,7 @@ namespace reports { // this could be overridden using the "fraction" element of a row for each row. // Currently (2008-02-21) this override is not used at all (ipwizard) int fraction = file->baseCurrency().smallestAccountFraction(); - if ( ( *it_row ).find ( "fraction" ) != ( *it_row ).end() ) + if ( ( *it_row ).tqfind ( "fraction" ) != ( *it_row ).end() ) fraction = ( *it_row ) ["fraction"].toInt(); // @@ -328,7 +328,7 @@ namespace reports { // then we need to force all the downstream groups to get one too. // Update the group iterators with the current row value - QValueList::iterator it_group = groupIteratorList.begin(); + TQValueList::iterator it_group = groupIteratorList.begin(); while ( it_group != groupIteratorList.end() ) { ( *it_group ).update ( *it_row ); @@ -347,17 +347,17 @@ namespace reports { grandtotal += ( *it_group ).subtotal(); grandtotal = grandtotal.convert(fraction); - QString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); - QString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); + TQString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); + TQString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); // ***DV*** HACK fix the side-effiect from .force() method above - QString oldName = QString ( ( *it_group ).oldName() ).stripWhiteSpace(); + TQString oldName = TQString ( ( *it_group ).oldName() ).stripWhiteSpace(); result += "" - "" "\n"; @@ -376,8 +376,8 @@ namespace reports { { row_odd = true; result += "" - "\n"; csv += "\"" + ( *it_group ).name() + "\"\n"; } @@ -390,7 +390,7 @@ namespace reports { // skip the opening and closing balance row, // if the balance column is not shown - if ( ( columns.contains ( "balance" ) == 0 ) && ( ( *it_row ) ["rank"] == "-2" ) ) + if ( ( columns.tqcontains ( "balance" ) == 0 ) && ( ( *it_row ) ["rank"] == "-2" ) ) continue; bool need_label = true; @@ -399,17 +399,17 @@ namespace reports { if ( ( * it_row ) ["rank"] == "0" ) row_odd = ! row_odd; if ( ( * it_row ) ["rank"] == "-2" ) - result += QString ( "" ).arg ( ( * it_row ) ["id"] ); + result += TQString ( "" ).arg ( ( * it_row ) ["id"] ); else if ( ( * it_row ) ["rank"] == "1" ) - result += QString ( "" ).arg ( row_odd ? "item1" : "item0" ); + result += TQString ( "" ).arg ( row_odd ? "item1" : "item0" ); else - result += QString ( "" ).arg ( row_odd ? "row-odd " : "row-even" ); + result += TQString ( "" ).arg ( row_odd ? "row-odd " : "row-even" ); - QStringList::const_iterator it_column = columns.begin(); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - QString data = ( *it_row ) [*it_column]; + TQString data = ( *it_row ) [*it_column]; // ***DV*** if ( ( * it_row ) ["rank"] == "1" ) { @@ -468,61 +468,61 @@ namespace reports { // TODO: This and the i18n headings are handled // as a set of parallel vectors. Would be much better to make a single // vector of a properties class. - if ( sharesColumns.contains ( *it_column ) ) + if ( sharesColumns.tqcontains ( *it_column ) ) { if ( data.isEmpty() ) { - result += QString ( "" ); + result += TQString ( "" ); csv += "\"\","; } else { - result += QString ( "" ).arg ( MyMoneyMoney ( data ).formatMoney ( "", 3 ) ); + result += TQString ( "" ).arg ( MyMoneyMoney ( data ).formatMoney ( "", 3 ) ); csv += "\"" + MyMoneyMoney ( data ).formatMoney ( "", 3, false ) + "\","; } } - else if ( moneyColumns.contains ( *it_column ) ) + else if ( moneyColumns.tqcontains ( *it_column ) ) { if ( data.isEmpty() ) { - result += QString ( "" ) + result += TQString ( "" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ); csv += "\"\","; } else if ( MyMoneyMoney( data ) == MyMoneyMoney::autoCalc ) { - result += QString ( "%2" ) + result += TQString ( "%2" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ) .arg (i18n("Calculated")); csv += "\""+ i18n("Calculated") +"\","; } else if ( *it_column == "price" ) { - result += QString ( "" ) + result += TQString ( "" ) .arg ( MyMoneyMoney ( data ).formatMoney ( MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision()) ) ); csv += "\"" + ( *it_row ) ["currency"] + " " + MyMoneyMoney ( data ).formatMoney ( MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision()), false ) + "\","; } else { - result += QString ( "%2 %3" ) + result += TQString ( "%2 %3" ) .arg ( ( *it_column == "value" ) ? " class=\"value\"" : "" ) .arg ( ( *it_row ) ["currency"] ) .arg ( MyMoneyMoney ( data ).formatMoney ( fraction ) ); csv += "\"" + ( *it_row ) ["currency"] + " " + MyMoneyMoney ( data ).formatMoney ( fraction, false ) + "\","; } } - else if ( percentColumns.contains ( *it_column ) ) + else if ( percentColumns.tqcontains ( *it_column ) ) { data = ( MyMoneyMoney ( data ) * MyMoneyMoney ( 100, 1 ) ).formatMoney ( fraction ); - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); csv += data + "%,"; } - else if ( dateColumns.contains ( *it_column ) ) + else if ( dateColumns.tqcontains ( *it_column ) ) { // do this before we possibly change data csv += "\"" + data + "\","; // if we have a locale() then use its date formatter if ( KGlobal::locale() && ! data.isEmpty() ) { - QDate qd = QDate::fromString ( data, Qt::ISODate ); + TQDate qd = TQDate::fromString ( data, Qt::ISODate ); data = KGlobal::locale()->formatDate ( qd, true ); } - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); } else { - result += QString ( "" ).arg ( data ); + result += TQString ( "" ).arg ( data ); csv += "\"" + data + "\","; } ++it_column; @@ -541,7 +541,7 @@ namespace reports { if ( m_config.isConvertCurrency() ) { int fraction = file->baseCurrency().smallestAccountFraction(); - QValueList::iterator it_group = groupIteratorList.fromLast(); + TQValueList::iterator it_group = groupIteratorList.fromLast(); while ( it_group != groupIteratorList.end() ) { ( *it_group ).update ( TableRow() ); @@ -552,12 +552,12 @@ namespace reports { } - QString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); - QString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); + TQString subtotal_html = ( *it_group ).subtotal().formatMoney ( fraction ); + TQString subtotal_csv = ( *it_group ).subtotal().formatMoney ( fraction, false ); result += "" - "" "\n"; csv += "\"" + i18n ( "Total" ) + " " + ( *it_group ).oldName() + "\",\"" + subtotal_csv + "\"\n"; @@ -568,12 +568,12 @@ namespace reports { // Grand total // - QString grandtotal_html = grandtotal.formatMoney ( fraction ); - QString grandtotal_csv = grandtotal.formatMoney ( fraction, false ); + TQString grandtotal_html = grandtotal.formatMoney ( fraction ); + TQString grandtotal_csv = grandtotal.formatMoney ( fraction, false ); result += "" "" "\n"; csv += "\"" + i18n ( "Grand Total" ) + "\",\"" + grandtotal_csv + "\"\n"; @@ -581,29 +581,29 @@ namespace reports { result += "
" + i18nName + "
" + + TQString::number ( columns.count() - 1 - postcolumns.count() ) + "\">" + i18n ( "Total" ) + " " + oldName + "" + subtotal_html + "
" + + "" + ( *it_group ).name() + "
%1%1%2%2%1%%1%%1%1%1%1
" + + "" + i18n ( "Total" ) + " " + ( *it_group ).oldName() + "" + subtotal_html + "
" + + "colspan=\"" + TQString::number ( columns.count() - 1 - postcolumns.count() ) + "\">" + i18n ( "Grand Total" ) + "" + grandtotal_html + "
\n"; } - QString ListTable::renderHTML ( void ) const + TQString ListTable::renderHTML ( void ) const { - QString html, csv; + TQString html, csv; render ( html, csv ); return html; } - QString ListTable::renderCSV ( void ) const + TQString ListTable::renderCSV ( void ) const { - QString html, csv; + TQString html, csv; render ( html, csv ); return csv; } - void ListTable::dump ( const QString& file, const QString& context ) const + void ListTable::dump ( const TQString& file, const TQString& context ) const { - QFile g ( file ); + TQFile g ( file ); g.open ( IO_WriteOnly ); if ( ! context.isEmpty() ) - QTextStream ( &g ) << context.arg ( renderHTML() ); + TQTextStream ( &g ) << context.arg ( renderHTML() ); else - QTextStream ( &g ) << renderHTML(); + TQTextStream ( &g ) << renderHTML(); g.close(); } @@ -612,15 +612,15 @@ namespace reports { // 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.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.addAccount(*it_b); } } diff --git a/kmymoney2/reports/listtable.h b/kmymoney2/reports/listtable.h index 5ffa64d..1397a93 100644 --- a/kmymoney2/reports/listtable.h +++ b/kmymoney2/reports/listtable.h @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,10 +54,10 @@ namespace reports { { public: ListTable ( const MyMoneyReport& ); - QString renderHTML ( void ) const; - QString renderCSV ( void ) const; + TQString renderHTML ( void ) const; + TQString renderCSV ( void ) const; void drawChart ( KReportChartView& ) const {} - void dump ( const QString& file, const QString& context = QString() ) const; + void dump ( const TQString& file, const TQString& context = TQString() ) const; void init ( void ); public: @@ -65,10 +65,10 @@ namespace reports { * Contains a single row in the table. * * Each column is a key/value pair, both strings. This class is just - * a QMap with the added ability to specify which columns you'd like to + * a TQMap with the added ability to specify which columns you'd like to * use as a sort key when you qHeapSort a list of these TableRows */ - class TableRow: public QMap + class TableRow: public TQMap { public: bool operator< ( const TableRow& ) const; @@ -76,15 +76,15 @@ namespace reports { bool operator> ( const TableRow& ) const; bool operator== ( const TableRow& ) const; - static void setSortCriteria ( const QString& _criteria ) { m_sortCriteria = QStringList::split ( ",", _criteria ); } + static void setSortCriteria ( const TQString& _criteria ) { m_sortCriteria = TQStringList::split ( ",", _criteria ); } private: - static QStringList m_sortCriteria; + static TQStringList m_sortCriteria; }; - QValueList rows() {return m_rows;}; + TQValueList rows() {return m_rows;}; protected: - void render ( QString&, QString& ) const; + void render ( TQString&, TQString& ) const; /** * If not in expert mode, include all subaccounts for each selected @@ -92,23 +92,23 @@ namespace reports { */ void includeInvestmentSubAccounts(void); - QValueList m_rows; + TQValueList m_rows; - QString m_group; + TQString m_group; /** * Comma-separated list of columns to place BEFORE the subtotal column */ - QString m_columns; + TQString m_columns; /** * Name of the subtotal column */ - QString m_subtotal; + TQString m_subtotal; /** * Comma-separated list of columns to place AFTER the subtotal column */ - QString m_postcolumns; - QString m_summarize; - QString m_propagate; + TQString m_postcolumns; + TQString m_summarize; + TQString m_propagate; MyMoneyReport m_config; diff --git a/kmymoney2/reports/objectinfotable.cpp b/kmymoney2/reports/objectinfotable.cpp index 649f6c2..37dfecc 100644 --- a/kmymoney2/reports/objectinfotable.cpp +++ b/kmymoney2/reports/objectinfotable.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -105,7 +105,7 @@ void ObjectInfoTable::init ( void ) throw new MYMONEYEXCEPTION ( "ObjectInfoTable::ObjectInfoTable(): unhandled row type" ); } - QString sort = m_group + "," + m_columns + ",id,rank"; + TQString sort = m_group + "," + m_columns + ",id,rank"; switch ( m_config.rowType() ) { case MyMoneyReport::eSchedule: @@ -133,11 +133,11 @@ void ObjectInfoTable::constructScheduleTable ( void ) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList schedules; + TQValueList schedules; schedules = file->scheduleList ( "", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, m_config.fromDate(), m_config.toDate() ); - QValueList::const_iterator it_schedule = schedules.begin(); + TQValueList::const_iterator it_schedule = schedules.begin(); while ( it_schedule != schedules.end() ) { MyMoneySchedule schedule = *it_schedule; @@ -157,7 +157,7 @@ void ObjectInfoTable::constructScheduleTable ( void ) //convert to base currency if needed MyMoneyMoney xr = MyMoneyMoney(1,1); if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); } // help for sort and render functions @@ -187,8 +187,8 @@ void ObjectInfoTable::constructScheduleTable ( void ) if ( m_config.detailLevel() == MyMoneyReport::eDetailAll ) { //get the information for all splits - QValueList splits = transaction.splits(); - QValueList::const_iterator split_it = splits.begin(); + TQValueList splits = transaction.splits(); + TQValueList::const_iterator split_it = splits.begin(); for ( ;split_it != splits.end(); split_it++ ) { TableRow splitRow; @@ -235,9 +235,9 @@ void ObjectInfoTable::constructAccountTable ( void ) //make sure we have all subaccounts of investment accounts includeInvestmentSubAccounts(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { TableRow accountRow; @@ -274,7 +274,7 @@ void ObjectInfoTable::constructAccountTable ( void ) //convert to base currency if needed if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - MyMoneyMoney xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + MyMoneyMoney xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); value = value * xr; } accountRow["currentbalance"] = value.toString(); @@ -289,9 +289,9 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { TableRow accountRow; @@ -306,7 +306,7 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) //convert to base currency if needed MyMoneyMoney xr = MyMoneyMoney(1,1); if (m_config.isConvertCurrency() && account.isForeignCurrency()) { - xr = account.baseCurrencyPrice(QDate::currentDate()).reduce(); + xr = account.baseCurrencyPrice(TQDate::tqcurrentDate()).reduce(); } accountRow["rank"] = "0"; @@ -321,7 +321,7 @@ void ObjectInfoTable::constructAccountLoanTable ( void ) accountRow["currencyname"] = (file->currency(account.currencyId())).name(); accountRow["payee"] = file->payee(loan.payee()).name(); accountRow["loanamount"] = (loan.loanAmount() * xr).toString(); - accountRow["interestrate"] = (loan.interestRate(QDate::currentDate())/MyMoneyMoney(100,1)*xr).toString(); + accountRow["interestrate"] = (loan.interestRate(TQDate::tqcurrentDate())/MyMoneyMoney(100,1)*xr).toString(); accountRow["nextinterestchange"] = loan.nextInterestChange().toString( Qt::ISODate ); accountRow["periodicpayment"] = (loan.periodicPayment() * xr).toString(); accountRow["finalpayment"] = (loan.finalPayment() * xr).toString(); @@ -342,7 +342,7 @@ MyMoneyMoney ObjectInfoTable::investmentBalance(const MyMoneyAccount& acc) MyMoneyMoney value; value = file->balance(acc.id()); - QValueList::const_iterator it_a; + TQValueList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount stock = file->account(*it_a); try { @@ -357,7 +357,7 @@ MyMoneyMoney ObjectInfoTable::investmentBalance(const MyMoneyAccount& acc) val = val.convert(acc.fraction()); value += val; } catch(MyMoneyException* e) { - qWarning("%s", (QString("cannot convert stock balance of %1 to base currency: %2").arg(stock.name(), e->what())).data()); + qWarning("%s", (TQString("cannot convert stock balance of %1 to base currency: %2").tqarg(stock.name(), e->what())).data()); delete e; } } diff --git a/kmymoney2/reports/objectinfotable.h b/kmymoney2/reports/objectinfotable.h index 0b4ab71..69489df 100644 --- a/kmymoney2/reports/objectinfotable.h +++ b/kmymoney2/reports/objectinfotable.h @@ -23,7 +23,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -72,4 +72,4 @@ private: } -#endif // QUERYREPORT_H +#endif // TQUERYREPORT_H diff --git a/kmymoney2/reports/pivotgrid.cpp b/kmymoney2/reports/pivotgrid.cpp index 9cdf9b3..6a3f773 100644 --- a/kmymoney2/reports/pivotgrid.cpp +++ b/kmymoney2/reports/pivotgrid.cpp @@ -18,16 +18,16 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -93,12 +93,12 @@ PivotCell PivotCell::stockSplit(const MyMoneyMoney& factor) return s; } -const QString PivotCell::formatMoney(int fraction, bool showThousandSeparator) const +const TQString PivotCell::formatMoney(int fraction, bool showThousandSeparator) const { return formatMoney("", MyMoneyMoney::denomToPrec(fraction), showThousandSeparator); } -const QString PivotCell::formatMoney(const QString& currency, const int prec, bool showThousandSeparator) const +const TQString PivotCell::formatMoney(const TQString& currency, const int prec, bool showThousandSeparator) const { // construct the result MyMoneyMoney res = (*this * m_stockSplit) + m_postSplit; @@ -132,7 +132,7 @@ PivotGridRowSet::PivotGridRowSet( unsigned _numcolumns ) insert(ePrice, PivotGridRow(_numcolumns)); } -PivotGridRowSet PivotGrid::rowSet(QString id) +PivotGridRowSet PivotGrid::rowSet(TQString id) { //go through the data and get the row that matches the id diff --git a/kmymoney2/reports/pivotgrid.h b/kmymoney2/reports/pivotgrid.h index ca7f5ab..c067c27 100644 --- a/kmymoney2/reports/pivotgrid.h +++ b/kmymoney2/reports/pivotgrid.h @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -45,7 +45,7 @@ namespace reports { * * A 'Row Pair' is two rows of money values. Each column is the SAME month. One row is the * 'actual' values for the period, the other row is the 'budgetted' values for the same - * period. For ease of implementation, a Row Pair is implemented as a Row which contains + * period. For ease of implementation, a Row Pair is implemented as a Row which tqcontains * another Row. The inherited Row is the 'actual', the contained row is the 'Budget'. * * An 'Inner Group' contains a rows for each subordinate account within a single top-level @@ -69,8 +69,8 @@ namespace reports { static PivotCell stockSplit(const MyMoneyMoney& factor); PivotCell operator += (const PivotCell& right); PivotCell operator += (const MyMoneyMoney& value); - const QString formatMoney(int fraction, bool showThousandSeparator = true) const; - const QString formatMoney(const QString& currency, const int prec, bool showThousandSeparator = true) const; + const TQString formatMoney(int fraction, bool showThousandSeparator = true) const; + const TQString formatMoney(const TQString& currency, const int prec, bool showThousandSeparator = true) const; MyMoneyMoney calculateRunningSum(const MyMoneyMoney& runningSum); MyMoneyMoney cellBalance(const MyMoneyMoney& _balance); bool isUsed(void) const { return m_cellUsed; } @@ -79,7 +79,7 @@ namespace reports { MyMoneyMoney m_postSplit; bool m_cellUsed; }; - class PivotGridRow: public QValueList + class PivotGridRow: public TQValueList { public: @@ -91,13 +91,13 @@ namespace reports { MyMoneyMoney m_total; }; - class PivotGridRowSet: public QMap + class PivotGridRowSet: public TQMap { public: PivotGridRowSet( unsigned _numcolumns = 0 ); }; - class PivotInnerGroup: public QMap + class PivotInnerGroup: public TQMap { public: PivotInnerGroup( unsigned _numcolumns = 0 ): m_total(_numcolumns) {} @@ -105,7 +105,7 @@ namespace reports { PivotGridRowSet m_total; }; - class PivotOuterGroup: public QMap + class PivotOuterGroup: public TQMap { public: PivotOuterGroup( unsigned _numcolumns = 0, unsigned _sort=m_kDefaultSortOrder, bool _inverted=false): m_total(_numcolumns), m_inverted(_inverted), m_sortOrder(_sort) {} @@ -127,7 +127,7 @@ namespace reports { // The localized name of the group for display in the report. Outergoups need this // independently, because they will lose their association with the TGrid when the // report is rendered. - QString m_displayName; + TQString m_displayName; // lower numbers sort toward the top of the report. defaults to 100, which is a nice // middle-of-the-road value @@ -136,10 +136,10 @@ namespace reports { // default sort order static const unsigned m_kDefaultSortOrder; }; - class PivotGrid: public QMap + class PivotGrid: public TQMap { public: - PivotGridRowSet rowSet (QString id); + PivotGridRowSet rowSet (TQString id); PivotGridRowSet m_total; }; diff --git a/kmymoney2/reports/pivotgridtest.cpp b/kmymoney2/reports/pivotgridtest.cpp index 397491d..431ef0f 100644 --- a/kmymoney2/reports/pivotgridtest.cpp +++ b/kmymoney2/reports/pivotgridtest.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ /* -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -62,7 +62,7 @@ void PivotGridTest::setUp () MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -75,16 +75,16 @@ void PivotGridTest::setUp () acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include // ---------------------------------------------------------------------------- // 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 transactions; + TQValueList 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 schedules = file->scheduleList(); - QValueList::const_iterator it_schedule = schedules.begin(); + TQValueList schedules = file->scheduleList(); + TQValueList::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 paymentDates = (*it_schedule).paymentDates(nextpayment,configend); - QValueList::const_iterator it_date = paymentDates.begin(); + TQValueList paymentDates = (*it_schedule).paymentDates(nextpayment,configend); + TQValueList::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 loanBalances; + TQMap loanBalances; - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList::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::ConstIterator it_loanSplits; + TQValueList::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 splits = tx.splits(); - QValueList::const_iterator it_split = splits.begin(); + TQValueList splits = tx.splits(); + TQValueList::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 %2 - %3 %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 %2 - %3 %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 accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::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 accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::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 transactions = file->transactionList(filter); + TQValueList 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 budgets = file->budgetList(); - QValueList::const_iterator budgets_it = budgets.begin(); + TQValueList budgets = file->budgetList(); + TQValueList::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 accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::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 baccounts = budget.getaccounts(); - QValueList::const_iterator it_bacc = baccounts.begin(); + TQValueList baccounts = budget.getaccounts(); + TQValueList::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& periods = (*it_bacc).getPeriods(); + const TQMap& 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::const_iterator it_period = periods.begin(); + TQMap::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("

%1

\n").arg(m_config_f.name()); + TQString result = TQString("

%1

\n").tqarg(m_config_f.name()); //actual dates of the report - result += QString("
"); - 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("
\n"); - result += QString("
 
\n"); + result += TQString("
"); + 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("
\n"); + result += TQString("
 
\n"); //currency conversion message - result += QString("
"); + result += TQString("
"); 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("
\n"); - result += QString("
 
\n"); + result += i18n("All values shown in %1 unless otherwise noted").tqarg(MyMoneyFile::instance()->baseCurrency().name()); + result += TQString("
\n"); + result += TQString("
 
\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\n" - "\n").arg(i18n("Account")); + result += TQString("\n\n
%1
\n" + "\n").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("%2").arg(headerspan,QString(m_columnHeadings[column++]).replace(QRegExp(" "),"
")); + result += TQString("%2").tqarg(headerspan,TQString(m_columnHeadings[column++]).tqreplace(TQRegExp(" "),"
")); if ( m_config_f.isShowingRowTotals() ) - result += QString("%2").arg(headerspan).arg(i18n("Total")); + result += TQString("%2").tqarg(headerspan).tqarg(i18n("Total")); result += "
\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("%1") - .arg(i18n( m_columnTypeHeaderList[i] )) - .arg(i == 0 ? lb : QString() ); + result += TQString("%1") + .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("%1") - .arg(i18n( m_columnTypeHeaderList[i] )) - .arg(i == 0 ? leftborder : QString() ); + result += TQString("%1") + .tqarg(i18n( m_columnTypeHeaderList[i] )) + .tqarg(i == 0 ? leftborder : TQString() ); } } result += ""; @@ -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 outergroups; + TQValueList 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::const_iterator it_outergroup = outergroups.begin(); + TQValueList::const_iterator it_outergroup = outergroups.begin(); while ( it_outergroup != outergroups.end() ) { // // Outer Group Header // - result += QString("\n").arg(colspan).arg((*it_outergroup).m_displayName); + result += TQString("\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("%1") - .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + rowdata += TQString("%1") + .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("%1") - .arg(coloredAmount(it_row.data()[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + rowdata += TQString("%1") + .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("%5%6") - .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(" "), " ")) - .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id())); + innergroupdata += TQString("%5%6") + .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(" "), " ")) + .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("") - .arg(rownum & 0x01 ? "even" : "odd") - .arg(i18n("Total")); + finalRow = TQString("") + .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("") - .arg(rownum & 0x01 ? "even" : "odd") - .arg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" ) - .arg(rowname.hierarchyDepth() - 1) - .arg(rowname.name().replace(QRegExp(" "), " ")) - .arg((m_config_f.isConvertCurrency() || !rowname.isForeignCurrency() )?QString():QString(" (%1)").arg(rowname.currency().id())); + finalRow = TQString("") + .tqarg(rownum & 0x01 ? "even" : "odd") + .tqarg( m_config_f.detailLevel() == MyMoneyReport::eDetailAll ? "id=\"solo\"" : "" ) + .tqarg(rowname.hierarchyDepth() - 1) + .tqarg(rowname.name().tqreplace(TQRegExp(" "), " ")) + .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("%1") - .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + finalRow += TQString("%1") + .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("%1") - .arg(coloredAmount((*it_innergroup).m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + finalRow += TQString("%1") + .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("").arg(i18n("Total")).arg((*it_outergroup).m_displayName); + result += TQString("").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("%1") - .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ][column])) - .arg(i == 0 ? lb : QString()); + result += TQString("%1") + .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("%1") - .arg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + result += TQString("%1") + .tqarg(coloredAmount((*it_outergroup).m_total[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } result += "\n"; @@ -1884,19 +1884,19 @@ QString PivotTable::renderHTML( void ) const if ( m_config_f.isShowingColumnTotals() ) { - result += QString("\n"); - result += QString("").arg(i18n("Grand Total")); + result += TQString("\n"); + result += TQString("").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("%1") - .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ][totalcolumn])) - .arg(i == 0 ? lb : QString()); + result += TQString("%1") + .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("%1") - .arg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total)) - .arg(i == 0 ? leftborder : QString()); + result += TQString("%1") + .tqarg(coloredAmount(m_grid.m_total[ m_rowTypeList[i] ].m_total)) + .tqarg(i == 0 ? leftborder : TQString()); } } result += "\n"; } - result += QString("\n"); - result += QString("\n"); + result += TQString("\n"); + result += TQString("\n"); result += "
%1
%2
%2
  %2
  %2
%5%6
%5%6
%1 %2
%1 %2
 
%1
 
%1
 
 
 
 
\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(" ", " "); + abscissaNames += TQString(m_columnHeadings[column++]).tqreplace(" ", " "); } } 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("") - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().red()) - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().green()) - .arg(KMyMoneyGlobalSettings::listNegativeValueColor().blue()); + result += TQString("") + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().red()) + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().green()) + .tqarg(KMyMoneyGlobalSettings::listNegativeValueColor().blue()); result += amount.formatMoney(currencySymbol, prec); if( amount.isNegative() ) - result += QString(""); + result += TQString(""); 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); } } diff --git a/kmymoney2/reports/pivottable.h b/kmymoney2/reports/pivottable.h index 226c9a5..26ac53c 100644 --- a/kmymoney2/reports/pivottable.h +++ b/kmymoney2/reports/pivottable.h @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -76,15 +76,15 @@ public: /** * Render the report to an HTML stream. * - * @return QString HTML string representing the report + * @return TQString HTML string representing the report */ - QString renderHTML( void ) const; + TQString renderHTML( void ) const; /** * Render the report to a comma-separated-values stream. * - * @return QString CSV string representing the report + * @return TQString CSV string representing the report */ - QString renderCSV( void ) const; + TQString renderCSV( void ) const; /** * Render the report to a graphical chart @@ -99,7 +99,7 @@ public: * @param file The filename to dump into * @param context unused, but provided for interface compatibility */ - void dump( const QString& file, const QString& context=QString()) const; + void dump( const TQString& file, const TQString& context=TQString()) const; /** * Returns the grid generated by the report @@ -114,10 +114,10 @@ private: PivotGrid m_grid; - QStringList m_columnHeadings; + TQStringList m_columnHeadings; unsigned m_numColumns; - QDate m_beginDate; - QDate m_endDate; + TQDate m_beginDate; + TQDate m_endDate; bool m_runningSumsCalculated; /** @@ -125,17 +125,17 @@ private: * the budget for it. If an account is not contained in this map, it is not included * in the budget. */ - QMap m_budgetMap; + TQMap m_budgetMap; /** * This list contains the types of PivotGridRows that are going to be shown in the report */ - QValueList m_rowTypeList; + TQValueList m_rowTypeList; /** * This list contains the i18n headers for the column types */ - QValueList m_columnTypeHeaderList; + TQValueList m_columnTypeHeaderList; MyMoneyReport m_config_f; @@ -153,7 +153,7 @@ private: * with $red, $green and $blue being the actual value for the * chosen color. */ - QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol = QString(), int prec = 2 ) const; + TQString coloredAmount(const MyMoneyMoney& amount, const TQString& currencySymbol = TQString(), int prec = 2 ) const; protected: /** @@ -165,9 +165,9 @@ protected: * * @param outergroup The outer row group * @param row The row itself - * @param recursive Whether to also recursively create rows for our parent accounts + * @param recursive Whether to also recursively create rows for our tqparent accounts */ - void createRow( const QString& outergroup, const ReportAccount& row, bool recursive ); + void createRow( const TQString& outergroup, const ReportAccount& row, bool recursive ); /** * Assigns a value into the grid @@ -183,7 +183,7 @@ protected: * @param stockSplit Wheter this is a stock split (@p true) or an actual * value (@p false). Defaults to @p false. */ - inline void assignCell( const QString& outergroup, const ReportAccount& row, unsigned column, MyMoneyMoney value, bool budget = false, bool stockSplit = false ); + inline void assignCell( const TQString& outergroup, const ReportAccount& row, unsigned column, MyMoneyMoney value, bool budget = false, bool stockSplit = false ); /** * Create a row for each included account. This is used when @@ -207,7 +207,7 @@ protected: * in the user's hierarchy and the account where the budget is held for it. * This is needed because the user can budget on a given account for that * account and all its descendants. Also if NO budget is placed on the - * account or any of its parents, the account is not included in the map. + * account or any of its tqparents, the account is not included in the map. */ void calculateBudgetMapping( void ); @@ -317,19 +317,19 @@ protected: * * @param _date The date */ - unsigned columnValue(const QDate& _date) const; + unsigned columnValue(const TQDate& _date) const; /** * Calculate the date of the last day covered by a given column. * * @param column The column */ - QDate columnDate(int column) const; + TQDate columnDate(int column) const; /** * Returns the balance of a given cell. Throws an exception once calculateRunningSums() has been run. */ - MyMoneyMoney cellBalance(const QString& outergroup, const ReportAccount& _row, unsigned column, bool budget); + MyMoneyMoney cellBalance(const TQString& outergroup, const ReportAccount& _row, unsigned column, bool budget); /** * Draws a PivotGridRowSet in a chart for the given ERowType diff --git a/kmymoney2/reports/pivottabletest.cpp b/kmymoney2/reports/pivottabletest.cpp index a235c0b..f5dbe12 100644 --- a/kmymoney2/reports/pivottabletest.cpp +++ b/kmymoney2/reports/pivottabletest.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -60,7 +60,7 @@ void PivotTableTest::setUp () MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -73,16 +73,16 @@ void PivotTableTest::setUp () acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild); + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -102,7 +102,7 @@ void PivotTableTest::testNetWorthSingle() { MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,7,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,7,1).addDays(-1)); XMLandback(filter); PivotTable networth_f(filter); writeTabletoCSV(networth_f); @@ -130,7 +130,7 @@ void PivotTableTest::testNetWorthOfsetting() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Liability"]["Credit Card"][acCredit][eActual][7]==-moCreditOpen); @@ -146,7 +146,7 @@ void PivotTableTest::testNetWorthOpeningPrior() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2005,8,1),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2005,8,1),TQDate(2005,12,31)); filter.setName("Net Worth Opening Prior 1"); XMLandback(filter); PivotTable networth_f( filter ); @@ -160,9 +160,9 @@ void PivotTableTest::testNetWorthOpeningPrior() // Test the net worth report to make sure that transactions prior to the report // period are included in the opening balance - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acChecking, acChild ); filter.setName("Net Worth Opening Prior 2"); PivotTable networth_f2( filter ); @@ -179,7 +179,7 @@ void PivotTableTest::testNetWorthDateFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,1,1),QDate(2004,2,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2004,2,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid.m_total[eActual][1]==moZero); @@ -196,7 +196,7 @@ void PivotTableTest::testSpendingEmpty() PivotTable spending_f1( filter ); CPPUNIT_ASSERT(spending_f1.m_grid.m_total[eActual].m_total==moZero); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); PivotTable spending_f2( filter ); CPPUNIT_ASSERT(spending_f2.m_grid.m_total[eActual].m_total==moZero); } @@ -204,11 +204,11 @@ void PivotTableTest::testSpendingEmpty() void PivotTableTest::testSingleTransaction() { // Test a single transaction - TransactionHelper t( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); + TransactionHelper t( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal,moSolo, acChecking, acSolo ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Spending with Single Transaction.html"); XMLandback(filter); PivotTable spending_f( filter ); @@ -222,7 +222,7 @@ void PivotTableTest::testSingleTransaction() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); CPPUNIT_ASSERT(networth_f.m_grid["Asset"]["Checking Account"].m_total[eActual][2]==(moCheckingOpen-moSolo) ); @@ -232,13 +232,13 @@ void PivotTableTest::testSubAccount() { // Test a sub-account with a value, under an account with a value - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setName("Spending with Sub-Account"); XMLandback(filter); @@ -255,7 +255,7 @@ void PivotTableTest::testSubAccount() filter.clear(); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.setName("Net Worth with Sub-Account"); XMLandback(filter); PivotTable networth_f( filter ); @@ -268,13 +268,13 @@ void PivotTableTest::testSubAccount() void PivotTableTest::testFilterIEvsIE() { // Test that removing an income/spending account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acChild); filter.addCategory(acSolo); XMLandback(filter); @@ -289,13 +289,13 @@ void PivotTableTest::testFilterIEvsIE() void PivotTableTest::testFilterALvsAL() { // Test that removing an asset/liability account will remove the entry from an asset/liability report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eAssetLiability ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); filter.addCategory(acChild); filter.addCategory(acSolo); @@ -307,13 +307,13 @@ void PivotTableTest::testFilterALvsAL() void PivotTableTest::testFilterALvsIE() { // Test that removing an asset/liability account will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acChecking); CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); @@ -329,13 +329,13 @@ void PivotTableTest::testFilterAllvsIE() { // Test that removing an asset/liability account AND an income/expense // category will remove the entry from an income/spending report - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addAccount(acCredit); filter.addCategory(acChild); PivotTable spending_f( filter ); @@ -348,14 +348,14 @@ void PivotTableTest::testFilterAllvsIE() void PivotTableTest::testFilterBasics() { // Test that the filters are operating the way that the reports expect them to - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyTransactionFilter filter; filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acSolo); filter.setReportAllSplits(false); filter.setConsiderCategory(true); @@ -371,7 +371,7 @@ void PivotTableTest::testFilterBasics() CPPUNIT_ASSERT(file->transactionList(filter).count() == 1); filter.clear(); - filter.setDateFilter(QDate(2004,9,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,9,1),TQDate(2005,1,1).addDays(-1)); filter.addCategory(acParent); filter.addAccount(acCredit); filter.setReportAllSplits(false); @@ -392,26 +392,26 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyMoney moCanTransaction( 100.0 ); MyMoneyMoney moJpyTransaction( 100.0 ); - QString acCanChecking = makeAccount(QString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,QDate(2003,11,15),acAsset,"CAD"); - QString acJpyChecking = makeAccount(QString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,QDate(2003,11,15),acAsset,"JPY"); - QString acCanCash = makeAccount(QString("Canadian"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"CAD"); - QString acJpyCash = makeAccount(QString("Japanese"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acForeign,"JPY"); + TQString acCanChecking = makeAccount(TQString("Canadian Checking"),MyMoneyAccount::Checkings,moCanOpening,TQDate(2003,11,15),acAsset,"CAD"); + TQString acJpyChecking = makeAccount(TQString("Japanese Checking"),MyMoneyAccount::Checkings,moJpyOpening,TQDate(2003,11,15),acAsset,"JPY"); + TQString acCanCash = makeAccount(TQString("Canadian"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"CAD"); + TQString acJpyCash = makeAccount(TQString("Japanese"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acForeign,"JPY"); - makePrice("CAD",QDate(2004,1,1),MyMoneyMoney(moCanPrice)); - makePrice("JPY",QDate(2004,1,1),MyMoneyMoney(moJpyPrice)); - makePrice("JPY",QDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); - makePrice("JPY",QDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); - makePrice("JPY",QDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); + makePrice("CAD",TQDate(2004,1,1),MyMoneyMoney(moCanPrice)); + makePrice("JPY",TQDate(2004,1,1),MyMoneyMoney(moJpyPrice)); + makePrice("JPY",TQDate(2004,5,1),MyMoneyMoney(moJpyPrice2)); + makePrice("JPY",TQDate(2004,6,30),MyMoneyMoney(moJpyPrice3)); + makePrice("JPY",TQDate(2004,7,15),MyMoneyMoney(moJpyPrice4)); - TransactionHelper t1( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t2( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t3( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); - TransactionHelper t4( QDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t5( QDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); - TransactionHelper t6( QDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t1( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t2( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t3( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moJpyTransaction), acJpyChecking, acJpyCash, "JPY" ); + TransactionHelper t4( TQDate(2004,2,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t5( TQDate(2004,3,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); + TransactionHelper t6( TQDate(2004,4,20), MyMoneySplit::ActionWithdrawal,MyMoneyMoney(moCanTransaction), acCanChecking, acCanCash, "CAD" ); #if 0 - QFile g( "multicurrencykmy.xml" ); + TQFile g( "multicurrencykmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -421,7 +421,7 @@ void PivotTableTest::testMultipleCurrencies() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setDetailLevel(MyMoneyReport::eDetailAll); filter.setConvertCurrency(true); filter.setName("Multiple Currency Spending Rerport (with currency conversion)"); @@ -436,7 +436,7 @@ void PivotTableTest::testMultipleCurrencies() CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][3]==(moCanTransaction*moCanPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acCanCash][eActual][4]==(moCanTransaction*moCanPrice)); - // test multiple foreign currencies under a common parent + // test multiple foreign currencies under a common tqparent CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][2]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][3]==(moJpyTransaction*moJpyPrice)); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Foreign"][acJpyCash][eActual][4]==(moJpyTransaction*moJpyPrice)); @@ -462,7 +462,7 @@ void PivotTableTest::testMultipleCurrencies() filter.clear(); filter.setName("Multiple currency net worth"); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); XMLandback(filter); PivotTable networth_f( filter ); writeTabletoCSV(networth_f); @@ -497,12 +497,12 @@ void PivotTableTest::testAdvancedFilter() // amount { - TransactionHelper t1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setAmountFilter(moChild,moChild); XMLandback(filter); PivotTable spending_f( filter ); @@ -511,14 +511,14 @@ void PivotTableTest::testAdvancedFilter() // payee (specific) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addPayee(MyMoneyFile::instance()->payeeByName("Thomas Baumgart").id()); filter.setName("Spending with Payee Filter"); XMLandback(filter); @@ -530,15 +530,15 @@ void PivotTableTest::testAdvancedFilter() } // payee (no payee) { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, QString(), QString() ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moNoPayee, acCredit, acParent, TQString(), TQString() ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.addPayee(QString()); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.addPayee(TQString()); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid["Expense"]["Parent"][acParent][eActual][11]==moNoPayee); @@ -547,24 +547,24 @@ void PivotTableTest::testAdvancedFilter() // text { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, QString(), "Thomas Baumgart" ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moThomas, acCredit, acParent, TQString(), "Thomas Baumgart" ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); - filter.setTextFilter(QRegExp("Thomas")); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); + filter.setTextFilter(TQRegExp("Thomas")); XMLandback(filter); PivotTable spending_f( filter ); } // type (payment, deposit, transfer) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionDeposit, -moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,1), MyMoneySplit::ActionTransfer, moChild, acCredit, acChecking ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); @@ -589,7 +589,7 @@ void PivotTableTest::testAdvancedFilter() CPPUNIT_ASSERT(spending_f3.m_grid.m_total[eActual].m_total == moZero); filter.setRowType(MyMoneyReport::eAssetLiability); - filter.setDateFilter( QDate(2004,1,1), QDate(2004,12,31) ); + filter.setDateFilter( TQDate(2004,1,1), TQDate(2004,12,31) ); XMLandback(filter); PivotTable networth_f4( filter ); @@ -601,12 +601,12 @@ void PivotTableTest::testAdvancedFilter() // state (reconciled, cleared, not) { - TransactionHelper t1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList splits = t1.splits(); + TQValueList splits = t1.splits(); splits[0].setReconcileFlag(MyMoneySplit::Cleared); splits[1].setReconcileFlag(MyMoneySplit::Cleared); t1.modifySplit(splits[0]); @@ -623,7 +623,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.addState(MyMoneyTransactionFilter::cleared); XMLandback(filter); PivotTable spending_f( filter ); @@ -646,12 +646,12 @@ void PivotTableTest::testAdvancedFilter() // number { - TransactionHelper t1( QDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1( TQDate(2004,10,31), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - QValueList splits = t1.splits(); + TQValueList splits = t1.splits(); splits[0].setNumber("1"); splits[1].setNumber("1"); t1.modifySplit(splits[0]); @@ -684,7 +684,7 @@ void PivotTableTest::testAdvancedFilter() MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2004,1,1),QDate(2005,1,1).addDays(-1)); + filter.setDateFilter(TQDate(2004,1,1),TQDate(2005,1,1).addDays(-1)); filter.setNumberFilter("1","3"); XMLandback(filter); PivotTable spending_f( filter ); @@ -693,21 +693,21 @@ void PivotTableTest::testAdvancedFilter() // blank dates { - TransactionHelper t1y1( QDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y1( QDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y1( QDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y1( TQDate(2003,10,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y1( TQDate(2003,11,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y1( TQDate(2003,12,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y3( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y3( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y3( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y3( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y3( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y3( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(),QDate(2004,7,1)); + filter.setDateFilter(TQDate(),TQDate(2004,7,1)); XMLandback(filter); PivotTable spending_f( filter ); CPPUNIT_ASSERT(spending_f.m_grid.m_total[eActual].m_total==-moSolo-moParent1-moParent2-moSolo-moParent1-moParent2); @@ -725,21 +725,21 @@ void PivotTableTest::testColumnType() { // test column type values of other than 'month' - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); MyMoneyReport filter; filter.setRowType( MyMoneyReport::eExpenseIncome ); - filter.setDateFilter(QDate(2003,12,31),QDate(2005,12,31)); + filter.setDateFilter(TQDate(2003,12,31),TQDate(2005,12,31)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eBiMonths); XMLandback(filter); @@ -809,19 +809,19 @@ void PivotTableTest::testColumnType() // Test days-based reports - TransactionHelper t1d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d1( QDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d1( QDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d1( TQDate(2004,7,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d1( TQDate(2004,7,5), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d2( QDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d2( QDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d2( QDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d2( TQDate(2004,7,14), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d2( TQDate(2004,7,15), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d2( TQDate(2004,7,20), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t1d3( QDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2d3( QDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3d3( QDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t1d3( TQDate(2004,8,2), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2d3( TQDate(2004,8,3), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3d3( TQDate(2004,8,4), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,7,14)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,7,14)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(MyMoneyReport::eMonths); filter.setColumnsAreDays(true); @@ -837,7 +837,7 @@ void PivotTableTest::testColumnType() unsigned save_dayweekstart = KGlobal::locale()->weekStartDay(); KGlobal::locale()->setWeekStartDay(2); - filter.setDateFilter(QDate(2004,7,2),QDate(2004,8,1)); + filter.setDateFilter(TQDate(2004,7,2),TQDate(2004,8,1)); filter.setRowType( MyMoneyReport::eExpenseIncome ); filter.setColumnType(static_cast(7)); filter.setColumnsAreDays(true); @@ -868,23 +868,23 @@ void PivotTableTest::testInvestment(void) eqStock2 = makeEquity("Stock2","STK2"); // Accounts - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset); - acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock1); - acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock2); - acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset); + acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock1); + acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock2); + acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); // Transactions // Date Action Shares Price Stock Asset Income - InvTransactionHelper s1b1( QDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1b2( QDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s1( QDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s2( QDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1r1( QDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1r2( QDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1c1( QDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1c2( QDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1b1( TQDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1b2( TQDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s1( TQDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s2( TQDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1r1( TQDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1r2( TQDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1c1( TQDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1c2( TQDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); - makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 ); + makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 ); // // Net Worth Report (with investments) @@ -892,7 +892,7 @@ void PivotTableTest::testInvestment(void) MyMoneyReport networth_r; networth_r.setRowType( MyMoneyReport::eAssetLiability ); - networth_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31).addDays(-1)); + networth_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31).addDays(-1)); XMLandback(networth_r); PivotTable networth(networth_r); @@ -920,7 +920,7 @@ void PivotTableTest::testInvestment(void) #if 0 // Dump file & reports - QFile g( "investmentkmy.xml" ); + TQFile g( "investmentkmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -945,7 +945,7 @@ void PivotTableTest::testBudget(void) // 1. Budget on A, transations on A { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, @@ -958,7 +958,7 @@ void PivotTableTest::testBudget(void) // 2. Budget on B, not applying to sub accounts, transactions on B and B:1 { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -974,7 +974,7 @@ void PivotTableTest::testBudget(void) // 3. Budget on C, applying to sub accounts, transactions on C and C:1 and C:1:a { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -989,9 +989,9 @@ void PivotTableTest::testBudget(void) // 4. Budget on D, not applying to sub accounts, budget on D:1 not applying, budget on D:2 applying. Transactions on D, D:1, D:2, D:2:a, D:2:b { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acParent, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acChild, false, 100.0 ); - budget += BudgetEntryHelper( QDate(2006,1,1), acSecondChild, true, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acParent, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acChild, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSecondChild, true, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, @@ -1003,12 +1003,12 @@ void PivotTableTest::testBudget(void) // - Totals for D, D:1, D:2 show up. D:2:a and D:2:b do not // - D actuals (only) compare against D budget // - Ditto for D:1 - // - D:2 acutals and children compare against D:2 budget + // - D:2 acutals and tqchildren compare against D:2 budget // 5. Budget on E, no transactions on E { BudgetHelper budget; - budget += BudgetEntryHelper( QDate(2006,1,1), acSolo, false, 100.0 ); + budget += BudgetEntryHelper( TQDate(2006,1,1), acSolo, false, 100.0 ); MyMoneyReport report(MyMoneyReport::eBudgetActual, MyMoneyReport::eMonths, MyMoneyTransactionFilter::yearToDate, diff --git a/kmymoney2/reports/querytable.cpp b/kmymoney2/reports/querytable.cpp index 29702c6..cc38a2f 100644 --- a/kmymoney2/reports/querytable.cpp +++ b/kmymoney2/reports/querytable.cpp @@ -25,9 +25,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include -#include -#include +#include +#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -59,7 +59,7 @@ namespace reports { // // **************************************************************************** -QDate CashFlowListItem::m_sToday = QDate::currentDate(); +TQDate CashFlowListItem::m_sToday = TQDate::tqcurrentDate(); MyMoneyMoney CashFlowListItem::NPV( double _rate ) const { @@ -158,12 +158,12 @@ double CashFlowList::calculateXIRR ( void ) const double CashFlowList::xirrResult ( double& rate ) const { - QDate date; + TQDate date; double r = rate + 1.0; double res = 0.00000;//back().value().toDouble(); - QValueList::const_iterator list_it = begin(); + TQValueList::const_iterator list_it = begin(); while( list_it != end() ) { double e_i = ( (* list_it).today().daysTo ( (* list_it).date() ) ) / 365.0; MyMoneyMoney val = (* list_it).value(); @@ -178,12 +178,12 @@ double CashFlowList::xirrResult ( double& rate ) const double CashFlowList::xirrResultDerive ( double& rate ) const { - QDate date; + TQDate date; double r = rate + 1.0; double res = 0.00000; - QValueList::const_iterator list_it = begin(); + TQValueList::const_iterator list_it = begin(); while( list_it != end() ) { double e_i = ( (* list_it).today().daysTo ( (* list_it).date() ) ) / 365.0; MyMoneyMoney val = (* list_it).value(); @@ -225,7 +225,7 @@ void CashFlowList::dumpDebug(void) const const_iterator it_item = begin(); while ( it_item != end() ) { - kdDebug(2) << (*it_item).date().toString(Qt::ISODate) << " " << (*it_item).value().toString() << endl; + kdDebug(2) << TQString((*it_item).date().toString(Qt::ISODate)) << " " << (*it_item).value().toString() << endl; ++it_item; } } @@ -334,7 +334,7 @@ void QueryTable::init(void) throw new MYMONEYEXCEPTION("QueryTable::QueryTable(): unhandled row type"); } - QString sort = m_group + "," + m_columns + ",id,rank"; + TQString sort = m_group + "," + m_columns + ",id,rank"; switch (m_config.rowType()) { case MyMoneyReport::eAccountByTopAccount: @@ -350,32 +350,32 @@ void QueryTable::init(void) unsigned qc = m_config.queryColumns(); - if ( qc & MyMoneyReport::eQCnumber ) + if ( qc & MyMoneyReport::eTQCnumber ) m_columns += ",number"; - if ( qc & MyMoneyReport::eQCpayee ) + if ( qc & MyMoneyReport::eTQCpayee ) m_columns += ",payee"; - if ( qc & MyMoneyReport::eQCcategory ) + if ( qc & MyMoneyReport::eTQCcategory ) m_columns += ",category"; - if ( qc & MyMoneyReport::eQCaccount ) + if ( qc & MyMoneyReport::eTQCaccount ) m_columns += ",account"; - if ( qc & MyMoneyReport::eQCreconciled ) + if ( qc & MyMoneyReport::eTQCreconciled ) m_columns += ",reconcileflag"; - if ( qc & MyMoneyReport::eQCmemo ) + if ( qc & MyMoneyReport::eTQCmemo ) m_columns += ",memo"; - if ( qc & MyMoneyReport::eQCaction ) + if ( qc & MyMoneyReport::eTQCaction ) m_columns += ",action"; - if ( qc & MyMoneyReport::eQCshares ) + if ( qc & MyMoneyReport::eTQCshares ) m_columns += ",shares"; - if ( qc & MyMoneyReport::eQCprice ) + if ( qc & MyMoneyReport::eTQCprice ) m_columns += ",price"; - if ( qc & MyMoneyReport::eQCperformance ) + if ( qc & MyMoneyReport::eTQCperformance ) m_columns += ",startingbal,buys,sells,reinvestincome,cashincome,return,returninvestment"; - if ( qc & MyMoneyReport::eQCloan ) + if ( qc & MyMoneyReport::eTQCloan ) { m_columns += ",payment,interest,fees"; m_postcolumns = "balance"; } - if ( qc & MyMoneyReport::eQCbalance) + if ( qc & MyMoneyReport::eTQCbalance) m_postcolumns = "balance"; TableRow::setSortCriteria(sort); @@ -417,14 +417,14 @@ void QueryTable::constructTransactionTable(void) } // support for opening and closing balances - QMap accts; + TQMap accts; //get all transactions for this report - QValueList transactions = file->transactionList(report); - for (QValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { + TQValueList transactions = file->transactionList(report); + for (TQValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { TableRow qA, qS; - QDate pd; + TQDate pd; qA["id"] = qS["id"] = (* it_transaction).id(); qA["entrydate"] = qS["entrydate"] = (* it_transaction).entryDate().toString(Qt::ISODate); @@ -432,8 +432,8 @@ void QueryTable::constructTransactionTable(void) qA["commodity"] = qS["commodity"] = (* it_transaction).commodity(); pd = (* it_transaction).postDate(); - qA["month"] = qS["month"] = i18n("Month of %1").arg(QDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); - qA["week"] = qS["week"] = i18n("Week of %1").arg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); + qA["month"] = qS["month"] = i18n("Month of %1").tqarg(TQDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); + qA["week"] = qS["week"] = i18n("Week of %1").tqarg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); qA["currency"] = qS["currency"] = ""; @@ -450,8 +450,8 @@ void QueryTable::constructTransactionTable(void) // to be the account (qA) that will have the sub-item "split" entries. we add // one transaction entry (qS) for each subsequent entry in the split. - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator myBegin, it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator myBegin, it_split; //S_end = splits.end(); for (it_split = splits.begin(), myBegin = splits.end(); it_split != splits.end(); ++it_split) { @@ -491,7 +491,7 @@ void QueryTable::constructTransactionTable(void) // split entries (qS) normally. bool loan_special_case = false; - if(m_config.queryColumns() & MyMoneyReport::eQCloan) { + if(m_config.queryColumns() & MyMoneyReport::eTQCloan) { ReportAccount splitAcc = (*it_split).accountId(); loan_special_case = splitAcc.isLoan(); } @@ -517,10 +517,10 @@ void QueryTable::constructTransactionTable(void) bool include_me = true; bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only - QString a_fullname = ""; - QString a_memo = ""; + TQString a_fullname = ""; + TQString a_memo = ""; unsigned int pass = 1; - QString myBeginCurrency = (file->account((*myBegin).accountId())).currencyId(); //currency of the main split + TQString myBeginCurrency = (file->account((*myBegin).accountId())).currencyId(); //currency of the main split do { MyMoneyMoney xr; ReportAccount splitAcc = (* it_split).accountId(); @@ -532,8 +532,8 @@ void QueryTable::constructTransactionTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = splitAcc.institutionId(); - QString payee = (*it_split).payeeId(); + TQString institution = splitAcc.institutionId(); + TQString payee = (*it_split).payeeId(); //convert to base currency if ( m_config.isConvertCurrency() ) { @@ -548,8 +548,8 @@ void QueryTable::constructTransactionTable(void) if (splitAcc.isInvest()) { - // use the institution of the parent for stock accounts - institution = splitAcc.parent().institutionId(); + // use the institution of the tqparent for stock accounts + institution = splitAcc.tqparent().institutionId(); MyMoneyMoney shares = (*it_split).shares(); qA["action"] = (*it_split).action(); @@ -559,7 +559,7 @@ void QueryTable::constructTransactionTable(void) if (((*it_split).action() == MyMoneySplit::ActionBuyShares) && (*it_split).shares().isNegative()) qA["action"] = "Sell"; - qA["investaccount"] = splitAcc.parent().name(); + qA["investaccount"] = splitAcc.tqparent().name(); } if (it_split == myBegin) { @@ -671,7 +671,7 @@ void QueryTable::constructTransactionTable(void) //--- default case includes all transaction details else { - //this is when the splits are going to be shown as children of the main split + //this is when the splits are going to be shown as tqchildren of the main split if ((splits.count() > 2) && use_summary) { qA["value"] = ""; @@ -693,8 +693,8 @@ void QueryTable::constructTransactionTable(void) if (! splitAcc.isIncomeExpense()) { qA["category"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer from %1").arg(splitAcc.fullName()) - : i18n("Transfer to %1").arg(splitAcc.fullName()); + i18n("Transfer from %1").tqarg(splitAcc.fullName()) + : i18n("Transfer to %1").tqarg(splitAcc.fullName()); qA["topcategory"] = splitAcc.topParentName(); qA["categorytype"] = i18n("Transfer"); } @@ -735,8 +735,8 @@ void QueryTable::constructTransactionTable(void) qS["topaccount"] = splitAcc.topParentName(); qS["category"] = ((*it_split).shares().isNegative()) - ? i18n("Transfer to %1").arg(a_fullname) - : i18n("Transfer from %1").arg(a_fullname); + ? i18n("Transfer to %1").tqarg(a_fullname) + : i18n("Transfer from %1").tqarg(a_fullname); qS["institution"] = institution.isEmpty() ? i18n("No Institution") @@ -807,14 +807,14 @@ void QueryTable::constructTransactionTable(void) return; } - QDate startDate, endDate; + TQDate startDate, endDate; report.validDateRange(startDate, endDate); - QString strStartDate = startDate.toString(Qt::ISODate); - QString strEndDate = endDate.toString(Qt::ISODate); + TQString strStartDate = startDate.toString(Qt::ISODate); + TQString strEndDate = endDate.toString(Qt::ISODate); startDate = startDate.addDays(-1); - QMap::const_iterator it_account, accts_end; + TQMap::const_iterator it_account, accts_end; for (it_account = accts.begin(); it_account != accts.end(); ++it_account) { TableRow qA; @@ -827,11 +827,11 @@ void QueryTable::constructTransactionTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = account.institutionId(); + TQString institution = account.institutionId(); - // use the institution of the parent for stock accounts + // use the institution of the tqparent for stock accounts if (account.isInvest()) - institution = account.parent().institutionId(); + institution = account.tqparent().institutionId(); MyMoneyMoney startBalance, endBalance, startPrice, endPrice; MyMoneyMoney startShares, endShares; @@ -868,7 +868,7 @@ void QueryTable::constructTransactionTable(void) qA["postdate"] = strStartDate; qA["balance"] = startBalance.convert(fraction).toString(); - qA["value"] = QString(); + qA["value"] = TQString(); qA["id"] = "A"; m_rows += qA; @@ -904,8 +904,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow // Account, Value on , Buys, Sells, Income, Value on , Return% MyMoneyReport report = m_config; - QDate startingDate; - QDate endingDate; + TQDate startingDate; + TQDate endingDate; MyMoneyMoney price; report.validDateRange( startingDate, endingDate ); startingDate = startingDate.addDays(-1); @@ -923,11 +923,11 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow { MyMoneyTransactionFilter filter; //get the transactions for the time before the report - filter.setDateFilter(QDate(), startingDate); + filter.setDateFilter(TQDate(), startingDate); filter.addAccount(account.id()); filter.setReportAllSplits(true); - QValueList startTransactions = file->transactionList(filter); + TQValueList startTransactions = file->transactionList(filter); if(startTransactions.size() > 0) { //get the last transaction @@ -973,8 +973,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow report.setConsiderCategory(true); report.clearAccountFilter(); report.addAccount(account.id()); - QValueList transactions = file->transactionList( report ); - QValueList::const_iterator it_transaction = transactions.begin(); + TQValueList transactions = file->transactionList( report ); + TQValueList::const_iterator it_transaction = transactions.begin(); while ( it_transaction != transactions.end() ) { // s is the split for the stock account @@ -990,7 +990,7 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow MyMoneyMoney value = s.value() * price; - const QString& action = s.action(); + const TQString& action = s.action(); if ( action == MyMoneySplit::ActionBuyShares ) { if ( s.value().isPositive() ) { @@ -1005,8 +1005,8 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow reinvestincome += CashFlowListItem( (*it_transaction).postDate(), value ); } else if ( action == MyMoneySplit::ActionDividend || action == MyMoneySplit::ActionYield ) { // find the split with the category, which has the actual amount of the dividend - QValueList splits = (*it_transaction).splits(); - QValueList::const_iterator it_split = splits.begin(); + TQValueList splits = (*it_transaction).splits(); + TQValueList::const_iterator it_split = splits.begin(); bool found = false; while( it_split != splits.end() ) { ReportAccount acc = (*it_split).accountId(); @@ -1074,7 +1074,7 @@ void QueryTable::constructPerformanceRow( const ReportAccount& account, TableRow result["return"] = annualReturn.toString(); result["returninvestment"] = returnInvestment.toString(); } - catch (QString e) + catch (TQString e) { kdDebug(2) << e << endl; } @@ -1094,9 +1094,9 @@ void QueryTable::constructAccountTable(void) //make sure we have all subaccounts of investment accounts includeInvestmentSubAccounts(); - QValueList accounts; + TQValueList accounts; file->accountList(accounts); - QValueList::const_iterator it_account = accounts.begin(); + TQValueList::const_iterator it_account = accounts.begin(); while ( it_account != accounts.end() ) { ReportAccount account = *it_account; @@ -1146,9 +1146,9 @@ void QueryTable::constructAccountTable(void) qaccountrow["price"] = ( netprice.reduce() ).convert(MyMoneyMoney::precToDenom(KMyMoneyGlobalSettings::pricePrecision())).toString(); qaccountrow["value"] = ( netprice.reduce() * shares.reduce() ).convert(fraction).toString(); - QString iid = (*it_account).institutionId(); + TQString iid = (*it_account).institutionId(); - // If an account does not have an institution, get it from the top-parent. + // If an account does not have an institution, get it from the top-tqparent. if ( iid.isEmpty() && ! account.isTopLevel() ) { ReportAccount topaccount = account.topParent(); @@ -1169,7 +1169,7 @@ void QueryTable::constructAccountTable(void) constructPerformanceRow( account, qaccountrow ); } else - qaccountrow["equitytype"] = QString(); + qaccountrow["equitytype"] = TQString(); // don't add the account if it is closed. In fact, the business logic // should prevent that an account can be closed with a balance not equal @@ -1194,14 +1194,14 @@ void QueryTable::constructSplitsTable(void) report.setConsiderCategory(true); // support for opening and closing balances - QMap accts; + TQMap accts; //get all transactions for this report - QValueList transactions = file->transactionList(report); - for (QValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { + TQValueList transactions = file->transactionList(report); + for (TQValueList::const_iterator it_transaction = transactions.begin(); it_transaction != transactions.end(); ++it_transaction) { TableRow qA, qS; - QDate pd; + TQDate pd; qA["id"] = qS["id"] = (* it_transaction).id(); qA["entrydate"] = qS["entrydate"] = (* it_transaction).entryDate().toString(Qt::ISODate); @@ -1209,8 +1209,8 @@ void QueryTable::constructSplitsTable(void) qA["commodity"] = qS["commodity"] = (* it_transaction).commodity(); pd = (* it_transaction).postDate(); - qA["month"] = qS["month"] = i18n("Month of %1").arg(QDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); - qA["week"] = qS["week"] = i18n("Week of %1").arg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); + qA["month"] = qS["month"] = i18n("Month of %1").tqarg(TQDate(pd.year(),pd.month(),1).toString(Qt::ISODate)); + qA["week"] = qS["week"] = i18n("Week of %1").tqarg(pd.addDays(1-pd.dayOfWeek()).toString(Qt::ISODate)); qA["currency"] = qS["currency"] = ""; @@ -1226,8 +1226,8 @@ void QueryTable::constructSplitsTable(void) // that is not an income or expense account if there is no stock or loan account) // to be the account (qA) that will have the sub-item "split" entries. we add // one transaction entry (qS) for each subsequent entry in the split. - const QValueList& splits = (*it_transaction).splits(); - QValueList::const_iterator myBegin, it_split; + const TQValueList& splits = (*it_transaction).splits(); + TQValueList::const_iterator myBegin, it_split; //S_end = splits.end(); for (it_split = splits.begin(), myBegin = splits.end(); it_split != splits.end(); ++it_split) { @@ -1266,7 +1266,7 @@ void QueryTable::constructSplitsTable(void) // reference (loan) account (qA). however, we process the matching // split entries (qS) normally. bool loan_special_case = false; - if(m_config.queryColumns() & MyMoneyReport::eQCloan) { + if(m_config.queryColumns() & MyMoneyReport::eTQCloan) { ReportAccount splitAcc = (*it_split).accountId(); loan_special_case = splitAcc.isLoan(); } @@ -1276,8 +1276,8 @@ void QueryTable::constructSplitsTable(void) bool include_me = true; bool transaction_text = false; //indicates whether a text should be considered as a match for the transaction or for a split only - QString a_fullname = ""; - QString a_memo = ""; + TQString a_fullname = ""; + TQString a_memo = ""; unsigned int pass = 1; do { @@ -1291,8 +1291,8 @@ void QueryTable::constructSplitsTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = splitAcc.institutionId(); - QString payee = (*it_split).payeeId(); + TQString institution = splitAcc.institutionId(); + TQString payee = (*it_split).payeeId(); if ( m_config.isConvertCurrency() ) { xr = (splitAcc.deepCurrencyPrice((*it_transaction).postDate()) * splitAcc.baseCurrencyPrice((*it_transaction).postDate())).reduce(); @@ -1308,8 +1308,8 @@ void QueryTable::constructSplitsTable(void) if (splitAcc.isInvest()) { - // use the institution of the parent for stock accounts - institution = splitAcc.parent().institutionId(); + // use the institution of the tqparent for stock accounts + institution = splitAcc.tqparent().institutionId(); MyMoneyMoney shares = (*it_split).shares(); qA["action"] = (*it_split).action(); @@ -1319,7 +1319,7 @@ void QueryTable::constructSplitsTable(void) if (((*it_split).action() == MyMoneySplit::ActionBuyShares) && (*it_split).shares().isNegative()) qA["action"] = "Sell"; - qA["investaccount"] = splitAcc.parent().name(); + qA["investaccount"] = splitAcc.tqparent().name(); } include_me = m_config.includes(splitAcc); @@ -1364,8 +1364,8 @@ void QueryTable::constructSplitsTable(void) //fill in account information if (! splitAcc.isIncomeExpense() && it_split != myBegin) { qA["account"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer to %1").arg(myBeginAcc.fullName()) - : i18n("Transfer from %1").arg(myBeginAcc.fullName()); + i18n("Transfer to %1").tqarg(myBeginAcc.fullName()) + : i18n("Transfer from %1").tqarg(myBeginAcc.fullName()); } else if (it_split == myBegin ) { //handle the main split if((splits.count() > 2)) { @@ -1373,7 +1373,7 @@ void QueryTable::constructSplitsTable(void) qA["account"] = i18n("[Split Transaction]"); } else { //fill the account name of the second split - QValueList::const_iterator tempSplit = splits.begin(); + TQValueList::const_iterator tempSplit = splits.begin(); //there are supposed to be only 2 splits if we ever get here if(tempSplit == myBegin && splits.count() > 1) @@ -1383,8 +1383,8 @@ void QueryTable::constructSplitsTable(void) ReportAccount tempSplitAcc = (*tempSplit).accountId(); if (! tempSplitAcc.isIncomeExpense()) { qA["account"] = ((*it_split).shares().isNegative()) ? - i18n("Transfer to %1").arg(tempSplitAcc.fullName()) - : i18n("Transfer from %1").arg(tempSplitAcc.fullName()); + i18n("Transfer to %1").tqarg(tempSplitAcc.fullName()) + : i18n("Transfer from %1").tqarg(tempSplitAcc.fullName()); } else { qA["account"] = tempSplitAcc.fullName(); } @@ -1439,14 +1439,14 @@ void QueryTable::constructSplitsTable(void) return; } - QDate startDate, endDate; + TQDate startDate, endDate; report.validDateRange(startDate, endDate); - QString strStartDate = startDate.toString(Qt::ISODate); - QString strEndDate = endDate.toString(Qt::ISODate); + TQString strStartDate = startDate.toString(Qt::ISODate); + TQString strEndDate = endDate.toString(Qt::ISODate); startDate = startDate.addDays(-1); - QMap::const_iterator it_account, accts_end; + TQMap::const_iterator it_account, accts_end; for (it_account = accts.begin(); it_account != accts.end(); ++it_account) { TableRow qA; @@ -1459,11 +1459,11 @@ void QueryTable::constructSplitsTable(void) if(fraction == -1) fraction = file->baseCurrency().smallestAccountFraction(); - QString institution = account.institutionId(); + TQString institution = account.institutionId(); - // use the institution of the parent for stock accounts + // use the institution of the tqparent for stock accounts if (account.isInvest()) - institution = account.parent().institutionId(); + institution = account.tqparent().institutionId(); MyMoneyMoney startBalance, endBalance, startPrice, endPrice; MyMoneyMoney startShares, endShares; @@ -1500,7 +1500,7 @@ void QueryTable::constructSplitsTable(void) qA["postdate"] = strStartDate; qA["balance"] = startBalance.convert(fraction).toString(); - qA["value"] = QString(); + qA["value"] = TQString(); qA["id"] = "A"; m_rows += qA; diff --git a/kmymoney2/reports/querytable.h b/kmymoney2/reports/querytable.h index 7beb3d4..e1b3918 100644 --- a/kmymoney2/reports/querytable.h +++ b/kmymoney2/reports/querytable.h @@ -23,13 +23,13 @@ * * ***************************************************************************/ -#ifndef QUERYTABLE_H -#define QUERYTABLE_H +#ifndef TQUERYTABLE_H +#define TQUERYTABLE_H // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -79,25 +79,25 @@ class CashFlowListItem { public: CashFlowListItem(void) {} - CashFlowListItem( const QDate& _date, const MyMoneyMoney& _value ): m_date(_date), m_value(_value) {} + CashFlowListItem( const TQDate& _date, const MyMoneyMoney& _value ): m_date(_date), m_value(_value) {} bool operator<( const CashFlowListItem _second ) const { return m_date < _second.m_date; } bool operator<=( const CashFlowListItem _second ) const { return m_date <= _second.m_date; } bool operator>( const CashFlowListItem _second ) const { return m_date > _second.m_date; } - const QDate& date( void ) const { return m_date; } + const TQDate& date( void ) const { return m_date; } const MyMoneyMoney& value( void ) const { return m_value; } MyMoneyMoney NPV( double _rate ) const; - static void setToday( const QDate& _today ) { m_sToday = _today; } - const QDate& today( void ) const { return m_sToday; } + static void setToday( const TQDate& _today ) { m_sToday = _today; } + const TQDate& today( void ) const { return m_sToday; } private: - QDate m_date; + TQDate m_date; MyMoneyMoney m_value; - static QDate m_sToday; + static TQDate m_sToday; }; -class CashFlowList: public QValueList +class CashFlowList: public TQValueList { public: CashFlowList(void) {} @@ -139,4 +139,4 @@ class CashFlowList: public QValueList } -#endif // QUERYREPORT_H +#endif // TQUERYREPORT_H diff --git a/kmymoney2/reports/querytabletest.cpp b/kmymoney2/reports/querytabletest.cpp index 8b3c579..73ab69d 100644 --- a/kmymoney2/reports/querytabletest.cpp +++ b/kmymoney2/reports/querytabletest.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include -#include -#include +#include +#include +#include #include #include @@ -30,7 +30,7 @@ #include "reportstestcommon.h" #define private public -#include "querytable.h" +#include "tquerytable.h" #undef private #include "../mymoney/mymoneyaccount.h" @@ -56,7 +56,7 @@ void QueryTableTest::setUp () { MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -69,13 +69,13 @@ void QueryTableTest::setUp () { acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense); - acTax = makeAccount(QString("Tax"), MyMoneyAccount::Expense,0,QDate(2005,1,11),acExpense, "", true); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense); + acTax = makeAccount(TQString("Tax"), MyMoneyAccount::Expense,0,TQDate(2005,1,11),acExpense, "", true); MyMoneyInstitution i("Bank of the World","","","","","",""); file->addInstitution(i); @@ -93,26 +93,26 @@ void QueryTableTest::testQueryBasics() { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); unsigned cols; MyMoneyReport filter; filter.setRowType( MyMoneyReport::eCategory ); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); // filter.setName("Transactions by Category"); XMLandback(filter); @@ -120,7 +120,7 @@ void QueryTableTest::testQueryBasics() writeTabletoHTML(qtbl_1,"Transactions by Category.html"); - QValueList rows = qtbl_1.rows(); + TQValueList rows = qtbl_1.rows(); CPPUNIT_ASSERT(rows.count() == 12); CPPUNIT_ASSERT(rows[0]["categorytype"]=="Expense"); @@ -130,14 +130,14 @@ void QueryTableTest::testQueryBasics() CPPUNIT_ASSERT(rows[11]["category"]=="Solo"); CPPUNIT_ASSERT(rows[11]["postdate"]=="2005-01-01"); - QString html = qtbl_1.renderHTML(); + TQString html = qtbl_1.renderHTML(); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent") == -(moParent1 + moParent2) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Parent: Child") == -(moChild) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Solo") == -(moSolo) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" Expense") == -(moParent1 + moParent2 + moSolo + moChild) * 3 ); CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == -(moParent1 + moParent2 + moSolo + moChild) * 3 + moCheckingOpen + moCreditOpen ); filter.setRowType( MyMoneyReport::eTopCategory ); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); // filter.setName("Transactions by Top Category"); XMLandback(filter); @@ -166,7 +166,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eAccount ); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_3(filter); @@ -200,7 +200,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::ePayee ); filter.setName("Transactions by Payee"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCmemo | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCmemo | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_4(filter); @@ -226,7 +226,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eMonth ); filter.setName("Transactions by Month"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_5(filter); @@ -254,7 +254,7 @@ void QueryTableTest::testQueryBasics() filter.setRowType( MyMoneyReport::eWeek ); filter.setName("Transactions by Week"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_6(filter); @@ -311,23 +311,23 @@ void QueryTableTest::testCashFlowAnalysis() CashFlowList list; - list += CashFlowListItem( QDate(2004,5,3),1000.0 ); - list += CashFlowListItem( QDate(2004,5,20),59.0 ); - list += CashFlowListItem( QDate(2004,6,3),14.0 ); - list += CashFlowListItem( QDate(2004,6,24),92.0 ); - list += CashFlowListItem( QDate(2004,7,6),63.0 ); - list += CashFlowListItem( QDate(2004,7,25),15.0 ); - list += CashFlowListItem( QDate(2004,8,5),92.0 ); - list += CashFlowListItem( QDate(2004,9,2),18.0 ); - list += CashFlowListItem( QDate(2004,9,21),5.0 ); - list += CashFlowListItem( QDate(2004,10,16),-2037.0 ); + list += CashFlowListItem( TQDate(2004,5,3),1000.0 ); + list += CashFlowListItem( TQDate(2004,5,20),59.0 ); + list += CashFlowListItem( TQDate(2004,6,3),14.0 ); + list += CashFlowListItem( TQDate(2004,6,24),92.0 ); + list += CashFlowListItem( TQDate(2004,7,6),63.0 ); + list += CashFlowListItem( TQDate(2004,7,25),15.0 ); + list += CashFlowListItem( TQDate(2004,8,5),92.0 ); + list += CashFlowListItem( TQDate(2004,9,2),18.0 ); + list += CashFlowListItem( TQDate(2004,9,21),5.0 ); + list += CashFlowListItem( TQDate(2004,10,16),-2037.0 ); MyMoneyMoney IRR(list.IRR(),1000); CPPUNIT_ASSERT( IRR == MyMoneyMoney(1676,1000) ); list.pop_back(); - list += CashFlowListItem( QDate(2004,10,16),-1358.0 ); + list += CashFlowListItem( TQDate(2004,10,16),-1358.0 ); IRR = MyMoneyMoney( list.IRR(), 1000 ); @@ -338,7 +338,7 @@ void QueryTableTest::testAccountQuery() { try { - QString htmlcontext = QString("\n\n%1\n\n"); + TQString htmlcontext = TQString("\n\n%1\n\n"); // // No transactions, opening balances only @@ -352,7 +352,7 @@ void QueryTableTest::testAccountQuery() writeTabletoHTML(qtbl_1,"Accounts by Institution (No transactions).html"); - QValueList rows = qtbl_1.rows(); + TQValueList rows = qtbl_1.rows(); CPPUNIT_ASSERT(rows.count() == 2); CPPUNIT_ASSERT(rows[0]["account"]=="Checking Account"); @@ -362,7 +362,7 @@ void QueryTableTest::testAccountQuery() CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==moCreditOpen); CPPUNIT_ASSERT(rows[1]["equitytype"].isEmpty()); - QString html = qtbl_1.renderHTML(); + TQString html = qtbl_1.renderHTML(); CPPUNIT_ASSERT( searchHTML(html,i18n("Total")+" None") == moCheckingOpen+moCreditOpen ); CPPUNIT_ASSERT( searchHTML(html,i18n("Grand Total")) == moCheckingOpen+moCreditOpen ); @@ -370,20 +370,20 @@ void QueryTableTest::testAccountQuery() // Adding in transactions // - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); filter.setRowType( MyMoneyReport::eInstitution ); filter.setName("Accounts by Institution (With Transactions)"); @@ -439,25 +439,25 @@ void QueryTableTest::testInvestment(void) eqStock2 = makeEquity("Stock2","STK2"); // Accounts - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset); - acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock1); - acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,QDate(2004,1,1),acInvestment,eqStock2); - acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); - acInterest = makeAccount("Interest",MyMoneyAccount::Income,moZero,QDate(2004,1,1),acIncome); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset); + acStock1 = makeAccount("Stock 1",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock1); + acStock2 = makeAccount("Stock 2",MyMoneyAccount::Stock,moZero,TQDate(2004,1,1),acInvestment,eqStock2); + acDividends = makeAccount("Dividends",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); + acInterest = makeAccount("Interest",MyMoneyAccount::Income,moZero,TQDate(2004,1,1),acIncome); // Transactions // Date Action Shares Price Stock Asset Income - InvTransactionHelper s1b1( QDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1b2( QDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s1( QDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1s2( QDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, QString() ); - InvTransactionHelper s1r1( QDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1r2( QDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, QString(), acDividends ); - InvTransactionHelper s1c1( QDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1c2( QDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); - InvTransactionHelper s1y1( QDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest ); - - makeEquityPrice( eqStock1, QDate(2004,10,1), 100.00 ); + InvTransactionHelper s1b1( TQDate(2004,2,1), MyMoneySplit::ActionBuyShares, 1000.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1b2( TQDate(2004,3,1), MyMoneySplit::ActionBuyShares, 1000.00, 110.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s1( TQDate(2004,4,1), MyMoneySplit::ActionBuyShares, -200.00, 120.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1s2( TQDate(2004,5,1), MyMoneySplit::ActionBuyShares, -200.00, 100.00, acStock1, acChecking, TQString() ); + InvTransactionHelper s1r1( TQDate(2004,6,1), MyMoneySplit::ActionReinvestDividend, 50.00, 100.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1r2( TQDate(2004,7,1), MyMoneySplit::ActionReinvestDividend, 50.00, 80.00, acStock1, TQString(), acDividends ); + InvTransactionHelper s1c1( TQDate(2004,8,1), MyMoneySplit::ActionDividend, 10.00, 100.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1c2( TQDate(2004,9,1), MyMoneySplit::ActionDividend, 10.00, 120.00, acStock1, acChecking, acDividends ); + InvTransactionHelper s1y1( TQDate(2004,9,15), MyMoneySplit::ActionYield, 10.00, 110.00, acStock1, acChecking, acInterest ); + + makeEquityPrice( eqStock1, TQDate(2004,10,1), 100.00 ); // // Investment Transactions Report @@ -465,13 +465,13 @@ void QueryTableTest::testInvestment(void) MyMoneyReport invtran_r( MyMoneyReport::eTopAccount, - MyMoneyReport::eQCaction|MyMoneyReport::eQCshares|MyMoneyReport::eQCprice, + MyMoneyReport::eTQCaction|MyMoneyReport::eTQCshares|MyMoneyReport::eTQCprice, MyMoneyTransactionFilter::userDefined, MyMoneyReport::eDetailAll, i18n("Investment Transactions"), i18n("Test Report") ); - invtran_r.setDateFilter(QDate(2004,1,1),QDate(2004,12,31)); + invtran_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,12,31)); invtran_r.setInvestmentsOnly(true); XMLandback(invtran_r); QueryTable invtran(invtran_r); @@ -479,7 +479,7 @@ void QueryTableTest::testInvestment(void) #if 1 writeTabletoHTML(invtran,"investment_transactions_test.html"); - QValueList rows = invtran.rows(); + TQValueList rows = invtran.rows(); CPPUNIT_ASSERT(rows.count()==17); CPPUNIT_ASSERT(MyMoneyMoney(rows[1]["value"])==MyMoneyMoney(100000.00)); @@ -541,7 +541,7 @@ void QueryTableTest::testInvestment(void) CPPUNIT_ASSERT(rows[8]["action"]=="Yield"); #endif - QString html = invtran.renderHTML(); + TQString html = invtran.renderHTML(); #if 1 // i think this is the correct amount. different treatment of dividend and yield CPPUNIT_ASSERT( searchHTML(html,i18n("Total Stock 1")) == MyMoneyMoney(175000.00) ); @@ -557,13 +557,13 @@ void QueryTableTest::testInvestment(void) MyMoneyReport invhold_r( MyMoneyReport::eAccountByTopAccount, - MyMoneyReport::eQCperformance, + MyMoneyReport::eTQCperformance, MyMoneyTransactionFilter::userDefined, MyMoneyReport::eDetailAll, i18n("Investment Performance by Account"), i18n("Test Report") ); - invhold_r.setDateFilter(QDate(2004,1,1),QDate(2004,10,1)); + invhold_r.setDateFilter(TQDate(2004,1,1),TQDate(2004,10,1)); invhold_r.setInvestmentsOnly(true); XMLandback(invhold_r); QueryTable invhold(invhold_r); @@ -587,7 +587,7 @@ void QueryTableTest::testInvestment(void) #if 0 // Dump file & reports - QFile g( "investmentkmy.xml" ); + TQFile g( "investmentkmy.xml" ); g.open( IO_WriteOnly ); MyMoneyStorageXML xml; IMyMoneyStorageFormat& interface = xml; @@ -611,20 +611,20 @@ void QueryTableTest::testInvestment(void) { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q1( QDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y1( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q1( TQDate(2004,3,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y1( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1q2( QDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q2( QDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3q2( QDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4q2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1q2( TQDate(2004,4,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q2( TQDate(2004,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3q2( TQDate(2004,6,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4q2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); - TransactionHelper t1y2( QDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2y2( QDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); - TransactionHelper t3y2( QDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); - TransactionHelper t4y2( QDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); + TransactionHelper t1y2( TQDate(2005,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2y2( TQDate(2005,5,1), MyMoneySplit::ActionWithdrawal, moParent1, acCredit, acParent ); + TransactionHelper t3y2( TQDate(2005,9,1), MyMoneySplit::ActionWithdrawal, moParent2, acCredit, acParent ); + TransactionHelper t4y2( TQDate(2004,11,7), MyMoneySplit::ActionWithdrawal, moChild, acCredit, acChild ); unsigned cols; @@ -632,25 +632,25 @@ void QueryTableTest::testInvestment(void) filter.setRowType( MyMoneyReport::eAccount ); filter.setName("Transactions by Account"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCcategory | MyMoneyReport::eQCbalance; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCcategory | MyMoneyReport::eTQCbalance; filter.setQueryColumns( static_cast(cols) ); // XMLandback(filter); QueryTable qtbl_3(filter); writeTabletoHTML(qtbl_3,"Transactions by Account.html"); - QString html = qtbl_3.renderHTML(); + TQString html = qtbl_3.renderHTML(); - QValueList rows = qtbl_3.rows(); + TQValueList rows = qtbl_3.rows(); CPPUNIT_ASSERT(rows.count() == 16); //this is to make sure that the dates of closing and opening balances and the balance numbers are ok - QString openingDate = KGlobal::locale()->formatDate(QDate(2004,1,1), true); - QString closingDate = KGlobal::locale()->formatDate(QDate(2005,9,1), true); - CPPUNIT_ASSERT( html.find(openingDate + ""+i18n("Opening Balance")) > 0); - CPPUNIT_ASSERT( html.find(closingDate + ""+i18n("Closing Balance")+" -702.36") > 0); - CPPUNIT_ASSERT( html.find(closingDate + ""+i18n("Closing Balance")+" -705.69") > 0); + TQString openingDate = KGlobal::locale()->formatDate(TQDate(2004,1,1), true); + TQString closingDate = KGlobal::locale()->formatDate(TQDate(2005,9,1), true); + CPPUNIT_ASSERT( html.tqfind(openingDate + ""+i18n("Opening Balance")) > 0); + CPPUNIT_ASSERT( html.tqfind(closingDate + ""+i18n("Closing Balance")+" -702.36") > 0); + CPPUNIT_ASSERT( html.tqfind(closingDate + ""+i18n("Closing Balance")+" -705.69") > 0); } catch(MyMoneyException *e) @@ -664,15 +664,15 @@ void QueryTableTest::testInvestment(void) void QueryTableTest::testTaxReport() { try { - TransactionHelper t1q1( QDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); - TransactionHelper t2q1( QDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax ); + TransactionHelper t1q1( TQDate(2004,1,1), MyMoneySplit::ActionWithdrawal, moSolo, acChecking, acSolo ); + TransactionHelper t2q1( TQDate(2004,2,1), MyMoneySplit::ActionWithdrawal, moParent1, acChecking, acTax ); unsigned cols; MyMoneyReport filter; filter.setRowType( MyMoneyReport::eCategory ); filter.setName("Tax Transactions"); - cols = MyMoneyReport::eQCnumber | MyMoneyReport::eQCpayee | MyMoneyReport::eQCaccount; + cols = MyMoneyReport::eTQCnumber | MyMoneyReport::eTQCpayee | MyMoneyReport::eTQCaccount; filter.setQueryColumns( static_cast(cols) ); filter.setTax(true); @@ -681,9 +681,9 @@ void QueryTableTest::testTaxReport() writeTabletoHTML(qtbl_3,"Tax Transactions.html"); - QValueList rows = qtbl_3.rows(); + TQValueList rows = qtbl_3.rows(); - QString html = qtbl_3.renderHTML(); + TQString html = qtbl_3.renderHTML(); CPPUNIT_ASSERT(rows.count() == 1); } catch(MyMoneyException *e) { CPPUNIT_FAIL(e->what()); diff --git a/kmymoney2/reports/querytabletest.h b/kmymoney2/reports/querytabletest.h index 36f3075..af5ae4b 100644 --- a/kmymoney2/reports/querytabletest.h +++ b/kmymoney2/reports/querytabletest.h @@ -15,8 +15,8 @@ * * ***************************************************************************/ -#ifndef QUERYTABLETEST_H -#define QUERYTABLETEST_H +#ifndef TQUERYTABLETEST_H +#define TQUERYTABLETEST_H #include #include "../mymoney/mymoneyfile.h" diff --git a/kmymoney2/reports/reportaccount.cpp b/kmymoney2/reports/reportaccount.cpp index 5f7e7f8..d38727d 100644 --- a/kmymoney2/reports/reportaccount.cpp +++ b/kmymoney2/reports/reportaccount.cpp @@ -52,11 +52,11 @@ ReportAccount::ReportAccount( const ReportAccount& copy ): DEBUG_ENTER(__PRETTY_FUNCTION__); } -ReportAccount::ReportAccount( const QString& accountid ): +ReportAccount::ReportAccount( const TQString& accountid ): MyMoneyAccount( MyMoneyFile::instance()->account(accountid) ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Account %1").arg(accountid)); + DEBUG_OUTPUT(TQString("Account %1").tqarg(accountid)); calculateAccountHierarchy(); } @@ -64,7 +64,7 @@ ReportAccount::ReportAccount( const MyMoneyAccount& account ): MyMoneyAccount( account ) { DEBUG_ENTER(__PRETTY_FUNCTION__); - DEBUG_OUTPUT(QString("Account %1").arg(account.id())); + DEBUG_OUTPUT(TQString("Account %1").tqarg(account.id())); calculateAccountHierarchy(); } @@ -73,21 +73,21 @@ void ReportAccount::calculateAccountHierarchy( void ) DEBUG_ENTER(__PRETTY_FUNCTION__); MyMoneyFile* file = MyMoneyFile::instance(); - QString resultid = id(); - QString parentid = parentAccountId(); + TQString resultid = id(); + TQString tqparentid = tqparentAccountId(); #ifdef DEBUG_HIDE_SENSITIVE m_nameHierarchy.prepend(file->account(resultid).id()); #else m_nameHierarchy.prepend(file->account(resultid).name()); #endif - while (!file->isStandardAccount(parentid)) + while (!file->isStandardAccount(tqparentid)) { - // take on the identity of our parent - resultid = parentid; + // take on the identity of our tqparent + resultid = tqparentid; // and try again - parentid = file->account(resultid).parentAccountId(); + tqparentid = file->account(resultid).tqparentAccountId(); #ifdef DEBUG_HIDE_SENSITIVE m_nameHierarchy.prepend(file->account(resultid).id()); #else @@ -96,7 +96,7 @@ void ReportAccount::calculateAccountHierarchy( void ) } } -MyMoneyMoney ReportAccount::deepCurrencyPrice( const QDate& date ) const +MyMoneyMoney ReportAccount::deepCurrencyPrice( const TQDate& date ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); @@ -111,25 +111,25 @@ MyMoneyMoney ReportAccount::deepCurrencyPrice( const QDate& date ) const { result = price.rate(undersecurity.tradingCurrency()); - DEBUG_OUTPUT(QString("Converting under %1 to deep %2, price on %3 is %4") - .arg(undersecurity.name()) - .arg(file->security(undersecurity.tradingCurrency()).name()) - .arg(date.toString()) - .arg(result.toDouble())); + DEBUG_OUTPUT(TQString("Converting under %1 to deep %2, price on %3 is %4") + .tqarg(undersecurity.name()) + .tqarg(file->security(undersecurity.tradingCurrency()).name()) + .tqarg(date.toString()) + .tqarg(result.toDouble())); } else { - DEBUG_OUTPUT(QString("No price to convert under %1 to deep %2 on %3") - .arg(undersecurity.name()) - .arg(file->security(undersecurity.tradingCurrency()).name()) - .arg(date.toString())); + DEBUG_OUTPUT(TQString("No price to convert under %1 to deep %2 on %3") + .tqarg(undersecurity.name()) + .tqarg(file->security(undersecurity.tradingCurrency()).name()) + .tqarg(date.toString())); } } return result; } -MyMoneyMoney ReportAccount::baseCurrencyPrice( const QDate& date ) const +MyMoneyMoney ReportAccount::baseCurrencyPrice( const TQDate& date ) const { // Note that whether or not the user chooses to convert to base currency, all the values // for a given account/category are converted to the currency for THAT account/category @@ -156,7 +156,7 @@ MyMoneyMoney ReportAccount::baseCurrencyPrice( const QDate& date ) const return result; } -MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, const QDate& date ) const +MyMoneyMoney ReportAccount::foreignCurrencyPrice( const TQString foreignCurrency, const TQDate& date ) const { DEBUG_ENTER(__PRETTY_FUNCTION__); @@ -166,7 +166,7 @@ MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, MyMoneySecurity security = file->security(foreignCurrency); //check whether it is a currency or a commodity. In the latter case case, get the trading currency - QString tradingCurrency; + TQString tradingCurrency; if(security.isCurrency()) { tradingCurrency = foreignCurrency; } else { @@ -180,18 +180,18 @@ MyMoneyMoney ReportAccount::foreignCurrencyPrice( const QString foreignCurrency, if(price.isValid()) { result = price.rate(tradingCurrency); - DEBUG_OUTPUT(QString("Converting deep %1 to currency %2, price on %3 is %4") - .arg(file->currency(currency().id()).name()) - .arg(file->currency(foreignCurrency).name()) - .arg(date.toString()) - .arg(result.toDouble())); + DEBUG_OUTPUT(TQString("Converting deep %1 to currency %2, price on %3 is %4") + .tqarg(file->currency(currency().id()).name()) + .tqarg(file->currency(foreignCurrency).name()) + .tqarg(date.toString()) + .tqarg(result.toDouble())); } else { - DEBUG_OUTPUT(QString("No price to convert deep %1 to currency %2 on %3") - .arg(file->currency(currency().id()).name()) - .arg(file->currency(foreignCurrency).name()) - .arg(date.toString())); + DEBUG_OUTPUT(TQString("No price to convert deep %1 to currency %2 on %3") + .tqarg(file->currency(currency().id()).name()) + .tqarg(file->currency(foreignCurrency).name()) + .tqarg(date.toString())); } } return result; @@ -232,8 +232,8 @@ bool ReportAccount::operator<(const ReportAccount& second) const bool result = false; bool haveresult = false; - QStringList::const_iterator it_first = m_nameHierarchy.begin(); - QStringList::const_iterator it_second = second.m_nameHierarchy.begin(); + TQStringList::const_iterator it_first = m_nameHierarchy.begin(); + TQStringList::const_iterator it_second = second.m_nameHierarchy.begin(); while ( it_first != m_nameHierarchy.end() ) { // The first string is longer than the second, but otherwise identical @@ -265,7 +265,7 @@ bool ReportAccount::operator<(const ReportAccount& second) const if ( !haveresult && ( it_second != second.m_nameHierarchy.end() ) ) result = true; -// DEBUG_OUTPUT(QString("%1 < %2 is %3").arg(debugName(),second.debugName()).arg(result)); +// DEBUG_OUTPUT(TQString("%1 < %2 is %3").tqarg(debugName(),second.debugName()).tqarg(result)); return result; } @@ -274,21 +274,21 @@ bool ReportAccount::operator<(const ReportAccount& second) const * method only returns the last name in the list, which is the engine name] * of this account. * - * @return QString The account's name + * @return TQString The account's name */ -QString ReportAccount::name( void ) const +TQString ReportAccount::name( void ) const { return m_nameHierarchy.back(); } // MyMoneyAccount:fullHierarchyDebug() -QString ReportAccount::debugName( void ) const +TQString ReportAccount::debugName( void ) const { return m_nameHierarchy.join("|"); } // MyMoneyAccount:fullHierarchy() -QString ReportAccount::fullName( void ) const +TQString ReportAccount::fullName( void ) const { return m_nameHierarchy.join(": "); } @@ -305,9 +305,9 @@ unsigned ReportAccount::hierarchyDepth( void ) const return ( m_nameHierarchy.size() ); } -ReportAccount ReportAccount::parent( void ) const +ReportAccount ReportAccount::tqparent( void ) const { - return ReportAccount( parentAccountId() ); + return ReportAccount( tqparentAccountId() ); } ReportAccount ReportAccount::topParent( void ) const @@ -315,22 +315,22 @@ ReportAccount ReportAccount::topParent( void ) const DEBUG_ENTER(__PRETTY_FUNCTION__); MyMoneyFile* file = MyMoneyFile::instance(); - QString resultid = id(); - QString parentid = parentAccountId(); + TQString resultid = id(); + TQString tqparentid = tqparentAccountId(); - while (!file->isStandardAccount(parentid)) + while (!file->isStandardAccount(tqparentid)) { - // take on the identity of our parent - resultid = parentid; + // take on the identity of our tqparent + resultid = tqparentid; // and try again - parentid = file->account(resultid).parentAccountId(); + tqparentid = file->account(resultid).tqparentAccountId(); } return ReportAccount( resultid ); } -QString ReportAccount::topParentName( void ) const +TQString ReportAccount::topParentName( void ) const { return m_nameHierarchy.first(); } diff --git a/kmymoney2/reports/reportaccount.h b/kmymoney2/reports/reportaccount.h index e07f9b1..91db6a2 100644 --- a/kmymoney2/reports/reportaccount.h +++ b/kmymoney2/reports/reportaccount.h @@ -22,7 +22,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include +#include // ---------------------------------------------------------------------------- // KDE Includes @@ -54,20 +54,20 @@ namespace reports { class ReportAccount: public MyMoneyAccount { private: - QStringList m_nameHierarchy; + TQStringList m_nameHierarchy; public: /** * Default constructor * - * Needed to allow this object to be stored in a QMap. + * Needed to allow this object to be stored in a TQMap. */ ReportAccount( void ); /** * Copy constructor * - * Needed to allow this object to be stored in a QMap. + * Needed to allow this object to be stored in a TQMap. */ ReportAccount( const ReportAccount& ); @@ -76,7 +76,7 @@ public: * * @param accountid Account which this account descriptor should be based off of */ - ReportAccount( const QString& accountid ); + ReportAccount( const TQString& accountid ); /** * Regular constructor @@ -110,7 +110,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney deepCurrencyPrice( const QDate& date ) const; + MyMoneyMoney deepCurrencyPrice( const TQDate& date ) const; /** * Returns the price of this account's deep currency on the indicated date, @@ -119,7 +119,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney baseCurrencyPrice( const QDate& date ) const; + MyMoneyMoney baseCurrencyPrice( const TQDate& date ) const; /** * Returns the price of this account's deep currency on the indicated date, @@ -129,7 +129,7 @@ public: * @param date The date in question * @return MyMoneyMoney The value of the account's currency on that date */ - MyMoneyMoney foreignCurrencyPrice( const QString foreignCurrency, const QDate& date ) const; + MyMoneyMoney foreignCurrencyPrice( const TQString foreignCurrency, const TQDate& date ) const; /** * Fetch the trading symbol of this account's deep currency @@ -151,9 +151,9 @@ public: * method only returns the last name in the list, which is the engine name] * of this account. * - * @return QString The account's name + * @return TQString The account's name */ - QString name( void ) const; + TQString name( void ) const; /** * The entire hierarchy of this account descriptor @@ -161,52 +161,52 @@ public: * to always look pretty, while fullName() is. So if the user is ever * going to see the results, use fullName(). * - * @return QString The account's full hierarchy + * @return TQString The account's full hierarchy */ - QString fullName( void ) const; + TQString fullName( void ) const; /** * The entire hierarchy of this account descriptor, suitable for displaying * in debugging output * - * @return QString The account's full hierarchy (suitable for debugging) + * @return TQString The account's full hierarchy (suitable for debugging) */ - QString debugName( void ) const; + TQString debugName( void ) const; /** - * Whether this account is a 'top level' parent account. This means that - * it's parent is an account class, like asset, liability, expense or income + * Whether this account is a 'top level' tqparent account. This means that + * it's tqparent is an account class, like asset, liability, expense or income * - * @return bool True if this account is a top level parent account + * @return bool True if this account is a top level tqparent account */ /*inline*/ bool isTopLevel( void ) const; /** - * Returns the name of the top level parent account + * Returns the name of the top level tqparent account * - * (See isTopLevel for a definition of 'top level parent') + * (See isTopLevel for a definition of 'top level tqparent') * - * @return QString The name of the top level parent account + * @return TQString The name of the top level tqparent account */ - /*inline*/ QString topParentName( void ) const; + /*inline*/ TQString topParentName( void ) const; /** - * Returns a report account containing the top parent account + * Returns a report account containing the top tqparent account * - * @return ReportAccount The account of the top parent + * @return ReportAccount The account of the top tqparent */ ReportAccount topParent( void ) const; /** - * Returns a report account containing the immediate parent account + * Returns a report account containing the immediate tqparent account * - * @return ReportAccount The account of the immediate parent + * @return ReportAccount The account of the immediate tqparent */ - ReportAccount parent( void ) const; + ReportAccount tqparent( void ) const; /** * Returns the number of accounts in this account's hierarchy. If this is a - * Top Category, it returns 1. If it's parent is a Top Category, returns 2, + * Top Category, it returns 1. If it's tqparent is a Top Category, returns 2, * etc. * * @return unsigned Hierarchy depth diff --git a/kmymoney2/reports/reportdebug.h b/kmymoney2/reports/reportdebug.h index 3a95465..2e822d0 100644 --- a/kmymoney2/reports/reportdebug.h +++ b/kmymoney2/reports/reportdebug.h @@ -49,7 +49,7 @@ namespace reports { #define DEBUG_ENABLE(x) Debug::enable(x) #define DEBUG_ENABLE_KEY(x) Debug::setEnableKey(x) #ifdef DEBUG_HIDE_SENSITIVE -#define DEBUG_SENSITIVE(x) QString("hidden") +#define DEBUG_SENSITIVE(x) TQString("hidden") #else #define DEBUG_SENSITIVE(x) (x) #endif @@ -65,17 +65,17 @@ namespace reports { class Debug { - QString m_methodName; - static QString m_sTabs; + TQString m_methodName; + static TQString m_sTabs; static bool m_sEnabled; bool m_enabled; - static QString m_sEnableKey; + static TQString m_sEnableKey; public: - Debug( const QString& _name ); + Debug( const TQString& _name ); ~Debug(); - void output( const QString& _text ); + void output( const TQString& _text ); static void enable( bool _e ) { m_sEnabled = _e; } - static void setEnableKey( const QString& _s ) { m_sEnableKey = _s; } + static void setEnableKey( const TQString& _s ) { m_sEnableKey = _s; } }; } // end namespace reports diff --git a/kmymoney2/reports/reportstestcommon.cpp b/kmymoney2/reports/reportstestcommon.cpp index 31e6c1d..7d42abc 100644 --- a/kmymoney2/reports/reportstestcommon.cpp +++ b/kmymoney2/reports/reportstestcommon.cpp @@ -15,10 +15,10 @@ * * ***************************************************************************/ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -31,7 +31,7 @@ #define private public #include "pivottable.h" -#include "querytable.h" +#include "tquerytable.h" #undef private using namespace reports; @@ -58,35 +58,35 @@ const MyMoneyMoney moChild(14.00); const MyMoneyMoney moThomas(5.11); const MyMoneyMoney moNoPayee(8944.70); -QString acAsset; -QString acLiability; -QString acExpense; -QString acIncome; -QString acChecking; -QString acCredit; -QString acSolo; -QString acParent; -QString acChild; -QString acSecondChild; -QString acGrandChild1; -QString acGrandChild2; -QString acForeign; -QString acCanChecking; -QString acJpyChecking; -QString acCanCash; -QString acJpyCash; -QString inBank; -QString eqStock1; -QString eqStock2; -QString acInvestment; -QString acStock1; -QString acStock2; -QString acDividends; -QString acInterest; -QString acTax; -QString acCash; - -TransactionHelper::TransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _value, const QString& _accountid, const QString& _categoryid, const QString& _currencyid, const QString& _payee ) +TQString acAsset; +TQString acLiability; +TQString acExpense; +TQString acIncome; +TQString acChecking; +TQString acCredit; +TQString acSolo; +TQString acParent; +TQString acChild; +TQString acSecondChild; +TQString acGrandChild1; +TQString acGrandChild2; +TQString acForeign; +TQString acCanChecking; +TQString acJpyChecking; +TQString acCanCash; +TQString acJpyCash; +TQString inBank; +TQString eqStock1; +TQString eqStock2; +TQString acInvestment; +TQString acStock1; +TQString acStock2; +TQString acDividends; +TQString acInterest; +TQString acTax; +TQString acCash; + +TransactionHelper::TransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _value, const TQString& _accountid, const TQString& _categoryid, const TQString& _currencyid, const TQString& _payee ) { // _currencyid is the currency of the transaction, and of the _value // both the account and category can have their own currency (athough the category having @@ -100,7 +100,7 @@ TransactionHelper::TransactionHelper( const QDate& _date, const QString& _action MyMoneyFileTransaction ft; setPostDate(_date); - QString currencyid = _currencyid; + TQString currencyid = _currencyid; if ( currencyid.isEmpty() ) currencyid=MyMoneyFile::instance()->baseCurrency().id(); setCommodity(currencyid); @@ -144,12 +144,12 @@ void TransactionHelper::update(void) ft.commit(); } -InvTransactionHelper::InvTransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ) +InvTransactionHelper::InvTransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ) { init(_date, _action, _shares, _price, _stockaccountid, _transferid, _categoryid); } -void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ) +void InvTransactionHelper::init( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _price, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount stockaccount = file->account(_stockaccountid); @@ -216,8 +216,8 @@ void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyM //kdDebug(2) << "updating price..." << endl; // update the price, while we're here - QString stockid = stockaccount.currencyId(); - QString basecurrencyid = file->baseCurrency().id(); + TQString stockid = stockaccount.currencyId(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( stockid, basecurrencyid, _date, true ); if ( !price.isValid() ) { @@ -228,7 +228,7 @@ void InvTransactionHelper::init( const QDate& _date, const QString& _action, MyM //kdDebug(2) << "successfully added " << id() << endl; } -QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const QDate& _open, const QString& _parent, QString _currency, bool _taxReport ) +TQString makeAccount( const TQString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const TQDate& _open, const TQString& _parent, TQString _currency, bool _taxReport ) { MyMoneyAccount info; MyMoneyFileTransaction ft; @@ -244,8 +244,8 @@ QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, M if(_taxReport) info.setValue("Tax", "Yes"); - MyMoneyAccount parent = MyMoneyFile::instance()->account(_parent); - MyMoneyFile::instance()->addAccount( info, parent ); + MyMoneyAccount tqparent = MyMoneyFile::instance()->account(_parent); + MyMoneyFile::instance()->addAccount( info, tqparent ); // create the opening balance transaction if any if(!_balance.isZero()) { MyMoneySecurity sec = MyMoneyFile::instance()->currency(info.currencyId()); @@ -257,7 +257,7 @@ QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, M return info.id(); } -void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMoney& _price ) +void makePrice(const TQString& _currencyid, const TQDate& _date, const MyMoneyMoney& _price ) { MyMoneyFileTransaction ft; MyMoneyFile* file = MyMoneyFile::instance(); @@ -267,7 +267,7 @@ void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMone ft.commit(); } -QString makeEquity(const QString& _name, const QString& _symbol ) +TQString makeEquity(const TQString& _name, const TQString& _symbol ) { MyMoneySecurity equity; MyMoneyFileTransaction ft; @@ -282,11 +282,11 @@ QString makeEquity(const QString& _name, const QString& _symbol ) return equity.id(); } -void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& _price ) +void makeEquityPrice(const TQString& _id, const TQDate& _date, const MyMoneyMoney& _price ) { MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyFileTransaction ft; - QString basecurrencyid = file->baseCurrency().id(); + TQString basecurrencyid = file->baseCurrency().id(); MyMoneyPrice price = file->price( _id, basecurrencyid, _date, true ); if ( !price.isValid() ) { @@ -296,114 +296,114 @@ void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& ft.commit(); } -void writeRCFtoXMLDoc( const MyMoneyReport& filter, QDomDocument* doc ) +void writeRCFtoXMLDoc( const MyMoneyReport& filter, TQDomDocument* doc ) { - QDomProcessingInstruction instruct = doc->createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\"")); + TQDomProcessingInstruction instruct = doc->createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\"")); doc->appendChild(instruct); - QDomElement root = doc->createElement("KMYMONEY-FILE"); + TQDomElement root = doc->createElement("KMYMONEY-FILE"); doc->appendChild(root); - QDomElement reports = doc->createElement("REPORTS"); + TQDomElement reports = doc->createElement("REPORTS"); root.appendChild(reports); - QDomElement report = doc->createElement("REPORT"); + TQDomElement report = doc->createElement("REPORT"); filter.write(report,doc); reports.appendChild(report); } -void writeTabletoHTML( const PivotTable& table, const QString& _filename ) +void writeTabletoHTML( const PivotTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.html").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.html").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderHTML(); + TQTextStream(&g) << table.renderHTML(); g.close(); } -void writeTabletoHTML( const QueryTable& table, const QString& _filename ) +void writeTabletoHTML( const QueryTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.html").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.html").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderHTML(); + TQTextStream(&g) << table.renderHTML(); g.close(); } -void writeTabletoCSV( const PivotTable& table, const QString& _filename ) +void writeTabletoCSV( const PivotTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.csv").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("report-%1%2.csv").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderCSV(); + TQTextStream(&g) << table.renderCSV(); g.close(); } -void writeTabletoCSV( const QueryTable& table, const QString& _filename ) +void writeTabletoCSV( const QueryTable& table, const TQString& _filename ) { static unsigned filenumber = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("qreport-%1%2.csv").arg((filenumber<10)?"0":"").arg(filenumber); + filename = TQString("qreport-%1%2.csv").tqarg((filenumber<10)?"0":"").tqarg(filenumber); ++filenumber; } - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream(&g) << table.renderCSV(); + TQTextStream(&g) << table.renderCSV(); g.close(); } -void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename ) +void writeRCFtoXML( const MyMoneyReport& filter, const TQString& _filename ) { static unsigned filenum = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("report-%1%2.xml").arg(QString::number(filenum).rightJustify(2, '0')); + filename = TQString("report-%1%2.xml").tqarg(TQString::number(filenum).rightJustify(2, '0')); ++filenum; } - QDomDocument* doc = new QDomDocument("KMYMONEY-FILE"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(doc); writeRCFtoXMLDoc(filter,doc); - QFile g( filename ); + TQFile g( filename ); g.open( IO_WriteOnly ); - QTextStream stream(&g); + TQTextStream stream(&g); #if KDE_IS_VERSION(3,2,0) - stream.setEncoding(QTextStream::UnicodeUTF8); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << doc->toString(); #else - //stream.setEncoding(QTextStream::Locale); - QString temp = doc->toString(); + //stream.setEncoding(TQTextStream::Locale); + TQString temp = doc->toString(); stream << temp.data(); #endif g.close(); @@ -411,21 +411,21 @@ void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename ) delete doc; } -bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ) +bool readRCFfromXMLDoc( TQValueList& list, TQDomDocument* doc ) { bool result = false; - QDomElement rootElement = doc->documentElement(); + TQDomElement rootElement = doc->documentElement(); if(!rootElement.isNull()) { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); if("REPORTS" == childElement.tagName()) { result = true; - QDomNode subchild = child.firstChild(); + TQDomNode subchild = child.firstChild(); while(!subchild.isNull() && subchild.isElement()) { MyMoneyReport filter; @@ -442,12 +442,12 @@ bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ) return result; } -bool readRCFfromXML( QValueList& list, const QString& filename ) +bool readRCFfromXML( TQValueList& list, const TQString& filename ) { int result = false; - QFile f( filename ); + TQFile f( filename ); f.open( IO_ReadOnly ); - QDomDocument* doc = new QDomDocument; + TQDomDocument* doc = new TQDomDocument; if(doc->setContent(&f, FALSE)) { result = readRCFfromXMLDoc(list,doc); @@ -465,11 +465,11 @@ void XMLandback( MyMoneyReport& filter ) // in all cases, the result should be the same if the read // & write methods are working correctly. - QDomDocument* doc = new QDomDocument("KMYMONEY-FILE"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(doc); writeRCFtoXMLDoc(filter,doc); - QValueList list; + TQValueList list; if ( readRCFfromXMLDoc(list,doc) && list.count() > 0 ) filter = list[0]; else @@ -479,11 +479,11 @@ void XMLandback( MyMoneyReport& filter ) } -MyMoneyMoney searchHTML(const QString& _html, const QString& _search) +MyMoneyMoney searchHTML(const TQString& _html, const TQString& _search) { - QRegExp re(QString("%1[<>/td]*([\\-.0-9,]*)").arg(_search)); + TQRegExp re(TQString("%1[<>/td]*([\\-.0-9,]*)").tqarg(_search)); re.search(_html); - QString found = re.cap(1); + TQString found = re.cap(1); found.remove(','); return MyMoneyMoney(found.toDouble()); diff --git a/kmymoney2/reports/reportstestcommon.h b/kmymoney2/reports/reportstestcommon.h index 6f4826e..a3f40fd 100644 --- a/kmymoney2/reports/reportstestcommon.h +++ b/kmymoney2/reports/reportstestcommon.h @@ -18,8 +18,8 @@ #ifndef REPORTSTESTCOMMON_H #define REPORTSTESTCOMMON_H -#include -class QDomDocument; +#include +class TQDomDocument; #include "../mymoney/mymoneyaccount.h" #include "../mymoney/mymoneytransaction.h" @@ -46,40 +46,40 @@ extern const MyMoneyMoney moChild; extern const MyMoneyMoney moThomas; extern const MyMoneyMoney moNoPayee; -extern QString acAsset; -extern QString acLiability; -extern QString acExpense; -extern QString acIncome; -extern QString acChecking; -extern QString acCredit; -extern QString acSolo; -extern QString acParent; -extern QString acChild; -extern QString acSecondChild; -extern QString acGrandChild1; -extern QString acGrandChild2; -extern QString acForeign; -extern QString acCanChecking; -extern QString acJpyChecking; -extern QString acCanCash; -extern QString acJpyCash; -extern QString inBank; -extern QString eqStock1; -extern QString eqStock2; -extern QString acInvestment; -extern QString acStock1; -extern QString acStock2; -extern QString acDividends; -extern QString acInterest; -extern QString acTax; -extern QString acCash; +extern TQString acAsset; +extern TQString acLiability; +extern TQString acExpense; +extern TQString acIncome; +extern TQString acChecking; +extern TQString acCredit; +extern TQString acSolo; +extern TQString acParent; +extern TQString acChild; +extern TQString acSecondChild; +extern TQString acGrandChild1; +extern TQString acGrandChild2; +extern TQString acForeign; +extern TQString acCanChecking; +extern TQString acJpyChecking; +extern TQString acCanCash; +extern TQString acJpyCash; +extern TQString inBank; +extern TQString eqStock1; +extern TQString eqStock2; +extern TQString acInvestment; +extern TQString acStock1; +extern TQString acStock2; +extern TQString acDividends; +extern TQString acInterest; +extern TQString acTax; +extern TQString acCash; class TransactionHelper: public MyMoneyTransaction { private: - QString m_id; + TQString m_id; public: - TransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _value, const QString& _accountid, const QString& _categoryid, const QString& _currencyid = QString(), const QString& _payee="Test Payee" ); + TransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _value, const TQString& _accountid, const TQString& _categoryid, const TQString& _currencyid = TQString(), const TQString& _payee="Test Payee" ); ~TransactionHelper(); void update(void); protected: @@ -89,42 +89,42 @@ protected: class InvTransactionHelper: public TransactionHelper { public: - InvTransactionHelper( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ); - void init( const QDate& _date, const QString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const QString& _stockaccountid, const QString& _transferid, const QString& _categoryid ); + InvTransactionHelper( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ); + void init( const TQDate& _date, const TQString& _action, MyMoneyMoney _shares, MyMoneyMoney _value, const TQString& _stockaccountid, const TQString& _transferid, const TQString& _categoryid ); }; class BudgetEntryHelper { private: - QDate m_date; - QString m_categoryid; + TQDate m_date; + TQString m_categoryid; bool m_applytosub; MyMoneyMoney m_amount; public: BudgetEntryHelper( void ): m_applytosub(false) {} - BudgetEntryHelper( const QDate& _date, const QString& _categoryid, bool _applytosub, const MyMoneyMoney& _amount ): m_date(_date), m_categoryid(_categoryid), m_applytosub(_applytosub), m_amount(_amount) {} + BudgetEntryHelper( const TQDate& _date, const TQString& _categoryid, bool _applytosub, const MyMoneyMoney& _amount ): m_date(_date), m_categoryid(_categoryid), m_applytosub(_applytosub), m_amount(_amount) {} }; -class BudgetHelper: public QValueList +class BudgetHelper: public TQValueList { - MyMoneyMoney budgetAmount( const QDate& _date, const QString& _categoryid, bool& _applytosub ); + MyMoneyMoney budgetAmount( const TQDate& _date, const TQString& _categoryid, bool& _applytosub ); }; -extern QString makeAccount( const QString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const QDate& _open, const QString& _parent, QString _currency="", bool _taxReport = false ); -extern void makePrice(const QString& _currencyid, const QDate& _date, const MyMoneyMoney& _price ); -QString makeEquity(const QString& _name, const QString& _symbol ); -extern void makeEquityPrice(const QString& _id, const QDate& _date, const MyMoneyMoney& _price ); -extern void writeRCFtoXMLDoc( const MyMoneyReport& filter, QDomDocument* doc ); -extern void writeTabletoHTML( const reports::PivotTable& table, const QString& _filename = QString() ); -extern void writeTabletoHTML( const reports::QueryTable& table, const QString& _filename = QString() ); -extern void writeTabletoCSV( const reports::PivotTable& table, const QString& _filename = QString() ); -extern void writeTabletoCSV( const reports::QueryTable& table, const QString& _filename = QString() ); -extern void writeRCFtoXML( const MyMoneyReport& filter, const QString& _filename = QString() ); -extern bool readRCFfromXMLDoc( QValueList& list, QDomDocument* doc ); -extern bool readRCFfromXML( QValueList& list, const QString& filename ); +extern TQString makeAccount( const TQString& _name, MyMoneyAccount::accountTypeE _type, MyMoneyMoney _balance, const TQDate& _open, const TQString& _parent, TQString _currency="", bool _taxReport = false ); +extern void makePrice(const TQString& _currencyid, const TQDate& _date, const MyMoneyMoney& _price ); +TQString makeEquity(const TQString& _name, const TQString& _symbol ); +extern void makeEquityPrice(const TQString& _id, const TQDate& _date, const MyMoneyMoney& _price ); +extern void writeRCFtoXMLDoc( const MyMoneyReport& filter, TQDomDocument* doc ); +extern void writeTabletoHTML( const reports::PivotTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoHTML( const reports::QueryTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoCSV( const reports::PivotTable& table, const TQString& _filename = TQString() ); +extern void writeTabletoCSV( const reports::QueryTable& table, const TQString& _filename = TQString() ); +extern void writeRCFtoXML( const MyMoneyReport& filter, const TQString& _filename = TQString() ); +extern bool readRCFfromXMLDoc( TQValueList& list, TQDomDocument* doc ); +extern bool readRCFfromXML( TQValueList& list, const TQString& filename ); extern void XMLandback( MyMoneyReport& filter ); -extern MyMoneyMoney searchHTML(const QString& _html, const QString& _search); +extern MyMoneyMoney searchHTML(const TQString& _html, const TQString& _search); } // end namespace test diff --git a/kmymoney2/reports/reporttable.h b/kmymoney2/reports/reporttable.h index 3bab330..a05ff51 100644 --- a/kmymoney2/reports/reporttable.h +++ b/kmymoney2/reports/reporttable.h @@ -42,10 +42,10 @@ protected: ReportTable() {} public: virtual ~ReportTable() {} - virtual QString renderHTML(void) const = 0; - virtual QString renderCSV(void) const = 0; + virtual TQString renderHTML(void) const = 0; + virtual TQString renderCSV(void) const = 0; virtual void drawChart(KReportChartView& view) const = 0; - virtual void dump(const QString& file, const QString& context=QString()) const = 0; + virtual void dump(const TQString& file, const TQString& context=TQString()) const = 0; }; } -- cgit v1.2.1