summaryrefslogtreecommitdiffstats
path: root/kmymoney2/converter/mymoneystatementreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/converter/mymoneystatementreader.cpp')
-rw-r--r--kmymoney2/converter/mymoneystatementreader.cpp254
1 files changed, 127 insertions, 127 deletions
diff --git a/kmymoney2/converter/mymoneystatementreader.cpp b/kmymoney2/converter/mymoneystatementreader.cpp
index b804a59..8268d89 100644
--- a/kmymoney2/converter/mymoneystatementreader.cpp
+++ b/kmymoney2/converter/mymoneystatementreader.cpp
@@ -26,10 +26,10 @@
// ----------------------------------------------------------------------------
// QT Headers
-#include <qfile.h>
-#include <qstringlist.h>
-#include <qtimer.h>
-#include <qtextedit.h>
+#include <tqfile.h>
+#include <tqstringlist.h>
+#include <tqtimer.h>
+#include <tqtextedit.h>
// ----------------------------------------------------------------------------
// KDE Headers
@@ -39,8 +39,8 @@
#include <kconfig.h>
#include <kdebug.h>
#include <kdialogbase.h>
-#include <qvbox.h>
-#include <qlabel.h>
+#include <tqvbox.h>
+#include <tqlabel.h>
// ----------------------------------------------------------------------------
// Project Headers
@@ -68,73 +68,73 @@ class MyMoneyStatementReader::Private
scannedCategories(false)
{}
- const QString& feeId(const MyMoneyAccount& invAcc);
- const QString& interestId(const MyMoneyAccount& invAcc);
- QString interestId(const QString& name);
- QString feeId(const QString& name);
+ const TQString& feeId(const MyMoneyAccount& invAcc);
+ const TQString& interestId(const MyMoneyAccount& invAcc);
+ TQString interestId(const TQString& name);
+ TQString feeId(const TQString& name);
void assignUniqueBankID(MyMoneySplit& s, const MyMoneyStatement::Transaction& t_in);
MyMoneyAccount lastAccount;
- QValueList<MyMoneyTransaction> transactions;
- QValueList<MyMoneyPayee> payees;
+ TQValueList<MyMoneyTransaction> transactions;
+ TQValueList<MyMoneyPayee> payees;
int transactionsCount;
int transactionsAdded;
int transactionsMatched;
int transactionsDuplicate;
- QMap<QString, bool> uniqIds;
- QMap<QString, MyMoneySecurity> securitiesBySymbol;
- QMap<QString, MyMoneySecurity> securitiesByName;
+ TQMap<TQString, bool> uniqIds;
+ TQMap<TQString, MyMoneySecurity> securitiesBySymbol;
+ TQMap<TQString, MyMoneySecurity> securitiesByName;
bool m_skipCategoryMatching;
private:
- void scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName);
- QString nameToId(const QString&name, MyMoneyAccount& parent);
+ void scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName);
+ TQString nameToId(const TQString&name, MyMoneyAccount& tqparent);
private:
- QString m_feeId;
- QString m_interestId;
+ TQString m_feeId;
+ TQString m_interestId;
bool scannedCategories;
};
-const QString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc)
+const TQString& MyMoneyStatementReader::Private::feeId(const MyMoneyAccount& invAcc)
{
scanCategories(m_feeId, invAcc, MyMoneyFile::instance()->expense(), i18n("_Fees"));
return m_feeId;
}
-const QString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc)
+const TQString& MyMoneyStatementReader::Private::interestId(const MyMoneyAccount& invAcc)
{
scanCategories(m_interestId, invAcc, MyMoneyFile::instance()->income(), i18n("_Dividend"));
return m_interestId;
}
-QString MyMoneyStatementReader::Private::nameToId(const QString&name, MyMoneyAccount& parent)
+TQString MyMoneyStatementReader::Private::nameToId(const TQString&name, MyMoneyAccount& tqparent)
{
MyMoneyFile* file = MyMoneyFile::instance();
MyMoneyAccount acc = file->accountByName(name);
// if it does not exist, we have to create it
if(acc.id().isEmpty()) {
acc.setName( name );
- acc.setAccountType( parent.accountType() );
- acc.setCurrencyId(parent.currencyId());
- file->addAccount(acc, parent);
+ acc.setAccountType( tqparent.accountType() );
+ acc.setCurrencyId(tqparent.currencyId());
+ file->addAccount(acc, tqparent);
}
return acc.id();
}
-QString MyMoneyStatementReader::Private::interestId(const QString& name)
+TQString MyMoneyStatementReader::Private::interestId(const TQString& name)
{
- MyMoneyAccount parent = MyMoneyFile::instance()->income();
- return nameToId(name, parent);
+ MyMoneyAccount tqparent = MyMoneyFile::instance()->income();
+ return nameToId(name, tqparent);
}
-QString MyMoneyStatementReader::Private::feeId(const QString& name)
+TQString MyMoneyStatementReader::Private::feeId(const TQString& name)
{
- MyMoneyAccount parent = MyMoneyFile::instance()->expense();
- return nameToId(name, parent);
+ MyMoneyAccount tqparent = MyMoneyFile::instance()->expense();
+ return nameToId(name, tqparent);
}
-void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& parentAccount, const QString& defaultName)
+void MyMoneyStatementReader::Private::scanCategories(TQString& id, const MyMoneyAccount& invAcc, const MyMoneyAccount& tqparentAccount, const TQString& defaultName)
{
if(!scannedCategories) {
KMyMoneyUtils::previouslyUsedCategories(invAcc.id(), m_feeId, m_interestId);
@@ -146,11 +146,11 @@ void MyMoneyStatementReader::Private::scanCategories(QString& id, const MyMoneyA
MyMoneyAccount acc = file->accountByName(defaultName);
// if it does not exist, we have to create it
if(acc.id().isEmpty()) {
- MyMoneyAccount parent = parentAccount;
+ MyMoneyAccount tqparent = tqparentAccount;
acc.setName( defaultName );
- acc.setAccountType( parent.accountType() );
- acc.setCurrencyId(parent.currencyId());
- file->addAccount(acc, parent);
+ acc.setAccountType( tqparent.accountType() );
+ acc.setCurrencyId(tqparent.currencyId());
+ file->addAccount(acc, tqparent);
}
id = acc.id();
}
@@ -161,17 +161,17 @@ void MyMoneyStatementReader::Private::assignUniqueBankID(MyMoneySplit& s, const
if( ! t_in.m_strBankID.isEmpty() ) {
// make sure that id's are unique from this point on by appending a -#
// postfix if needed
- QString base(t_in.m_strBankID);
- QString hash(base);
+ TQString base(t_in.m_strBankID);
+ TQString hash(base);
int idx = 1;
for(;;) {
- QMap<QString, bool>::const_iterator it;
- it = uniqIds.find(hash);
+ TQMap<TQString, bool>::const_iterator it;
+ it = uniqIds.tqfind(hash);
if(it == uniqIds.end()) {
uniqIds[hash] = true;
break;
}
- hash = QString("%1-%2").arg(base).arg(idx);
+ hash = TQString("%1-%2").tqarg(base).tqarg(idx);
++idx;
}
@@ -210,7 +210,7 @@ void MyMoneyStatementReader::setAskPayeeCategory(bool ask)
m_askPayeeCategory = ask;
}
-bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& messages)
+bool MyMoneyStatementReader::import(const MyMoneyStatement& s, TQStringList& messages)
{
//
// For testing, save the statement to an XML file
@@ -291,7 +291,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
if(!m_account.name().isEmpty())
- messages += i18n("Importing statement for account %1").arg(m_account.name());
+ messages += i18n("Importing statement for account %1").tqarg(m_account.name());
else if(s.m_listTransactions.count() == 0)
messages += i18n("Importing statement without transactions");
@@ -302,7 +302,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
//
signalProgress(0, s.m_listSecurities.count(), "Importing Statement ...");
int progress = 0;
- QValueList<MyMoneyStatement::Security>::const_iterator it_s = s.m_listSecurities.begin();
+ TQValueList<MyMoneyStatement::Security>::const_iterator it_s = s.m_listSecurities.begin();
while ( it_s != s.m_listSecurities.end() )
{
processSecurityEntry(*it_s);
@@ -321,7 +321,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
qDebug("Processing transactions (%s)", m_account.name().data());
signalProgress(0, s.m_listTransactions.count(), "Importing Statement ...");
int progress = 0;
- QValueList<MyMoneyStatement::Transaction>::const_iterator it_t = s.m_listTransactions.begin();
+ TQValueList<MyMoneyStatement::Transaction>::const_iterator it_t = s.m_listTransactions.begin();
while ( it_t != s.m_listTransactions.end() )
{
processTransactionEntry(*it_t);
@@ -347,15 +347,15 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
{
try {
signalProgress(0, s.m_listPrices.count(), "Importing Statement ...");
- QValueList<MyMoneySecurity> slist = MyMoneyFile::instance()->securityList();
- QValueList<MyMoneySecurity>::const_iterator it_s;
+ TQValueList<MyMoneySecurity> slist = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity>::const_iterator it_s;
for(it_s = slist.begin(); it_s != slist.end(); ++it_s) {
d->securitiesBySymbol[(*it_s).tradingSymbol()] = *it_s;
d->securitiesByName[(*it_s).name()] = *it_s;
}
int progress = 0;
- QValueList<MyMoneyStatement::Price>::const_iterator it_p = s.m_listPrices.begin();
+ TQValueList<MyMoneyStatement::Price>::const_iterator it_p = s.m_listPrices.begin();
while(it_p != s.m_listPrices.end()) {
processPriceEntry(*it_p);
signalProgress(++progress, 0);
@@ -375,7 +375,7 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
// delete all payees created in vain
int payeeCount = d->payees.count();
- QValueList<MyMoneyPayee>::const_iterator it_p;
+ TQValueList<MyMoneyPayee>::const_iterator it_p;
for(it_p = d->payees.begin(); it_p != d->payees.end(); ++it_p) {
try {
MyMoneyFile::instance()->removePayee(*it_p);
@@ -389,21 +389,21 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
if(s.m_closingBalance.isAutoCalc()) {
messages += i18n(" Statement balance is not contained in statement.");
} else {
- messages += i18n(" Statement balance on %1 is reported to be %2").arg(s.m_dateEnd.toString(Qt::ISODate)).arg(s.m_closingBalance.formatMoney("",2));
+ messages += i18n(" Statement balance on %1 is reported to be %2").tqarg(s.m_dateEnd.toString(Qt::ISODate)).tqarg(s.m_closingBalance.formatMoney("",2));
}
messages += i18n(" Transactions");
- messages += i18n(" %1 processed").arg(d->transactionsCount);
- messages += i18n(" %1 added").arg(d->transactionsAdded);
- messages += i18n(" %1 matched").arg(d->transactionsMatched);
- messages += i18n(" %1 duplicates").arg(d->transactionsDuplicate);
+ messages += i18n(" %1 processed").tqarg(d->transactionsCount);
+ messages += i18n(" %1 added").tqarg(d->transactionsAdded);
+ messages += i18n(" %1 matched").tqarg(d->transactionsMatched);
+ messages += i18n(" %1 duplicates").tqarg(d->transactionsDuplicate);
messages += i18n(" Payees");
- messages += i18n(" %1 created").arg(payeeCount);
- messages += QString();
+ messages += i18n(" %1 created").tqarg(payeeCount);
+ messages += TQString();
// remove the Don't ask again entries
KConfig* config = KGlobal::config();
- config->setGroup(QString::fromLatin1("Notification Messages"));
- QStringList::ConstIterator it;
+ config->setGroup(TQString::tqfromLatin1("Notification Messages"));
+ TQStringList::ConstIterator it;
for(it = m_dontAskAgain.begin(); it != m_dontAskAgain.end(); ++it) {
config->deleteEntry(*it);
@@ -426,20 +426,20 @@ bool MyMoneyStatementReader::import(const MyMoneyStatement& s, QStringList& mess
void MyMoneyStatementReader::processPriceEntry(const MyMoneyStatement::Price& p_in)
{
- if(d->securitiesBySymbol.contains(p_in.m_strSecurity)) {
+ if(d->securitiesBySymbol.tqcontains(p_in.m_strSecurity)) {
MyMoneyPrice price(d->securitiesBySymbol[p_in.m_strSecurity].id(),
MyMoneyFile::instance()->baseCurrency().id(),
p_in.m_date,
- p_in.m_amount, "QIF");
+ p_in.m_amount, "TQIF");
MyMoneyFile::instance()->addPrice(price);
- } else if(d->securitiesByName.contains(p_in.m_strSecurity)) {
+ } else if(d->securitiesByName.tqcontains(p_in.m_strSecurity)) {
MyMoneyPrice price(d->securitiesByName[p_in.m_strSecurity].id(),
MyMoneyFile::instance()->baseCurrency().id(),
p_in.m_date,
- p_in.m_amount, "QIF");
+ p_in.m_amount, "TQIF");
MyMoneyFile::instance()->addPrice(price);
}
@@ -456,8 +456,8 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi
// In a statement, we do not know what type of security this is, so we will
// not use type as a matching factor.
MyMoneySecurity security;
- QValueList<MyMoneySecurity> list = file->securityList();
- QValueList<MyMoneySecurity>::ConstIterator it = list.begin();
+ TQValueList<MyMoneySecurity> list = file->securityList();
+ TQValueList<MyMoneySecurity>::ConstIterator it = list.begin();
while ( it != list.end() && security.id().isEmpty() )
{
if(sec_in.m_strSymbol.isEmpty()) {
@@ -485,7 +485,7 @@ void MyMoneyStatementReader::processSecurityEntry(const MyMoneyStatement::Securi
ft.commit();
kdDebug(0) << "Created " << security.name() << " with id " << security.id() << endl;
} catch(MyMoneyException *e) {
- KMessageBox::error(0, i18n("Error creating security record: %1").arg(e->what()), i18n("Error"));
+ KMessageBox::error(0, i18n("Error creating security record: %1").tqarg(e->what()), i18n("Error"));
}
} else {
kdDebug(0) << "Found " << security.name() << " with id " << security.id() << endl;
@@ -499,8 +499,8 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneyTransaction t;
#if 0
- QString dbgMsg;
- dbgMsg = QString("Process %1, '%3', %2").arg(t_in.m_datePosted.toString(Qt::ISODate)).arg(t_in.m_amount.formatMoney("", 2)).arg(t_in.m_strBankID);
+ TQString dbgMsg;
+ dbgMsg = TQString("Process %1, '%3', %2").tqarg(t_in.m_datePosted.toString(Qt::ISODate)).tqarg(t_in.m_amount.formatMoney("", 2)).tqarg(t_in.m_strBankID);
qDebug("%s", dbgMsg.data());
#endif
@@ -540,7 +540,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// If the user has chosen to import into an investment account, determine the correct account to use
MyMoneyAccount thisaccount = m_account;
- QString brokerageactid;
+ TQString brokerageactid;
if ( thisaccount.accountType() == MyMoneyAccount::Investment )
{
@@ -565,11 +565,11 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// search through each subordinate account
bool found = false;
- QStringList accounts = thisaccount.accountList();
- QStringList::const_iterator it_account = accounts.begin();
+ TQStringList accounts = thisaccount.accountList();
+ TQStringList::const_iterator it_account = accounts.begin();
while( !found && it_account != accounts.end() )
{
- QString currencyid = file->account(*it_account).currencyId();
+ TQString currencyid = file->account(*it_account).currencyId();
MyMoneySecurity security = file->security( currencyid );
if((t_in.m_strSymbol.lower() == security.tradingSymbol().lower())
|| (t_in.m_strSecurity.lower() == security.name().lower()))
@@ -584,7 +584,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
{
// update the price, while we're here. in the future, this should be
// an option
- QString basecurrencyid = file->baseCurrency().id();
+ TQString basecurrencyid = file->baseCurrency().id();
MyMoneyPrice price = file->price( currencyid, basecurrencyid, t_in.m_datePosted, true );
if ( !price.isValid() && ((!t_in.m_amount.isZero() && !t_in.m_shares.isZero()) || !t_in.m_price.isZero()))
{
@@ -614,14 +614,14 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
if ( t_in.m_strSecurity.isEmpty() )
{
- KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("BlankSecurity"));
+ KMessageBox::information(0, i18n("This imported statement contains investment transactions with no security. These transactions will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("BlankSecurity"));
return;
}
else
{
MyMoneySecurity security;
- QValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList();
- QValueList<MyMoneySecurity>::ConstIterator it = list.begin();
+ TQValueList<MyMoneySecurity> list = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity>::ConstIterator it = list.begin();
while ( it != list.end() && security.id().isEmpty() )
{
if(t_in.m_strSecurity.lower() == (*it).tradingSymbol().lower()
@@ -646,7 +646,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// This should be rare. A statement should have a security entry for any
// of the securities referred to in the transactions. The only way to get
// here is if that's NOT the case.
- KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").arg(t_in.m_strSecurity),i18n("Security not found"),QString("MissingSecurity%1").arg(t_in.m_strSecurity.stripWhiteSpace()));
+ KMessageBox::information(0, i18n("This investment account does not contain the \"%1\" security. Transactions involving this security will be ignored.").tqarg(t_in.m_strSecurity),i18n("Security not found"),TQString("MissingSecurity%1").tqarg(t_in.m_strSecurity.stripWhiteSpace()));
return;
}
}
@@ -784,7 +784,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// written. However, if a user has an associated brokerage account,
// we can stuff the transaction there.
- QString brokerageactid = m_account.value("kmm-brokerage-account").utf8();
+ TQString brokerageactid = m_account.value("kmm-brokerage-account").utf8();
if (brokerageactid.isEmpty() )
{
brokerageactid = file->accountByName(m_account.brokerageName()).id();
@@ -823,29 +823,29 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
- QString payeename = t_in.m_strPayee;
+ TQString payeename = t_in.m_strPayee;
if(!payeename.isEmpty())
{
- QString payeeid;
+ TQString payeeid;
try {
- QValueList<MyMoneyPayee> pList = file->payeeList();
- QValueList<MyMoneyPayee>::const_iterator it_p;
- QMap<int, QString> matchMap;
+ TQValueList<MyMoneyPayee> pList = file->payeeList();
+ TQValueList<MyMoneyPayee>::const_iterator it_p;
+ TQMap<int, TQString> matchMap;
for(it_p = pList.begin(); it_p != pList.end(); ++it_p) {
bool ignoreCase;
- QStringList keys;
- QStringList::const_iterator it_s;
+ TQStringList keys;
+ TQStringList::const_iterator it_s;
switch((*it_p).matchData(ignoreCase, keys)) {
case MyMoneyPayee::matchDisabled:
break;
case MyMoneyPayee::matchName:
- keys << QString("%1").arg(QRegExp::escape((*it_p).name()));
+ keys << TQString("%1").tqarg(TQRegExp::escape((*it_p).name()));
// tricky fall through here
case MyMoneyPayee::matchKey:
for(it_s = keys.begin(); it_s != keys.end(); ++it_s) {
- QRegExp exp(*it_s, !ignoreCase);
+ TQRegExp exp(*it_s, !ignoreCase);
if(exp.search(payeename) != -1) {
matchMap[exp.matchedLength()] = (*it_p).id();
}
@@ -863,7 +863,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// in case of a) we take the one with the largest matchedLength()
// which happens to be the last one in the map
if(matchMap.count() > 1) {
- QMap<int, QString>::const_iterator it_m = matchMap.end();
+ TQMap<int, TQString>::const_iterator it_m = matchMap.end();
--it_m;
payeeid = *it_m;
} else if(matchMap.count() == 1)
@@ -882,16 +882,16 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
if(m_autoCreatePayee == false) {
// Ask the user if that is what he intended to do?
- QString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").arg(payeename);
+ TQString msg = i18n("Do you want to add \"%1\" as payee/receiver?\n\n").tqarg(payeename);
msg += i18n("Selecting \"Yes\" will create the payee, \"No\" will skip "
"creation of a payee record and remove the payee information "
"from this transaction. Selecting \"Cancel\" aborts the import "
"operation.\n\nIf you select \"No\" here and mark the \"Don't ask "
"again\" checkbox, the payee information for all following transactions "
- "referencing \"%1\" will be removed.").arg(payeename);
+ "referencing \"%1\" will be removed.").tqarg(payeename);
- QString askKey = QString("Statement-Import-Payee-")+payeename;
- if(!m_dontAskAgain.contains(askKey)) {
+ TQString askKey = TQString("Statement-Import-Payee-")+payeename;
+ if(!m_dontAskAgain.tqcontains(askKey)) {
m_dontAskAgain += askKey;
}
rc = KMessageBox::questionYesNoCancel(0, msg, i18n("New payee/receiver"),
@@ -909,12 +909,12 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// is called in the context of an automatic procedure it
// might distract the user.
payee.setName(payeename);
- payee.setMatchData(MyMoneyPayee::matchName, true, QStringList());
+ payee.setMatchData(MyMoneyPayee::matchName, true, TQStringList());
if (m_askPayeeCategory) {
- // We use a QGuardedPtr because the dialog may get deleted
- // during exec() if the parent of the dialog gets deleted.
+ // We use a TQGuardedPtr because the dialog may get deleted
+ // during exec() if the tqparent of the dialog gets deleted.
// In that case the guarded ptr will reset to 0.
- QGuardedPtr<KDialogBase> dialog = new KDialogBase(
+ TQGuardedPtr<KDialogBase> dialog = new KDialogBase(
"Default Category for Payee",
KDialogBase::Yes | KDialogBase::No | KDialogBase::Cancel,
KDialogBase::Yes, KDialogBase::Cancel,
@@ -922,20 +922,20 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
KGuiItem(i18n("Save Category")),
KGuiItem(i18n("No Category")),
KGuiItem(i18n("Abort")));
- QVBox *topcontents = new QVBox (dialog);
+ TQVBox *topcontents = new TQVBox (dialog);
topcontents->setSpacing(KDialog::spacingHint()*2);
topcontents->setMargin(KDialog::marginHint());
//add in caption? and account combo here
- QLabel *label1 = new QLabel( topcontents);
- label1->setText(i18n("Please select a default category for payee '%1':").arg(payee.name().data()));
+ TQLabel *label1 = new TQLabel( topcontents);
+ label1->setText(i18n("Please select a default category for payee '%1':").tqarg(payee.name()));
- QGuardedPtr<KMyMoneyAccountCombo> accountCombo = new KMyMoneyAccountCombo(topcontents);
+ TQGuardedPtr<KMyMoneyAccountCombo> accountCombo = new KMyMoneyAccountCombo(topcontents);
dialog->setMainWidget(topcontents);
int result = dialog->exec();
- QString accountId;
+ TQString accountId;
if (accountCombo && !accountCombo->selectedAccounts().isEmpty()) {
accountId = accountCombo->selectedAccounts().front();
}
@@ -961,13 +961,13 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
} catch(MyMoneyException *e) {
KMessageBox::detailedSorry(0, i18n("Unable to add payee/receiver"),
- (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").arg(e->line()));
+ (e->what() + " " + i18n("thrown in") + " " + e->file()+ ":%1").tqarg(e->line()));
delete e;
}
} else if(rc == KMessageBox::No) {
- s1.setPayeeId(QString());
+ s1.setPayeeId(TQString());
} else {
throw new MYMONEYEXCEPTION("USERABORT");
@@ -995,7 +995,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneySplit s;
s.setReconcileFlag(MyMoneySplit::Cleared);
s.clearId();
- s.setBankID(QString());
+ s.setBankID(TQString());
s.setShares(-s1.shares());
s.setValue(-s1.value());
s.setAccountId(payeeObj.defaultAccountId());
@@ -1004,7 +1004,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
else if (t_in.m_listSplits.isEmpty() && !d->m_skipCategoryMatching) {
MyMoneyTransactionFilter filter(thisaccount.id());
filter.addPayee(payeeid);
- QValueList<MyMoneyTransaction> list = file->transactionList(filter);
+ TQValueList<MyMoneyTransaction> list = file->transactionList(filter);
if(!list.empty())
{
// Default to using the most recent transaction as the reference
@@ -1015,7 +1015,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// with the same VALUE as our imported transaction, and if so take that one.
if ( list.count() > 1 )
{
- QValueList<MyMoneyTransaction>::ConstIterator it_trans = list.fromLast();
+ TQValueList<MyMoneyTransaction>::ConstIterator it_trans = list.fromLast();
while ( it_trans != list.end() )
{
MyMoneySplit s = (*it_trans).splitByAccount(thisaccount.id());
@@ -1028,7 +1028,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
}
- QValueList<MyMoneySplit>::ConstIterator it_split;
+ TQValueList<MyMoneySplit>::ConstIterator it_split;
for(it_split = t_old.splits().begin(); it_split != t_old.splits().end(); ++it_split)
{
// We don't need the split that covers this account,
@@ -1038,7 +1038,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
MyMoneySplit s(*it_split);
s.setReconcileFlag(MyMoneySplit::NotReconciled);
s.clearId();
- s.setBankID(QString());
+ s.setBankID(TQString());
if ( t_old.splits().count() == 2 )
{
@@ -1085,7 +1085,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// process splits
//******************************************
- QValueList<MyMoneyStatement::Split>::const_iterator it_s;
+ TQValueList<MyMoneyStatement::Split>::const_iterator it_s;
for(it_s = t_in.m_listSplits.begin(); it_s != t_in.m_listSplits.end(); ++it_s) {
MyMoneySplit s2;
s2.setAccountId((*it_s).m_accountId);
@@ -1101,7 +1101,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
#if 0
- QString accountId;
+ TQString accountId;
int count;
int cnt = 0;
count = t_in.m_listSplits.count();
@@ -1113,7 +1113,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
s2.clearId();
s2.setValue(t_in.m_listSplits[cnt].m_amount);
s2.setShares(t_in.m_listSplits[cnt].m_amount);
- s2.setAccountId(QString(t_in.m_listSplits[cnt].m_accountId));
+ s2.setAccountId(TQString(t_in.m_listSplits[cnt].m_accountId));
#if 0
accountId = file->nameToAccount(t_in.m_listSplits[cnt].m_strCategoryName);
if (accountId.isEmpty())
@@ -1164,7 +1164,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
// to enter the schedule and match it agains the new transaction. Otherwise, we
// just leave the transaction as imported.
MyMoneySchedule schedule(*(dynamic_cast<const MyMoneySchedule*>(o)));
- if(KMessageBox::questionYesNo(0, QString("<qt>%1</qt>").arg(i18n("KMyMoney has found a scheduled transaction named <b>%1</b> which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").arg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) {
+ if(KMessageBox::questionYesNo(0, TQString("<qt>%1</qt>").tqarg(i18n("KMyMoney has found a scheduled transaction named <b>%1</b> which matches an imported transaction. Do you want KMyMoney to enter this schedule now so that the transaction can be matched? ").tqarg(schedule.name())), i18n("Schedule found")) == KMessageBox::Yes) {
KEnterScheduleDlg dlg(0, schedule);
TransactionEditor* editor = dlg.startEdit();
if(editor) {
@@ -1197,7 +1197,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
editor->createTransaction(torig, dlg.transaction(), dlg.transaction().splits()[0], true);
- QString newId;
+ TQString newId;
if(editor->enterTransactions(newId, false, true)) {
if(!newId.isEmpty()) {
torig = MyMoneyFile::instance()->transaction(newId);
@@ -1221,7 +1221,7 @@ void MyMoneyStatementReader::processTransactionEntry(const MyMoneyStatement::Tra
}
delete o;
} catch (MyMoneyException *e) {
- QString message(i18n("Problem adding or matching imported transaction with id '%1': %2").arg(t_in.m_strBankID).arg(e->what()));
+ TQString message(i18n("Problem adding or matching imported transaction with id '%1': %2").tqarg(t_in.m_strBankID).tqarg(e->what()));
qDebug("%s", message.data());
delete e;
@@ -1237,22 +1237,22 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
MyMoneyFile* file = MyMoneyFile::instance();
- QString accountId;
+ TQString accountId;
// Try to find an existing account in the engine which matches this one.
// There are two ways to be a "matching account". The account number can
// match the statement account OR the "StatementKey" property can match.
// Either way, we'll update the "StatementKey" property for next time.
- QString accountNumber = account.number();
+ TQString accountNumber = account.number();
if ( ! accountNumber.isEmpty() )
{
// Get a list of all accounts
- QValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount> accounts;
file->accountList(accounts);
// Iterate through them
- QValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
+ TQValueList<MyMoneyAccount>::const_iterator it_account = accounts.begin();
while ( it_account != accounts.end() )
{
if (
@@ -1270,13 +1270,13 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
}
}
- QString msg = i18n("<b>You have downloaded a statement for the following account:</b><br><br>");
- msg += i18n(" - Account Name: %1").arg(account.name()) + "<br>";
- msg += i18n(" - Account Type: %1").arg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "<br>";
- msg += i18n(" - Account Number: %1").arg(account.number()) + "<br>";
+ TQString msg = i18n("<b>You have downloaded a statement for the following account:</b><br><br>");
+ msg += i18n(" - Account Name: %1").tqarg(account.name()) + "<br>";
+ msg += i18n(" - Account Type: %1").tqarg(KMyMoneyUtils::accountTypeToString(account.accountType())) + "<br>";
+ msg += i18n(" - Account Number: %1").tqarg(account.number()) + "<br>";
msg += "<br>";
- QString header;
+ TQString header;
if(!account.name().isEmpty())
{
@@ -1302,11 +1302,11 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
accountSelect.setMode(false);
accountSelect.showAbortButton(true);
accountSelect.m_qifEntry->hide();
- QString accname;
+ TQString accname;
bool done = false;
while ( !done )
{
- if ( accountSelect.exec() == QDialog::Accepted && !accountSelect.selectedAccount().isEmpty() )
+ if ( accountSelect.exec() == TQDialog::Accepted && !accountSelect.selectedAccount().isEmpty() )
{
result = true;
done = true;
@@ -1332,18 +1332,18 @@ bool MyMoneyStatementReader::selectOrCreateAccount(const SelectCreateMode /*mode
//throw new MYMONEYEXCEPTION("USERABORT");
done = true;
else
- KMessageBox::error(0, QString("<qt>%1</qt>").arg(i18n("You must select an account, create a new one, or press the <b>Abort</b> button.")));
+ KMessageBox::error(0, TQString("<qt>%1</qt>").tqarg(i18n("You must select an account, create a new one, or press the <b>Abort</b> button.")));
}
}
return result;
}
-void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const QString&))
+void MyMoneyStatementReader::setProgressCallback(void(*callback)(int, int, const TQString&))
{
m_progressCallback = callback;
}
-void MyMoneyStatementReader::signalProgress(int current, int total, const QString& msg)
+void MyMoneyStatementReader::signalProgress(int current, int total, const TQString& msg)
{
if(m_progressCallback != 0)
(*m_progressCallback)(current, total, msg);