From bf9388acdebf6e55345dff3bd1cd652b45a2202a Mon Sep 17 00:00:00 2001 From: drw Date: Sat, 02 Nov 2002 01:29:30 +0000 Subject: Code updates/fixes --- (limited to 'noncore/apps/checkbook/traninfo.cpp') diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp index 5a770b0..460466c 100644 --- a/noncore/apps/checkbook/traninfo.cpp +++ b/noncore/apps/checkbook/traninfo.cpp @@ -30,6 +30,8 @@ #include +QString tempstr; + TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal, const QString &type, const QString &category, float amount, float fee, const QString &number, const QString ¬es ) @@ -117,15 +119,32 @@ TranInfo::TranInfo( Config config, int entry ) } } +const QString &TranInfo::datestr() +{ + tempstr = QString::number( td.year() ); + tempstr.append( '/' ); + int tempfield = td.month(); + if ( tempfield < 10 ) tempstr.append( '0' ); + tempstr.append( QString::number( tempfield ) ); + tempstr.append( '/' ); + tempfield = td.day(); + if ( tempfield < 10 ) tempstr.append( '0' ); + tempstr.append( QString::number( tempfield ) ); + + return( tempstr ); +} + void TranInfo::write( Config *config, int entry ) { config->setGroup( QString::number( entry ) ); config->writeEntry( "Description", d ); - QString tempstr = QString::number( td.month() ) + "/" + - QString::number( td.day() ) + "/" + - QString::number( td.year() ); + tempstr = QString::number( td.month() ); + tempstr.append( '/' ); + tempstr.append( QString::number( td.day() ) ); + tempstr.append( '/' ); + tempstr.append( QString::number( td.year() ) ); config->writeEntry( "Date", tempstr ); w ? tempstr = "true" -- cgit v0.9.0.2