author | drw <drw> | 2002-11-02 01:29:30 (UTC) |
---|---|---|
committer | drw <drw> | 2002-11-02 01:29:30 (UTC) |
commit | bf9388acdebf6e55345dff3bd1cd652b45a2202a (patch) (unidiff) | |
tree | 737ca55c9a30a1dde3aa289fd99cac7e4c30a3f7 /noncore/apps/checkbook/traninfo.cpp | |
parent | 6e9225388baa9dfac4ed09f22189cfa98a610d39 (diff) | |
download | opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.zip opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.tar.gz opie-bf9388acdebf6e55345dff3bd1cd652b45a2202a.tar.bz2 |
Code updates/fixes
Diffstat (limited to 'noncore/apps/checkbook/traninfo.cpp') (more/less context) (ignore 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 | |||
@@ -27,12 +27,14 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "traninfo.h" | 29 | #include "traninfo.h" |
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 ) |
36 | { | 38 | { |
37 | i = id; | 39 | i = id; |
38 | d = desc; | 40 | d = desc; |
@@ -114,21 +116,38 @@ TranInfo::TranInfo( Config config, int entry ) | |||
114 | 116 | ||
115 | // Notes | 117 | // Notes |
116 | n = config.readEntry( "Comments", "" ); | 118 | n = config.readEntry( "Comments", "" ); |
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" |
132 | : tempstr = "false"; | 151 | : tempstr = "false"; |
133 | config->writeEntry( "Payment", tempstr ); | 152 | config->writeEntry( "Payment", tempstr ); |
134 | 153 | ||