-rw-r--r-- | noncore/apps/checkbook/checkbook.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/checkbook/traninfo.cpp | 15 | ||||
-rw-r--r-- | noncore/apps/checkbook/traninfo.h | 8 |
3 files changed, 25 insertions, 4 deletions
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp index 77c1f57..ab25516 100644 --- a/noncore/apps/checkbook/checkbook.cpp +++ b/noncore/apps/checkbook/checkbook.cpp | |||
@@ -313,3 +313,3 @@ void Checkbook::loadCheckbook() | |||
313 | // Add to transaction list | 313 | // Add to transaction list |
314 | transactions.append( tran ); | 314 | transactions.inSort( tran ); |
315 | 315 | ||
@@ -417,3 +417,3 @@ void Checkbook::slotNewTran() | |||
417 | // Add to transaction list | 417 | // Add to transaction list |
418 | transactions.append( traninfo ); | 418 | transactions.inSort( traninfo ); |
419 | 419 | ||
@@ -564,3 +564,3 @@ void Checkbook::drawCategoryChart( bool withdrawals ) | |||
564 | TranInfo *tran = transactions.first(); | 564 | TranInfo *tran = transactions.first(); |
565 | if ( tran->withdrawal() == withdrawals ) | 565 | if ( tran && tran->withdrawal() == withdrawals ) |
566 | { | 566 | { |
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp index 460466c..dcba869 100644 --- a/noncore/apps/checkbook/traninfo.cpp +++ b/noncore/apps/checkbook/traninfo.cpp | |||
@@ -175 +175,16 @@ void TranInfo::write( Config *config, int entry ) | |||
175 | } | 175 | } |
176 | |||
177 | int TranInfoList::compareItems( QCollection::Item item1, QCollection::Item item2 ) | ||
178 | { | ||
179 | QDate d1 = ((TranInfo *)item1)->date(); | ||
180 | QDate d2 = ((TranInfo *)item2)->date(); | ||
181 | int r = -1; | ||
182 | |||
183 | if ( d1 < d2 ) | ||
184 | r = -1; | ||
185 | else if ( d1 == d2 ) | ||
186 | r = 0; | ||
187 | else if ( d1 > d2 ) | ||
188 | r = 1; | ||
189 | return( r ); | ||
190 | } \ No newline at end of file | ||
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h index e944c29..e488816 100644 --- a/noncore/apps/checkbook/traninfo.h +++ b/noncore/apps/checkbook/traninfo.h | |||
@@ -83,3 +83,9 @@ class TranInfo | |||
83 | 83 | ||
84 | typedef QList<TranInfo> TranInfoList; | 84 | class TranInfoList : public QList<TranInfo> |
85 | { | ||
86 | protected: | ||
87 | int compareItems( QCollection::Item, QCollection::Item ); | ||
88 | }; | ||
89 | |||
90 | //typedef TranList<TranInfo> TranInfoList; | ||
85 | 91 | ||