@ -233,9 +233,9 @@ TQString GncObject::hide (TQString data, unsigned int anonClass) {
// dump current object data values // only called if gncdebug set
void GncObject : : debugDump ( ) {
uint i ;
qDebug ( " Object %s " , m_elementName . latin1 ( ) ) ;
t qDebug ( " Object %s " , m_elementName . latin1 ( ) ) ;
for ( i = 0 ; i < m_dataElementListCount ; i + + ) {
qDebug ( " %s = %s " , m_dataElementList [ i ] . latin1 ( ) , m_v . at ( i ) - > latin1 ( ) ) ;
t qDebug ( " %s = %s " , m_dataElementList [ i ] . latin1 ( ) , m_v . at ( i ) - > latin1 ( ) ) ;
}
}
//*****************************************************************
@ -255,7 +255,7 @@ GncFile::~GncFile () {}
GncObject * GncFile : : startSubEl ( ) {
TRY
if ( pMain - > xmldebug ) qDebug ( " File start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " File start subel m_state %d " , m_state ) ;
GncObject * next = 0 ;
switch ( m_state ) {
case BOOK :
@ -279,7 +279,7 @@ GncObject *GncFile::startSubEl() {
}
void GncFile : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " File end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " File end subel " ) ;
if ( ! m_processingTemplates ) delete subObj ; // template txs must be saved awaiting schedules
m_dataPtr = 0 ;
return ;
@ -349,7 +349,7 @@ void GncKvp::dataEl (const TQXmlAttributes& elAttrs) {
}
GncObject * GncKvp : : startSubEl ( ) {
if ( pMain - > xmldebug ) qDebug ( " Kvp start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " Kvp start subel m_state %d " , m_state ) ;
TRY
GncObject * next = 0 ;
switch ( m_state ) {
@ -361,7 +361,7 @@ GncObject *GncKvp::startSubEl() {
}
void GncKvp : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Kvp end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Kvp end subel " ) ;
m_kvpList . append ( subObj ) ;
m_dataPtr = 0 ;
return ;
@ -406,7 +406,7 @@ void GncCountData::terminate () {
if ( i ! = 0 ) {
if ( m_countType = = " budget " ) pMain - > setBudgetsFound ( true ) ;
else if ( m_countType . left ( 7 ) = = " gnc:Gnc " ) pMain - > setSmallBusinessFound ( true ) ;
else if ( pMain - > xmldebug ) qDebug ( " Unknown count type %s " , m_countType . latin1 ( ) ) ;
else if ( pMain - > xmldebug ) t qDebug ( " Unknown count type %s " , m_countType . latin1 ( ) ) ;
}
return ;
}
@ -502,7 +502,7 @@ GncAccount::~GncAccount () {
GncObject * GncAccount : : startSubEl ( ) {
TRY
if ( pMain - > xmldebug ) qDebug ( " Account start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " Account start subel m_state %d " , m_state ) ;
GncObject * next = 0 ;
switch ( m_state ) {
case CMDTY : next = new GncCmdtySpec ; break ;
@ -517,7 +517,7 @@ GncObject *GncAccount::startSubEl() {
}
void GncAccount : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Account end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Account end subel " ) ;
switch ( m_state ) {
case CMDTY : m_vpCommodity = static_cast < GncCmdtySpec * > ( subObj ) ; break ;
case KVP : m_kvpList . append ( subObj ) ;
@ -556,7 +556,7 @@ GncTransaction::~GncTransaction () {
GncObject * GncTransaction : : startSubEl ( ) {
TRY
if ( pMain - > xmldebug ) qDebug ( " Transaction start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " Transaction start subel m_state %d " , m_state ) ;
GncObject * next = 0 ;
switch ( m_state ) {
case CURRCY : next = new GncCmdtySpec ; break ;
@ -578,7 +578,7 @@ GncObject *GncTransaction::startSubEl() {
}
void GncTransaction : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Transaction end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Transaction end subel " ) ;
switch ( m_state ) {
case CURRCY : m_vpCurrency = static_cast < GncCmdtySpec * > ( subObj ) ; break ;
case POSTED : m_vpDatePosted = static_cast < GncDate * > ( subObj ) ; break ;
@ -630,7 +630,7 @@ GncObject *GncSplit::startSubEl () {
}
void GncSplit : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Split end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Split end subel " ) ;
switch ( m_state ) {
case RECDATE : m_vpDateReconciled = static_cast < GncDate * > ( subObj ) ; break ;
}
@ -654,7 +654,7 @@ GncTemplateSplit::GncTemplateSplit () {
GncTemplateSplit : : ~ GncTemplateSplit ( ) { }
GncObject * GncTemplateSplit : : startSubEl ( ) {
if ( pMain - > xmldebug ) qDebug ( " TemplateSplit start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " TemplateSplit start subel m_state %d " , m_state ) ;
TRY
GncObject * next = 0 ;
switch ( m_state ) {
@ -666,7 +666,7 @@ GncObject *GncTemplateSplit::startSubEl() {
}
void GncTemplateSplit : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " TemplateSplit end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " TemplateSplit end subel " ) ;
m_kvpList . append ( subObj ) ;
m_dataPtr = 0 ;
return ;
@ -697,7 +697,7 @@ GncSchedule::~GncSchedule () {
}
GncObject * GncSchedule : : startSubEl ( ) {
if ( pMain - > xmldebug ) qDebug ( " Schedule start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " Schedule start subel m_state %d " , m_state ) ;
TRY
GncObject * next = 0 ;
switch ( m_state ) {
@ -714,7 +714,7 @@ GncObject *GncSchedule::startSubEl() {
}
void GncSchedule : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Schedule end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Schedule end subel " ) ;
switch ( m_state ) {
case STARTDATE : m_vpStartDate = static_cast < GncDate * > ( subObj ) ; break ;
case LASTDATE : m_vpLastDate = static_cast < GncDate * > ( subObj ) ; break ;
@ -751,7 +751,7 @@ GncFreqSpec::~GncFreqSpec () {}
GncObject * GncFreqSpec : : startSubEl ( ) {
TRY
if ( pMain - > xmldebug ) qDebug ( " FreqSpec start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " FreqSpec start subel m_state %d " , m_state ) ;
GncObject * next = 0 ;
switch ( m_state ) {
@ -763,7 +763,7 @@ GncObject *GncFreqSpec::startSubEl() {
}
void GncFreqSpec : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " FreqSpec end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " FreqSpec end subel " ) ;
switch ( m_state ) {
case COMPO : m_fsList . append ( subObj ) ; break ;
}
@ -794,7 +794,7 @@ GncRecurrence::~GncRecurrence () {
GncObject * GncRecurrence : : startSubEl ( ) {
TRY
if ( pMain - > xmldebug ) qDebug ( " Recurrence start subel m_state %d " , m_state ) ;
if ( pMain - > xmldebug ) t qDebug ( " Recurrence start subel m_state %d " , m_state ) ;
GncObject * next = 0 ;
switch ( m_state ) {
@ -806,7 +806,7 @@ GncObject *GncRecurrence::startSubEl() {
}
void GncRecurrence : : endSubEl ( GncObject * subObj ) {
if ( pMain - > xmldebug ) qDebug ( " Recurrence end subel " ) ;
if ( pMain - > xmldebug ) t qDebug ( " Recurrence end subel " ) ;
switch ( m_state ) {
case STARTDATE : m_vpStartDate = static_cast < GncDate * > ( subObj ) ; break ;
}
@ -884,7 +884,7 @@ bool XmlReader::startDocument() {
bool XmlReader : : startElement ( const TQString & , const TQString & , const TQString & elName ,
const TQXmlAttributes & elAttrs ) {
try {
if ( pMain - > gncdebug ) qDebug ( " XML start - %s " , elName . latin1 ( ) ) ;
if ( pMain - > gncdebug ) t qDebug ( " XML start - %s " , elName . latin1 ( ) ) ;
# ifdef _GNCFILEANON
int i ;
TQString spaces ;
@ -935,9 +935,9 @@ bool XmlReader::startElement (const TQString&, const TQString&, const TQString&
# ifndef _GNCFILEANON
// we can't pass on exceptions here coz the XML reader won't catch them and we just abort
KMessageBox : : error ( 0 , i18n ( " Import failed: \n \n %1 " ) . arg ( e - > what ( ) ) , PACKAGE ) ;
qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
t qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
# else
qFatal ( " %s " , e - > latin1 ( ) ) ;
t qFatal ( " %s " , e - > latin1 ( ) ) ;
# endif // _GNCFILEANON
}
return true ; // to keep compiler happy
@ -945,7 +945,7 @@ bool XmlReader::startElement (const TQString&, const TQString&, const TQString&
bool XmlReader : : endElement ( const TQString & , const TQString & , const TQString & elName ) {
try {
if ( pMain - > xmldebug ) qDebug ( " XML end - %s " , elName . latin1 ( ) ) ;
if ( pMain - > xmldebug ) t qDebug ( " XML end - %s " , elName . latin1 ( ) ) ;
# ifdef _GNCFILEANON
TQString spaces ;
switch ( lastType ) {
@ -970,19 +970,19 @@ bool XmlReader::endElement( const TQString&, const TQString&, const TQString&elN
# ifndef _GNCFILEANON
// we can't pass on exceptions here coz the XML reader won't catch them and we just abort
KMessageBox : : error ( 0 , i18n ( " Import failed: \n \n %1 " ) . arg ( e - > what ( ) ) , PACKAGE ) ;
qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
t qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
# else
qFatal ( " %s " , e - > latin1 ( ) ) ;
t qFatal ( " %s " , e - > latin1 ( ) ) ;
# endif // _GNCFILEANON
}
return ( true ) ; // to keep compiler happy
}
bool XmlReader : : characters ( const TQString & data ) {
if ( pMain - > xmldebug ) qDebug ( " XML Data received - %d bytes " , data . length ( ) ) ;
if ( pMain - > xmldebug ) t qDebug ( " XML Data received - %d bytes " , data . length ( ) ) ;
TQString pData = data . stripWhiteSpace ( ) ; // data may contain line feeds and indentation spaces
if ( ! pData . isEmpty ( ) ) {
if ( pMain - > developerDebug ) qDebug ( " XML Data - %s " , pData . latin1 ( ) ) ;
if ( pMain - > developerDebug ) t qDebug ( " XML Data - %s " , pData . latin1 ( ) ) ;
m_co - > storeData ( pData ) ; //go store it
# ifdef _GNCFILEANON
TQString anonData = m_co - > getData ( ) ;
@ -1046,7 +1046,7 @@ void MyMoneyGncReader::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage)
TQ_CHECK_PTR ( storage ) ;
m_storage = dynamic_cast < IMyMoneyStorage * > ( storage ) ;
qDebug ( " Entering gnucash importer " ) ;
t qDebug ( " Entering gnucash importer " ) ;
setOptions ( ) ;
// get a file anonymization factor from the user
if ( bAnonymize ) setFileHideFactor ( ) ;
@ -1060,20 +1060,20 @@ void MyMoneyGncReader::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage)
ft . commit ( ) ;
} catch ( MyMoneyException * e ) {
KMessageBox : : error ( 0 , i18n ( " Import failed: \n \n %1 " ) . arg ( e - > what ( ) ) , PACKAGE ) ;
qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
t qFatal ( " %s " , e - > what ( ) . latin1 ( ) ) ;
} // end catch
signalProgress ( 0 , 1 , i18n ( " Import complete " ) ) ; // switch off progress bar
delete m_xr ;
qDebug ( " Exiting gnucash importer " ) ;
t qDebug ( " Exiting gnucash importer " ) ;
return ;
}
# else
// Control code for the file anonymizer
void MyMoneyGncReader : : readFile ( TQString in , TQString out ) {
TQFile pDevice ( in ) ;
if ( ! pDevice . open ( IO_ReadOnly ) ) qFatal ( " Can't open input file " ) ;
if ( ! pDevice . open ( IO_ReadOnly ) ) t qFatal ( " Can't open input file " ) ;
TQFile outFile ( out ) ;
if ( ! outFile . open ( IO_WriteOnly ) ) qFatal ( " Can't open output file " ) ;
if ( ! outFile . open ( IO_WriteOnly ) ) t qFatal ( " Can't open output file " ) ;
oStream . setDevice ( & outFile ) ;
bAnonymize = true ;
// get a file anonymization factor from the user
@ -1082,7 +1082,7 @@ void MyMoneyGncReader::readFile(TQString in, TQString out) {
try {
m_xr - > processFile ( & pDevice ) ;
} catch ( MyMoneyException * e ) {
qFatal ( " %s " , e - > latin1 ( ) ) ;
t qFatal ( " %s " , e - > latin1 ( ) ) ;
} // end catch
delete m_xr ;
pDevice . close ( ) ;
@ -1103,7 +1103,7 @@ int main (int argc, char ** argv) {
" Gnucash files(*.nc *) " ,
0 ) ;
}
if ( inFile . isEmpty ( ) ) qFatal ( " Input file required " ) ;
if ( inFile . isEmpty ( ) ) t qFatal ( " Input file required " ) ;
if ( outFile . isEmpty ( ) ) outFile = inFile + " .anon " ;
m . readFile ( inFile , outFile ) ;
exit ( 0 ) ;
@ -1146,7 +1146,7 @@ void MyMoneyGncReader::convertCommodity (const GncCommodity *gcm) {
m_storage - > addSecurity ( equ ) ;
//assign the gnucash id as the key into the map to find our id
if ( gncdebug ) qDebug ( " mapping, key = %s, id = %s " , gcm - > id ( ) . latin1 ( ) , equ . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug ( " mapping, key = %s, id = %s " , gcm - > id ( ) . latin1 ( ) , equ . id ( ) . data ( ) ) ;
m_mapEquities [ gcm - > id ( ) . utf8 ( ) ] = equ . id ( ) ;
}
signalProgress ( + + m_commodityCount , 0 ) ;
@ -1165,7 +1165,7 @@ void MyMoneyGncReader::convertPrice (const GncPrice *gpr) {
m_storage - > addPrice ( exchangeRate ) ;
} else {
MyMoneySecurity e = m_storage - > security ( m_mapEquities [ gpr - > commodity ( ) - > id ( ) . utf8 ( ) ] ) ;
if ( gncdebug ) qDebug ( " Searching map, key = %s, found id = %s " ,
if ( gncdebug ) t qDebug ( " Searching map, key = %s, found id = %s " ,
gpr - > commodity ( ) - > id ( ) . latin1 ( ) , e . id ( ) . data ( ) ) ;
e . setTradingCurrency ( gpr - > currency ( ) - > id ( ) . utf8 ( ) ) ;
MyMoneyPrice stockPrice ( e . id ( ) , gpr - > currency ( ) - > id ( ) . utf8 ( ) , gpr - > priceDate ( ) , rate , i18n ( " Imported History " ) ) ;
@ -1269,12 +1269,12 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
m_stockList . append ( gac - > id ( ) ) ;
// set the equity type
MyMoneySecurity e = m_storage - > security ( m_mapEquities [ gac - > commodity ( ) - > id ( ) . utf8 ( ) ] ) ;
if ( gncdebug ) qDebug ( " Acct equity search, key = %s, found id = %s " ,
if ( gncdebug ) t qDebug ( " Acct equity search, key = %s, found id = %s " ,
gac - > commodity ( ) - > id ( ) . latin1 ( ) , e . id ( ) . data ( ) ) ;
acc . setCurrencyId ( e . id ( ) ) ; // actually, the security id
if ( " MUTUAL " = = gac - > type ( ) ) {
e . setSecurityType ( MyMoneySecurity : : SECURITY_MUTUALFUND ) ;
if ( gncdebug ) qDebug ( " Setting %s to mutual " , e . name ( ) . latin1 ( ) ) ;
if ( gncdebug ) t qDebug ( " Setting %s to mutual " , e . name ( ) . latin1 ( ) ) ;
m_storage - > modifySecurity ( e ) ;
}
// See if he wants online quotes for this account
@ -1310,7 +1310,7 @@ void MyMoneyGncReader::convertAccount (const GncAccount* gac) {
m_storage - > addAccount ( acc ) ;
m_mapIds [ gac - > id ( ) . utf8 ( ) ] = acc . id ( ) ; // to link gnucash id to ours for tx posting
if ( gncdebug ) qDebug( " Gnucash account %s has id of %s, type of %s, parent is %s " ,
if ( gncdebug ) t qDebug( " Gnucash account %s has id of %s, type of %s, parent is %s " ,
gac - > id ( ) . latin1 ( ) , acc . id ( ) . data ( ) ,
KMyMoneyUtils : : accountTypeToString ( acc . accountType ( ) ) . latin1 ( ) , acc . parentAccountId ( ) . data ( ) ) ;
@ -1400,7 +1400,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
splitAccount = m_storage - > account ( kmmAccountId ) ;
// print some data so we can maybe identify this split later
// TODO : prints personal data
//if (gncdebug) qDebug ("Split data - gncid %s, kmmid %s, memo %s, value %s, recon state %s",
//if (gncdebug) t qDebug ("Split data - gncid %s, kmmid %s, memo %s, value %s, recon state %s",
// gsp->acct().latin1(), kmmAccountId.data(), gsp->memo().latin1(), gsp->value().latin1(),
// gsp->recon().latin1());
// payee id
@ -1464,7 +1464,7 @@ void MyMoneyGncReader::convertSplit (const GncSplit *gsp) {
// we can't use m_storage->security coz security list is not built yet
m_storage - > currency ( m_txCommodity ) ; // will throw exception if not currency
e . setTradingCurrency ( m_txCommodity ) ;
if ( gncdebug ) qDebug ( " added price for %s, %s date %s " ,
if ( gncdebug ) t qDebug ( " added price for %s, %s date %s " ,
e . name ( ) . latin1 ( ) , newPrice . toString ( ) . latin1 ( ) ,
TQString ( m_txDatePosted . toString ( Qt : : ISODate ) ) . latin1 ( ) ) ;
m_storage - > modifySecurity ( e ) ;
@ -1628,7 +1628,7 @@ void MyMoneyGncReader::convertTemplateSplit (const TQString& schedName, const Gn
}
// all data read, now check we have everything
if ( ( bFoundStringCreditFormula ) & & ( bFoundStringDebitFormula ) & & ( bFoundGuidAccountId ) ) {
if ( gncdebug ) qDebug ( " Found valid slot; credit %s, debit %s, acct %s " ,
if ( gncdebug ) t qDebug ( " Found valid slot; credit %s, debit %s, acct %s " ,
gncCreditFormula . latin1 ( ) , gncDebitFormula . latin1 ( ) , gncAccountId . latin1 ( ) ) ;
validSlotCount + + ;
}
@ -1654,7 +1654,7 @@ void MyMoneyGncReader::convertTemplateSplit (const TQString& schedName, const Gn
exFormula = numericTest ;
}
} else {
if ( gncdebug ) qDebug ( " %s is not numeric " , numericTest . latin1 ( ) ) ;
if ( gncdebug ) t qDebug ( " %s is not numeric " , numericTest . latin1 ( ) ) ;
nonNumericFormula = true ;
}
split . setValue ( exFormula ) ;
@ -1783,7 +1783,7 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
unknownOccurs = true ;
} else {
const GncRecurrence * gre = gsc - > m_vpRecurrence . first ( ) ;
// qDebug (TQString("Sched %1, pt %2, mu %3, sd %4").arg(gsc->name()).arg(gre->periodType())
// t qDebug (TQString("Sched %1, pt %2, mu %3, sd %4").arg(gsc->name()).arg(gre->periodType())
// .arg(gre->mult()).arg(gre->startDate().toString(Qt::ISODate)));
frequency = gre - > getFrequency ( ) ;
schedEnabled = gsc - > enabled ( ) ;
@ -1853,9 +1853,9 @@ void MyMoneyGncReader::convertSchedule (const GncSchedule *gsc) {
sc . setPaymentType ( ( MyMoneySchedule : : paymentTypeE ) MyMoneySchedule : : STYPE_OTHER ) ;
sc . setFixed ( ! m_suspectSchedule ) ; // if any probs were found, set it as variable so user will always be prompted
// we don't currently have a 'disable' option, but just make sure auto-enter is off if not enabled
// qDebug(TQString("%1 and %2").arg(gsc->autoCreate()).arg(schedEnabled));
// t qDebug(TQString("%1 and %2").arg(gsc->autoCreate()).arg(schedEnabled));
sc . setAutoEnter ( ( gsc - > autoCreate ( ) = = " y " ) & & ( schedEnabled = = " y " ) ) ;
// qDebug(TQString("autoEnter set to %1").arg(sc.autoEnter()));
// t qDebug(TQString("autoEnter set to %1").arg(sc.autoEnter()));
// type
TQString actionType = tx . splits ( ) . first ( ) . action ( ) ;
if ( actionType = = MyMoneySplit : : ActionDeposit ) {
@ -1896,9 +1896,9 @@ void MyMoneyGncReader::terminate () {
TRY
// All data has been converted and added to storage
// this code is just temporary to show us what is in the file.
if ( gncdebug ) qDebug( " %d accounts found in the GnuCash file " , ( unsigned int ) m_mapIds . count ( ) ) ;
if ( gncdebug ) t qDebug( " %d accounts found in the GnuCash file " , ( unsigned int ) m_mapIds . count ( ) ) ;
for ( map_accountIds : : Iterator it = m_mapIds . begin ( ) ; it ! = m_mapIds . end ( ) ; + + it ) {
if ( gncdebug ) qDebug( " key = %s, value = %s " , it . key ( ) . data ( ) , it . data ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " key = %s, value = %s " , it . key ( ) . data ( ) , it . data ( ) . data ( ) ) ;
}
// first step is to implement the users investment option, now we
// have all the accounts available
@ -1916,33 +1916,33 @@ void MyMoneyGncReader::terminate () {
if ( ( * acc ) . parentAccountId ( ) = = m_storage - > asset ( ) . id ( ) ) {
MyMoneyAccount assets = m_storage - > asset ( ) ;
m_storage - > addAccount ( assets , ( * acc ) ) ;
if ( gncdebug ) qDebug( " Account id %s is a child of the main asset account " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of the main asset account " , ( * acc ) . id ( ) . data ( ) ) ;
} else if ( ( * acc ) . parentAccountId ( ) = = m_storage - > liability ( ) . id ( ) ) {
MyMoneyAccount liabilities = m_storage - > liability ( ) ;
m_storage - > addAccount ( liabilities , ( * acc ) ) ;
if ( gncdebug ) qDebug( " Account id %s is a child of the main liability account " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of the main liability account " , ( * acc ) . id ( ) . data ( ) ) ;
} else if ( ( * acc ) . parentAccountId ( ) = = m_storage - > income ( ) . id ( ) ) {
MyMoneyAccount incomes = m_storage - > income ( ) ;
m_storage - > addAccount ( incomes , ( * acc ) ) ;
if ( gncdebug ) qDebug( " Account id %s is a child of the main income account " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of the main income account " , ( * acc ) . id ( ) . data ( ) ) ;
} else if ( ( * acc ) . parentAccountId ( ) = = m_storage - > expense ( ) . id ( ) ) {
MyMoneyAccount expenses = m_storage - > expense ( ) ;
m_storage - > addAccount ( expenses , ( * acc ) ) ;
if ( gncdebug ) qDebug( " Account id %s is a child of the main expense account " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of the main expense account " , ( * acc ) . id ( ) . data ( ) ) ;
} else if ( ( * acc ) . parentAccountId ( ) = = m_storage - > equity ( ) . id ( ) ) {
MyMoneyAccount equity = m_storage - > equity ( ) ;
m_storage - > addAccount ( equity , ( * acc ) ) ;
if ( gncdebug ) qDebug( " Account id %s is a child of the main equity account " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of the main equity account " , ( * acc ) . id ( ) . data ( ) ) ;
} else if ( ( * acc ) . parentAccountId ( ) = = m_rootId ) {
if ( gncdebug ) qDebug( " Account id %s is a child of root " , ( * acc ) . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug( " Account id %s is a child of root " , ( * acc ) . id ( ) . data ( ) ) ;
} else {
// it is not under one of the main accounts, so find gnucash parent
TQString parentKey = ( * acc ) . parentAccountId ( ) ;
if ( gncdebug ) qDebug ( " acc %s, parent %s " , ( * acc ) . id ( ) . data ( ) ,
if ( gncdebug ) t qDebug ( " acc %s, parent %s " , ( * acc ) . id ( ) . data ( ) ,
( * acc ) . parentAccountId ( ) . data ( ) ) ;
map_accountIds : : Iterator id = m_mapIds . find ( parentKey ) ;
if ( id ! = m_mapIds . end ( ) ) {
if ( gncdebug ) qDebug( " Setting account id %s's parent account id to %s " ,
if ( gncdebug ) t qDebug( " Setting account id %s's parent account id to %s " ,
( * acc ) . id ( ) . data ( ) , id . data ( ) . data ( ) ) ;
MyMoneyAccount parent = m_storage - > account ( id . data ( ) ) ;
parent = checkConsistency ( parent , ( * acc ) ) ;
@ -2071,12 +2071,12 @@ TQString MyMoneyGncReader::buildReportSection (const TQString& source) {
}
if ( more ) s . append ( i18n ( " \n \n Press More for further information " ) ) ;
} else { // we need to retrieve the posted messages for this source
if ( gncdebug ) qDebug( " Building messages for source %s " , source . latin1 ( ) ) ;
if ( gncdebug ) t qDebug( " Building messages for source %s " , source . latin1 ( ) ) ;
unsigned int i , j ;
for ( i = 0 ; i < m_messageList . count ( ) ; i + + ) {
GncMessageArgs * m = m_messageList . at ( i ) ;
if ( m - > source = = source ) {
if ( gncdebug ) qDebug( " %s " , TQString ( " build text source %1, code %2, argcount %3 " )
if ( gncdebug ) t qDebug( " %s " , TQString ( " build text source %1, code %2, argcount %3 " )
. arg ( m - > source ) . arg ( m - > code ) . arg ( m - > args . count ( ) ) . data ( ) ) ;
TQString ss = GncMessages : : text ( m - > source , m - > code ) ;
// add variable args. the .arg function seems always to replace the
@ -2087,7 +2087,7 @@ TQString MyMoneyGncReader::buildReportSection (const TQString& source) {
}
}
}
if ( gncdebug ) qDebug ( " %s " , s . latin1 ( ) ) ;
if ( gncdebug ) t qDebug ( " %s " , s . latin1 ( ) ) ;
return ( static_cast < const TQString > ( s ) ) ;
PASS
}
@ -2217,9 +2217,9 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
invAcc . setParentAccountId ( parentKey ) ; // intersperse it between old parent and child stock acct
m_storage - > addAccount ( invAcc ) ;
m_mapIds [ invAcc . id ( ) ] = invAcc . id ( ) ; // so stock account gets parented (again) to investment account later
if ( gncdebug ) qDebug ( " Created investment account %s as id %s, parent %s " , invAcc . name ( ) . data ( ) , invAcc . id ( ) . data ( ) ,
if ( gncdebug ) t qDebug ( " Created investment account %s as id %s, parent %s " , invAcc . name ( ) . data ( ) , invAcc . id ( ) . data ( ) ,
invAcc . parentAccountId ( ) . data ( ) ) ;
if ( gncdebug ) qDebug ( " Setting stock %s, id %s, as child of %s " , stockAcc . name ( ) . data ( ) , stockAcc . id ( ) . data ( ) , invAcc . id ( ) . data ( ) ) ;
if ( gncdebug ) t qDebug ( " Setting stock %s, id %s, as child of %s " , stockAcc . name ( ) . data ( ) , stockAcc . id ( ) . data ( ) , invAcc . id ( ) . data ( ) ) ;
stockAcc . setParentAccountId ( invAcc . id ( ) ) ;
m_storage - > addAccount ( invAcc , stockAcc ) ;
// investment option 1 creates a single investment account for all stocks
@ -2240,7 +2240,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
singleInvAcc . setParentAccountId ( m_storage - > asset ( ) . id ( ) ) ;
m_storage - > addAccount ( singleInvAcc ) ;
m_mapIds [ singleInvAcc . id ( ) ] = singleInvAcc . id ( ) ; // so stock account gets parented (again) to investment account later
if ( gncdebug ) qDebug ( " Created investment account %s as id %s, parent %s, reparenting stock " ,
if ( gncdebug ) t qDebug ( " Created investment account %s as id %s, parent %s, reparenting stock " ,
singleInvAcc . name ( ) . data ( ) , singleInvAcc . id ( ) . data ( ) , singleInvAcc . parentAccountId ( ) . data ( ) ) ;
singleInvAccId = singleInvAcc . id ( ) ;
} else { // the account has already been created
@ -2263,7 +2263,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
// if (((*acc).accountGroup() == MyMoneyAccount::Asset) && ((*acc).accountType() != MyMoneyAccount::Stock)) accList.append ((*acc).name());
if ( ( * acc ) . accountType ( ) = = MyMoneyAccount : : Investment ) accList . append ( ( * acc ) . name ( ) ) ;
}
//if (accList.isEmpty()) qFatal ("No available accounts");
//if (accList.isEmpty()) t qFatal ("No available accounts");
bool ok = false ;
while ( ! ok ) { // keep going till we have a valid investment parent
TQString invAccName = TQInputDialog : : getItem (
@ -2300,7 +2300,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
ok = false ; break ;
default :
// convert it - but what if it has splits???
qFatal ( " Not yet implemented " ) ;
t qFatal ( " Not yet implemented " ) ;
ok = true ;
break ;
}
@ -2308,7 +2308,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
switch ( KMessageBox : : questionYesNo ( 0 , i18n ( " %1 is not an Investment Account. Do you wish to make it one? " ) . arg ( invAcc . name ( ) , PACKAGE ) ) ) {
case KMessageBox : : Yes :
// convert it - but what if it has splits???
qFatal ( " Not yet implemented " ) ;
t qFatal ( " Not yet implemented " ) ;
ok = true ;
break ;
default :
@ -2321,7 +2321,7 @@ void MyMoneyGncReader::checkInvestmentOption (TQString stockId) {
m_mapIds [ invAcc . id ( ) ] = invAcc . id ( ) ; // so stock account gets parented (again) to investment account later
m_storage - > addAccount ( invAcc , stockAcc ) ;
} else { // investment option != 0, 1, 2
qFatal ( " Invalid investment option %d " , m_investmentOption ) ;
t qFatal ( " Invalid investment option %d " , m_investmentOption ) ;
}
}
@ -2394,7 +2394,7 @@ void MyMoneyGncReader::postMessage (const TQString& source, const unsigned int c
// get the number of args this message requires
const unsigned int argCount = GncMessages : : argCount ( source , code ) ;
if ( ( gncdebug ) & & ( argCount ! = argList . count ( ) ) )
qDebug( " %s " , TQString ( " MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4 " )
t qDebug( " %s " , TQString ( " MyMoneyGncReader::postMessage debug: Message %1, code %2, requires %3 arguments, got %4 " )
. arg ( source ) . arg ( code ) . arg ( argCount ) . arg ( argList . count ( ) ) . data ( ) ) ;
// store the arguments
for ( i = 0 ; i < argCount ; i + + ) {