Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/traninfo.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp index 4833af9..7bd2004 100644 --- a/noncore/apps/checkbook/traninfo.cpp +++ b/noncore/apps/checkbook/traninfo.cpp @@ -41,95 +41,95 @@ TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdra d = desc; td = date; w = withdrawal; t = type; c = category; a = amount; f = fee; cn = number; n = notes; _next=next; } -TranInfo::TranInfo( Config config, int entry ) +TranInfo::TranInfo( Config *config, int entry ) { - config.setGroup( QString::number( entry ) ); - QString desc = config.readEntry( "Description", "Not Found" ); + config->setGroup( QString::number( entry ) ); + QString desc = config->readEntry( "Description", "Not Found" ); if ( desc != "Not Found" ) { // ID i = entry; // Description d = desc; // Transaction date int yr, mn, dy; - QString datestr = config.readEntry( "Date", "" ); + QString datestr = config->readEntry( "Date", "" ); int begin, end; begin = datestr.find( '/' ); mn = datestr.left( begin ).toInt(); end = datestr.find( '/', ++begin ); dy = datestr.mid( begin, end - begin ).toInt(); yr = datestr.right( datestr.length() - end - 1).toInt(); td.setYMD( yr, mn, dy ); // Deposit/withdrawal indicator ( withdrawal == TRUE ) - w = ( config.readEntry( "Payment", "false" ) == "true" ); + w = ( config->readEntry( "Payment", "false" ) == "true" ); // Type - QString type = config.readEntry( "Type", "0" ); + QString type = config->readEntry( "Type", "0" ); if ( w ) { // Withdrawal types if( type == "0" ) t = "Debit Charge"; else if( type == "1" ) t = "Written Check"; else if( type == "2" ) t = "Transfer"; else if( type == "3" ) t = "Credit Card"; } else { if( type == "0" ) t = "Written Check"; else if( type == "1" ) t = "Automatic Payment"; else if( type == "2" ) t = "Transfer"; else if( type == "3" ) t = "Cash"; } // Category - c = config.readEntry( "Category", "" ); + c = config->readEntry( "Category", "" ); // Transaction amount - QString stramount = config.readEntry( "Amount", "0.00" ); + QString stramount = config->readEntry( "Amount", "0.00" ); bool ok; a = stramount.toFloat( &ok ); // Transaction fee - stramount = config.readEntry( "TransactionFee", "0.00" ); + stramount = config->readEntry( "TransactionFee", "0.00" ); f = stramount.toFloat( &ok ); // Transaction number - cn = config.readEntry( "CheckNumber", "" ); + cn = config->readEntry( "CheckNumber", "" ); // Notes - n = config.readEntry( "Comments", "" ); + n = config->readEntry( "Comments", "" ); // next - _next = config.readNumEntry("Next", -1); + _next = config->readNumEntry("Next", -1); } } // --- datestr ---------------------------------------------------------------- const QString &TranInfo::datestr(bool bDisplayDate) { if( bDisplayDate ) { tempstr=TimeString::numberDateString( td ); } else { tempstr.sprintf( "%04d-%02d-%02d", td.year() ,td.month(), td.day() ); } return(tempstr); |