summaryrefslogtreecommitdiff
authordrw <drw>2005-03-10 21:39:47 (UTC)
committer drw <drw>2005-03-10 21:39:47 (UTC)
commit5a276878608d30e2cdc2eb35ad7c45ed0c348f58 (patch) (side-by-side diff)
tree93ff7eac4949b70ae25f60f4586e7490425134db
parentd798f87314392033ad1e18d01927c622aa4d9b02 (diff)
downloadopie-5a276878608d30e2cdc2eb35ad7c45ed0c348f58.zip
opie-5a276878608d30e2cdc2eb35ad7c45ed0c348f58.tar.gz
opie-5a276878608d30e2cdc2eb35ad7c45ed0c348f58.tar.bz2
Fix for bug #1604 - Checkbook crashes on startup
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/cbinfo.cpp2
-rw-r--r--noncore/apps/checkbook/traninfo.cpp24
-rw-r--r--noncore/apps/checkbook/traninfo.h2
3 files changed, 14 insertions, 14 deletions
diff --git a/noncore/apps/checkbook/cbinfo.cpp b/noncore/apps/checkbook/cbinfo.cpp
index 36dde04..6e3afa7 100644
--- a/noncore/apps/checkbook/cbinfo.cpp
+++ b/noncore/apps/checkbook/cbinfo.cpp
@@ -177,9 +177,9 @@ void CBInfo::loadTransactions()
bOld=true;
}
while( i>=0 ) {
_last=i;
- tran=new TranInfo(config, i);
+ tran=new TranInfo(&config, i);
trandesc = tran->desc();
if( trandesc==QString::null ) {
delete tran;
break;
diff --git a/noncore/apps/checkbook/traninfo.cpp b/noncore/apps/checkbook/traninfo.cpp
index 4833af9..7bd2004 100644
--- a/noncore/apps/checkbook/traninfo.cpp
+++ b/noncore/apps/checkbook/traninfo.cpp
@@ -49,12 +49,12 @@ TranInfo::TranInfo( int id, const QString &desc, const QDate &date, bool withdra
n = notes;
_next=next;
}
-TranInfo::TranInfo( Config config, int entry )
+TranInfo::TranInfo( Config *config, int entry )
{
- config.setGroup( QString::number( entry ) );
- QString desc = config.readEntry( "Description", "Not Found" );
+ config->setGroup( QString::number( entry ) );
+ QString desc = config->readEntry( "Description", "Not Found" );
if ( desc != "Not Found" )
{
// ID
i = entry;
@@ -63,9 +63,9 @@ TranInfo::TranInfo( Config config, int entry )
d = desc;
// Transaction date
int yr, mn, dy;
- QString datestr = config.readEntry( "Date", "" );
+ QString datestr = config->readEntry( "Date", "" );
int begin, end;
begin = datestr.find( '/' );
mn = datestr.left( begin ).toInt();
end = datestr.find( '/', ++begin );
@@ -73,12 +73,12 @@ TranInfo::TranInfo( Config config, int entry )
yr = datestr.right( datestr.length() - end - 1).toInt();
td.setYMD( yr, mn, dy );
// Deposit/withdrawal indicator ( withdrawal == TRUE )
- w = ( config.readEntry( "Payment", "false" ) == "true" );
+ w = ( config->readEntry( "Payment", "false" ) == "true" );
// Type
- QString type = config.readEntry( "Type", "0" );
+ QString type = config->readEntry( "Type", "0" );
if ( w )
{ // Withdrawal types
if( type == "0" )
t = "Debit Charge";
@@ -101,27 +101,27 @@ TranInfo::TranInfo( Config config, int entry )
t = "Cash";
}
// Category
- c = config.readEntry( "Category", "" );
+ c = config->readEntry( "Category", "" );
// Transaction amount
- QString stramount = config.readEntry( "Amount", "0.00" );
+ QString stramount = config->readEntry( "Amount", "0.00" );
bool ok;
a = stramount.toFloat( &ok );
// Transaction fee
- stramount = config.readEntry( "TransactionFee", "0.00" );
+ stramount = config->readEntry( "TransactionFee", "0.00" );
f = stramount.toFloat( &ok );
// Transaction number
- cn = config.readEntry( "CheckNumber", "" );
+ cn = config->readEntry( "CheckNumber", "" );
// Notes
- n = config.readEntry( "Comments", "" );
+ n = config->readEntry( "Comments", "" );
// next
- _next = config.readNumEntry("Next", -1);
+ _next = config->readNumEntry("Next", -1);
}
}
// --- datestr ----------------------------------------------------------------
diff --git a/noncore/apps/checkbook/traninfo.h b/noncore/apps/checkbook/traninfo.h
index cbe0238..2ecb60d 100644
--- a/noncore/apps/checkbook/traninfo.h
+++ b/noncore/apps/checkbook/traninfo.h
@@ -40,9 +40,9 @@ class TranInfo
TranInfo( int = 0, const QString & = 0x0, const QDate & = QDate::currentDate(),
bool = TRUE, const QString & = 0x0, const QString & = 0x0,
float = 0.0, float = 0.0,
const QString & = 0x0, const QString & = 0x0, int =-1 );
- TranInfo( Config, int );
+ TranInfo( Config *, int );
// getters
int id() const { return i; }
const QString &getIdStr();