Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/checkbook/traninfo.cpp | 25 |
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 | |||
@@ -30,6 +30,8 @@ | |||
30 | 30 | ||
31 | #include <qpe/config.h> | 31 | #include <qpe/config.h> |
32 | 32 | ||
33 | QString tempstr; | ||
34 | |||
33 | TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal, | 35 | TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdrawal, |
34 | const QString &type, const QString &category, float amount, | 36 | const QString &type, const QString &category, float amount, |
35 | float fee, const QString &number, const QString ¬es ) | 37 | float fee, const QString &number, const QString ¬es ) |
@@ -117,15 +119,32 @@ TranInfo::TranInfo( Config config, int entry ) | |||
117 | } | 119 | } |
118 | } | 120 | } |
119 | 121 | ||
122 | const QString &TranInfo::datestr() | ||
123 | { | ||
124 | tempstr = QString::number( td.year() ); | ||
125 | tempstr.append( '/' ); | ||
126 | int tempfield = td.month(); | ||
127 | if ( tempfield < 10 ) tempstr.append( '0' ); | ||
128 | tempstr.append( QString::number( tempfield ) ); | ||
129 | tempstr.append( '/' ); | ||
130 | tempfield = td.day(); | ||
131 | if ( tempfield < 10 ) tempstr.append( '0' ); | ||
132 | tempstr.append( QString::number( tempfield ) ); | ||
133 | |||
134 | return( tempstr ); | ||
135 | } | ||
136 | |||
120 | void TranInfo::write( Config *config, int entry ) | 137 | void TranInfo::write( Config *config, int entry ) |
121 | { | 138 | { |
122 | config->setGroup( QString::number( entry ) ); | 139 | config->setGroup( QString::number( entry ) ); |
123 | 140 | ||
124 | config->writeEntry( "Description", d ); | 141 | config->writeEntry( "Description", d ); |
125 | 142 | ||
126 | QString tempstr = QString::number( td.month() ) + "/" + | 143 | tempstr = QString::number( td.month() ); |
127 | QString::number( td.day() ) + "/" + | 144 | tempstr.append( '/' ); |
128 | QString::number( td.year() ); | 145 | tempstr.append( QString::number( td.day() ) ); |
146 | tempstr.append( '/' ); | ||
147 | tempstr.append( QString::number( td.year() ) ); | ||
129 | config->writeEntry( "Date", tempstr ); | 148 | config->writeEntry( "Date", tempstr ); |
130 | 149 | ||
131 | w ? tempstr = "true" | 150 | w ? tempstr = "true" |