summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/traninfo.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/traninfo.cpp25
1 files changed, 22 insertions, 3 deletions
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
@@ -27,12 +27,14 @@
*/
#include "traninfo.h"
#include <qpe/config.h>
+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 &notes )
{
i = id;
d = desc;
@@ -114,21 +116,38 @@ TranInfo::TranInfo( Config config, int entry )
// Notes
n = config.readEntry( "Comments", "" );
}
}
+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"
: tempstr = "false";
config->writeEntry( "Payment", tempstr );