summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/mymoneyfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/mymoney/mymoneyfile.cpp')
-rw-r--r--kmymoney2/mymoney/mymoneyfile.cpp526
1 files changed, 263 insertions, 263 deletions
diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp
index 3245746..8707614 100644
--- a/kmymoney2/mymoney/mymoneyfile.cpp
+++ b/kmymoney2/mymoney/mymoneyfile.cpp
@@ -19,9 +19,9 @@
// ----------------------------------------------------------------------------
// QT Includes
-#include <qstring.h>
-#include <qdatetime.h>
-#include <qvaluelist.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+#include <tqvaluelist.h>
// ----------------------------------------------------------------------------
// KDE Includes
@@ -44,8 +44,8 @@
#include "config.h"
#endif
-const QString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances");
-const QString MyMoneyFile::AccountSeperator = ":";
+const TQString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances");
+const TQString MyMoneyFile::AccountSeperator = ":";
// include the following line to get a 'cout' for debug purposes
// #include <iostream>
@@ -71,7 +71,7 @@ public:
* false - don't reload the object immediately
* true - reload the object immediately
*/
- QMap<QString, bool> m_notificationList;
+ TQMap<TQString, bool> m_notificationList;
};
@@ -146,7 +146,7 @@ void MyMoneyFile::checkTransaction(const char* txt) const
{
checkStorage();
if(!d->m_inTransaction) {
- throw new MYMONEYEXCEPTION(QString("No transaction started for %1").arg(txt));
+ throw new MYMONEYEXCEPTION(TQString("No transaction started for %1").tqarg(txt));
}
}
@@ -175,7 +175,7 @@ void MyMoneyFile::addInstitution(MyMoneyInstitution& institution)
{
// perform some checks to see that the institution stuff is OK. For
// now we assume that the institution must have a name, the ID is not set
- // and it does not have a parent (MyMoneyFile).
+ // and it does not have a tqparent (MyMoneyFile).
if(institution.name().length() == 0
|| institution.id().length() != 0)
@@ -212,7 +212,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction)
// now check the splits
bool loanAccountAffected = false;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) {
// the following line will throw an exception if the
// account does not exist
@@ -229,7 +229,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction)
// into amortization splits
if(loanAccountAffected) {
tCopy = transaction;
- QValueList<MyMoneySplit> list = transaction.splits();
+ TQValueList<MyMoneySplit> list = transaction.splits();
for(it_s = list.begin(); it_s != list.end(); ++it_s) {
if((*it_s).action() == MyMoneySplit::ActionTransfer) {
MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId());
@@ -318,7 +318,7 @@ void MyMoneyFile::modifyAccount(const MyMoneyAccount& _account)
addNotification(account.id());
}
-void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent)
+void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent)
{
checkTransaction(__PRETTY_FUNCTION__);
@@ -326,47 +326,47 @@ void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& paren
if(isStandardAccount(account.id()))
throw new MYMONEYEXCEPTION("Unable to reparent the standard account groups");
- if(account.accountGroup() == parent.accountGroup()
- || (account.accountType() == MyMoneyAccount::Income && parent.accountType() == MyMoneyAccount::Expense)
- || (account.accountType() == MyMoneyAccount::Expense && parent.accountType() == MyMoneyAccount::Income)) {
+ if(account.accountGroup() == tqparent.accountGroup()
+ || (account.accountType() == MyMoneyAccount::Income && tqparent.accountType() == MyMoneyAccount::Expense)
+ || (account.accountType() == MyMoneyAccount::Expense && tqparent.accountType() == MyMoneyAccount::Income)) {
- if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment)
+ if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment)
throw new MYMONEYEXCEPTION("Unable to reparent Stock to non-investment account");
- if(parent.accountType() == MyMoneyAccount::Investment && !account.isInvest())
+ if(tqparent.accountType() == MyMoneyAccount::Investment && !account.isInvest())
throw new MYMONEYEXCEPTION("Unable to reparent non-stock to investment account");
// clear all changed objects from cache
MyMoneyNotifier notifier(this);
- // keep a notification of the current parent
- addNotification(account.parentAccountId());
+ // keep a notification of the current tqparent
+ addNotification(account.tqparentAccountId());
- m_storage->reparentAccount(account, parent);
+ m_storage->reparentAccount(account, tqparent);
- // and also keep one for the account itself and the new parent
+ // and also keep one for the account itself and the new tqparent
addNotification(account.id());
- addNotification(parent.id());
+ addNotification(tqparent.id());
} else
throw new MYMONEYEXCEPTION("Unable to reparent to different account type");
}
-const MyMoneyInstitution& MyMoneyFile::institution(const QString& id) const
+const MyMoneyInstitution& MyMoneyFile::institution(const TQString& id) const
{
return d->m_cache.institution(id);
}
-const MyMoneyAccount& MyMoneyFile::account(const QString& id) const
+const MyMoneyAccount& MyMoneyFile::account(const TQString& id) const
{
return d->m_cache.account(id);
}
-const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const QString& name) const
+const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const TQString& name) const
{
static MyMoneyAccount nullAccount;
- QValueList<QString>::const_iterator it_a;
+ TQValueList<TQString>::const_iterator it_a;
for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) {
const MyMoneyAccount& sacc = account(*it_a);
if(sacc.name() == name)
@@ -375,7 +375,7 @@ const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, c
return nullAccount;
}
-const MyMoneyAccount& MyMoneyFile::accountByName(const QString& name) const
+const MyMoneyAccount& MyMoneyFile::accountByName(const TQString& name) const
{
return d->m_cache.accountByName(name);
}
@@ -389,7 +389,7 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction)
// get the engine's idea about this transaction
MyMoneyTransaction tr = MyMoneyFile::transaction(transaction.id());
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
// scan the splits again to update notification list
for(it_s = tr.splits().begin(); it_s != tr.splits().end(); ++it_s) {
@@ -404,21 +404,21 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction)
}
-bool MyMoneyFile::hasActiveSplits(const QString& id) const
+bool MyMoneyFile::hasActiveSplits(const TQString& id) const
{
checkStorage();
return m_storage->hasActiveSplits(id);
}
-bool MyMoneyFile::isStandardAccount(const QString& id) const
+bool MyMoneyFile::isStandardAccount(const TQString& id) const
{
checkStorage();
return m_storage->isStandardAccount(id);
}
-void MyMoneyFile::setAccountName(const QString& id, const QString& name) const
+void MyMoneyFile::setAccountName(const TQString& id, const TQString& name) const
{
checkTransaction(__PRETTY_FUNCTION__);
@@ -429,14 +429,14 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account)
{
checkTransaction(__PRETTY_FUNCTION__);
- MyMoneyAccount parent;
+ MyMoneyAccount tqparent;
MyMoneyAccount acc;
MyMoneyInstitution institution;
- // check that the account and its parent exist
+ // check that the account and its tqparent exist
// this will throw an exception if the id is unknown
acc = MyMoneyFile::account(account.id());
- parent = MyMoneyFile::account(account.parentAccountId());
+ tqparent = MyMoneyFile::account(account.tqparentAccountId());
if(!acc.institutionId().isEmpty())
institution = MyMoneyFile::institution(acc.institutionId());
@@ -452,25 +452,25 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account)
MyMoneyNotifier notifier(this);
// collect all sub-ordinate accounts for notification
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for(it = acc.accountList().begin(); it != acc.accountList().end(); ++it)
addNotification(*it);
- // don't forget the parent and a possible institution
- addNotification(parent.id());
+ // don't forget the tqparent and a possible institution
+ addNotification(tqparent.id());
addNotification(account.institutionId());
if(!institution.id().isEmpty()) {
institution.removeAccountId(account.id());
m_storage->modifyInstitution(institution);
}
- acc.setInstitutionId(QString());
+ acc.setInstitutionId(TQString());
m_storage->removeAccount(acc);
addNotification(acc.id(), false);
d->m_cache.clear(acc.id());
}
-void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned int level) {
+void MyMoneyFile::removeAccountList(const TQStringList& account_list, unsigned int level) {
if (level > 100)
throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::removeAccountList]!");
@@ -486,7 +486,7 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in
}
// process all accounts in the list and test if they have transactions assigned
- for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) {
+ for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) {
MyMoneyAccount a = m_storage->account(*it);
//kdDebug() << "Deleting account '"<< a.name() << "'" << endl;
@@ -503,12 +503,12 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in
}
}
-bool MyMoneyFile::hasOnlyUnusedAccounts(const QStringList& account_list, unsigned int level)
+bool MyMoneyFile::hasOnlyUnusedAccounts(const TQStringList& account_list, unsigned int level)
{
if (level > 100)
throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::hasOnlyUnusedAccounts]!");
// process all accounts in the list and test if they have transactions assigned
- for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) {
+ for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) {
if (transactionCount(*it) != 0)
return false; // the current account has a transaction assigned
if (!hasOnlyUnusedAccounts(account(*it).accountList(), level+1))
@@ -525,14 +525,14 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution)
// clear all changed objects from cache
MyMoneyNotifier notifier(this);
- QValueList<QString>::ConstIterator it_a;
+ TQValueList<TQString>::ConstIterator it_a;
MyMoneyInstitution inst = MyMoneyFile::institution(institution.id());
bool blocked = signalsBlocked();
blockSignals(true);
for(it_a = inst.accountList().begin(); it_a != inst.accountList().end(); ++it_a) {
MyMoneyAccount acc = account(*it_a);
- acc.setInstitutionId(QString());
+ acc.setInstitutionId(TQString());
modifyAccount(acc);
}
blockSignals(blocked);
@@ -542,7 +542,7 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution)
addNotification(institution.id(), false);
}
-void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
+void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& tqparent)
{
checkTransaction(__PRETTY_FUNCTION__);
@@ -550,7 +550,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
// perform some checks to see that the account stuff is OK. For
// now we assume that the account must have a name, has no
- // transaction and sub-accounts and parent account
+ // transaction and sub-accounts and tqparent account
// it's own ID is not set and it does not have a pointer to (MyMoneyFile)
if(account.name().length() == 0)
@@ -562,16 +562,16 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
if(account.accountList().count() != 0)
throw new MYMONEYEXCEPTION("New account must have no sub-accounts");
- if(!account.parentAccountId().isEmpty())
- throw new MYMONEYEXCEPTION("New account must have no parent-id");
+ if(!account.tqparentAccountId().isEmpty())
+ throw new MYMONEYEXCEPTION("New account must have no tqparent-id");
if(account.accountType() == MyMoneyAccount::UnknownAccountType)
throw new MYMONEYEXCEPTION("Account has invalid type");
- // make sure, that the parent account exists
+ // make sure, that the tqparent account exists
// if not, an exception is thrown. If it exists,
// get a copy of the current data
- MyMoneyAccount acc = MyMoneyFile::account(parent.id());
+ MyMoneyAccount acc = MyMoneyFile::account(tqparent.id());
#if 0
// TODO: remove the following code as we now can have multiple accounts
@@ -579,7 +579,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
//
// check if the selected name is currently not among the child accounts
// if we find one, then return it as the new account
- QStringList::const_iterator it_a;
+ TQStringList::const_iterator it_a;
for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) {
MyMoneyAccount a = MyMoneyFile::account(*it_a);
if(account.name() == a.name()) {
@@ -589,23 +589,23 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
}
#endif
- // FIXME: make sure, that the parent has the same type
+ // FIXME: make sure, that the tqparent has the same type
// I left it out here because I don't know, if there is
// a tight coupling between e.g. checking accounts and the
// class asset. It certainly does not make sense to create an
// expense account under an income account. Maybe it does, I don't know.
- // We enforce, that a stock account can never be a parent and
- // that the parent for a stock account must be an investment. Also,
- // an investment cannot have another investment account as it's parent
- if(parent.isInvest())
- throw new MYMONEYEXCEPTION("Stock account cannot be parent account");
+ // We enforce, that a stock account can never be a tqparent and
+ // that the tqparent for a stock account must be an investment. Also,
+ // an investment cannot have another investment account as it's tqparent
+ if(tqparent.isInvest())
+ throw new MYMONEYEXCEPTION("Stock account cannot be tqparent account");
- if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment)
- throw new MYMONEYEXCEPTION("Stock account must have investment account as parent ");
+ if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment)
+ throw new MYMONEYEXCEPTION("Stock account must have investment account as tqparent ");
- if(!account.isInvest() && parent.accountType() == MyMoneyAccount::Investment)
- throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as children");
+ if(!account.isInvest() && tqparent.accountType() == MyMoneyAccount::Investment)
+ throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as tqchildren");
// clear all changed objects from cache
MyMoneyNotifier notifier(this);
@@ -619,13 +619,13 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
if(!account.openingDate().isValid()) {
- account.setOpeningDate(QDate::currentDate());
+ account.setOpeningDate(TQDate::tqcurrentDate());
}
- account.setParentAccountId(parent.id());
+ account.setParentAccountId(tqparent.id());
m_storage->addAccount(account);
- m_storage->addAccount(parent, account);
+ m_storage->addAccount(tqparent, account);
if(account.institutionId().length() != 0) {
institution.addAccountId(account.id());
@@ -634,7 +634,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent)
}
d->m_cache.preloadAccount(account);
- addNotification(parent.id());
+ addNotification(tqparent.id());
}
MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAccount& acc, const MyMoneyMoney& balance)
@@ -674,9 +674,9 @@ MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAcc
return t;
}
-QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const
+TQString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const
{
- QString result;
+ TQString result;
MyMoneySecurity currency = security(acc.currencyId());
MyMoneyAccount openAcc;
@@ -694,8 +694,8 @@ QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const
// Iterate over all the opening balance transactions for this currency
MyMoneyTransactionFilter filter;
filter.addAccount(openAcc.id());
- QValueList<MyMoneyTransaction> transactions = transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
while ( it_t != transactions.end() )
{
try
@@ -757,10 +757,10 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe
throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported");
MyMoneyAccount acc;
- QRegExp match(QString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix)));
+ TQRegExp match(TQString("^%1").tqarg(i18n(MyMoneyFile::OpeningBalancesPrefix)));
- QValueList<MyMoneyAccount> accounts;
- QValueList<MyMoneyAccount>::Iterator it;
+ TQValueList<MyMoneyAccount> accounts;
+ TQValueList<MyMoneyAccount>::Iterator it;
accountList(accounts, equity().accountList(), true);
@@ -774,7 +774,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe
}
if(acc.id().isEmpty()) {
- throw new MYMONEYEXCEPTION(QString("No opening balance account for %1").arg(security.tradingSymbol()));
+ throw new MYMONEYEXCEPTION(TQString("No opening balance account for %1").tqarg(security.tradingSymbol()));
}
return acc;
@@ -785,16 +785,16 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur
checkTransaction(__PRETTY_FUNCTION__);
MyMoneyAccount acc;
- QString name(i18n(MyMoneyFile::OpeningBalancesPrefix));
+ TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix));
if(security.id() != baseCurrency().id()) {
- name += QString(" (%1)").arg(security.id());
+ name += TQString(" (%1)").tqarg(security.id());
}
acc.setName(name);
acc.setAccountType(MyMoneyAccount::Equity);
acc.setCurrencyId(security.id());
- MyMoneyAccount parent = equity();
- this->addAccount(acc, parent);
+ MyMoneyAccount tqparent = equity();
+ this->addAccount(acc, tqparent);
return acc;
}
@@ -819,7 +819,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction)
// now check the splits
bool loanAccountAffected = false;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) {
// the following line will throw an exception if the
// account does not exist or is one of the standard accounts
@@ -835,7 +835,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction)
// change transfer splits between asset/liability and loan accounts
// into amortization splits
if(loanAccountAffected) {
- QValueList<MyMoneySplit> list = transaction.splits();
+ TQValueList<MyMoneySplit> list = transaction.splits();
for(it_s = list.begin(); it_s != list.end(); ++it_s) {
if((*it_s).action() == MyMoneySplit::ActionTransfer) {
MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId());
@@ -864,14 +864,14 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction)
}
}
-const MyMoneyTransaction MyMoneyFile::transaction(const QString& id) const
+const MyMoneyTransaction MyMoneyFile::transaction(const TQString& id) const
{
checkStorage();
return m_storage->transaction(id);
}
-const MyMoneyTransaction MyMoneyFile::transaction(const QString& account, const int idx) const
+const MyMoneyTransaction MyMoneyFile::transaction(const TQString& account, const int idx) const
{
checkStorage();
@@ -890,12 +890,12 @@ void MyMoneyFile::addPayee(MyMoneyPayee& payee)
d->m_cache.preloadPayee(payee);
}
-const MyMoneyPayee& MyMoneyFile::payee(const QString& id) const
+const MyMoneyPayee& MyMoneyFile::payee(const TQString& id) const
{
return d->m_cache.payee(id);
}
-const MyMoneyPayee& MyMoneyFile::payeeByName(const QString& name) const
+const MyMoneyPayee& MyMoneyFile::payeeByName(const TQString& name) const
{
checkStorage();
@@ -926,7 +926,7 @@ void MyMoneyFile::removePayee(const MyMoneyPayee& payee)
addNotification(payee.id(), false);
}
-void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringList& idlist, const bool recursive) const
+void MyMoneyFile::accountList(TQValueList<MyMoneyAccount>& list, const TQStringList& idlist, const bool recursive) const
{
if(idlist.isEmpty()) {
d->m_cache.account(list);
@@ -940,8 +940,8 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis
}
#endif
- QValueList<MyMoneyAccount>::Iterator it;
- QValueList<MyMoneyAccount>::Iterator next;
+ TQValueList<MyMoneyAccount>::Iterator it;
+ TQValueList<MyMoneyAccount>::Iterator next;
for(it = list.begin(); it != list.end(); ) {
if(isStandardAccount( (*it).id() )) {
it = list.erase(it);
@@ -950,13 +950,13 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis
}
}
} else {
- QValueList<MyMoneyAccount>::ConstIterator it;
- QValueList<MyMoneyAccount> list_a;
+ TQValueList<MyMoneyAccount>::ConstIterator it;
+ TQValueList<MyMoneyAccount> list_a;
d->m_cache.account(list_a);
for(it = list_a.begin(); it != list_a.end(); ++it) {
if(!isStandardAccount((*it).id())) {
- if(idlist.findIndex((*it).id()) != -1) {
+ if(idlist.tqfindIndex((*it).id()) != -1) {
list.append(*it);
if(recursive == true) {
accountList(list, (*it).accountList(), true);
@@ -967,14 +967,14 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis
}
}
-void MyMoneyFile::institutionList(QValueList<MyMoneyInstitution>& list) const
+void MyMoneyFile::institutionList(TQValueList<MyMoneyInstitution>& list) const
{
d->m_cache.institution(list);
}
-const QValueList<MyMoneyInstitution> MyMoneyFile::institutionList(void) const
+const TQValueList<MyMoneyInstitution> MyMoneyFile::institutionList(void) const
{
- QValueList<MyMoneyInstitution> list;
+ TQValueList<MyMoneyInstitution> list;
institutionList(list);
return list;
}
@@ -1055,17 +1055,17 @@ const MyMoneyAccount& MyMoneyFile::equity(void) const
{
checkStorage();
- return d->m_cache.account (STD_ACC_EQUITY);
+ return d->m_cache.account (STD_ACC_ETQUITY);
}
-unsigned int MyMoneyFile::transactionCount(const QString& account) const
+unsigned int MyMoneyFile::transactionCount(const TQString& account) const
{
checkStorage();
return m_storage->transactionCount(account);
}
-const QMap<QString, unsigned long> MyMoneyFile::transactionCountMap(void) const
+const TQMap<TQString, unsigned long> MyMoneyFile::transactionCountMap(void) const
{
checkStorage();
@@ -1079,21 +1079,21 @@ unsigned int MyMoneyFile::institutionCount(void) const
return m_storage->institutionCount();
}
-const MyMoneyMoney MyMoneyFile::balance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneyFile::balance(const TQString& id, const TQDate& date) const
{
checkStorage();
return m_storage->balance(id, date);
}
-const MyMoneyMoney MyMoneyFile::totalBalance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneyFile::totalBalance(const TQString& id, const TQDate& date) const
{
checkStorage();
return m_storage->totalBalance(id, date);
}
-void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId) const
+void MyMoneyFile::warningMissingRate(const TQString& fromId, const TQString& toId) const
{
MyMoneySecurity from, to;
try {
@@ -1109,7 +1109,7 @@ void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId)
void MyMoneyFile::notify(void)
{
- QMap<QString, bool>::ConstIterator it;
+ TQMap<TQString, bool>::ConstIterator it;
for(it = d->m_notificationList.begin(); it != d->m_notificationList.end(); ++it) {
if(*it)
d->m_cache.refresh(it.key());
@@ -1119,7 +1119,7 @@ void MyMoneyFile::notify(void)
clearNotification();
}
-void MyMoneyFile::addNotification(const QString& id, bool reload)
+void MyMoneyFile::addNotification(const TQString& id, bool reload)
{
if(!id.isEmpty())
d->m_notificationList[id] = reload;
@@ -1131,36 +1131,36 @@ void MyMoneyFile::clearNotification()
d->m_notificationList.clear();
}
-void MyMoneyFile::transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyFile::transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
{
checkStorage();
m_storage->transactionList(list, filter);
}
-void MyMoneyFile::transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyFile::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
{
checkStorage();
m_storage->transactionList(list, filter);
}
-const QValueList<MyMoneyTransaction> MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const
+const TQValueList<MyMoneyTransaction> MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const
{
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
transactionList(list, filter);
return list;
}
-const QValueList<MyMoneyPayee> MyMoneyFile::payeeList(void) const
+const TQValueList<MyMoneyPayee> MyMoneyFile::payeeList(void) const
{
- QValueList<MyMoneyPayee> list;
+ TQValueList<MyMoneyPayee> list;
d->m_cache.payee(list);
return list;
}
-QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeStandardAccounts) const
+TQString MyMoneyFile::accountToCategory(const TQString& accountId, bool includeStandardAccounts) const
{
MyMoneyAccount acc;
- QString rc;
+ TQString rc;
if(!accountId.isEmpty()) {
acc = account(accountId);
@@ -1168,15 +1168,15 @@ QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeSta
if(!rc.isEmpty())
rc = AccountSeperator + rc;
rc = acc.name() + rc;
- acc = account(acc.parentAccountId());
+ acc = account(acc.tqparentAccountId());
} while(!acc.id().isEmpty() && (includeStandardAccounts || !isStandardAccount(acc.id())));
}
return rc;
}
-QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount::accountTypeE type) const
+TQString MyMoneyFile::categoryToAccount(const TQString& category, MyMoneyAccount::accountTypeE type) const
{
- QString id;
+ TQString id;
// search the category in the expense accounts and if it is not found, try
// to locate it in the income accounts
@@ -1193,9 +1193,9 @@ QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount::
return id;
}
-QString MyMoneyFile::nameToAccount(const QString& name) const
+TQString MyMoneyFile::nameToAccount(const TQString& name) const
{
- QString id;
+ TQString id;
// search the category in the asset accounts and if it is not found, try
// to locate it in the liability accounts
@@ -1206,20 +1206,20 @@ QString MyMoneyFile::nameToAccount(const QString& name) const
return id;
}
-QString MyMoneyFile::parentName(const QString& name) const
+TQString MyMoneyFile::tqparentName(const TQString& name) const
{
return name.section(AccountSeperator, 0, -2);
}
-QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString& category) const
+TQString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const TQString& category) const
{
MyMoneyAccount nextBase;
- QString level, remainder;
+ TQString level, remainder;
level = category.section(AccountSeperator, 0, 0);
remainder = category.section(AccountSeperator, 1);
- QStringList list = base.accountList();
- QStringList::ConstIterator it_a;
+ TQStringList list = base.accountList();
+ TQStringList::ConstIterator it_a;
for(it_a = list.begin(); it_a != list.end(); ++it_a) {
nextBase = account(*it_a);
@@ -1230,17 +1230,17 @@ QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString&
return locateSubAccount(nextBase, remainder);
}
}
- return QString();
+ return TQString();
}
-QString MyMoneyFile::value(const QString& key) const
+TQString MyMoneyFile::value(const TQString& key) const
{
checkStorage();
return m_storage->value(key);
}
-void MyMoneyFile::setValue(const QString& key, const QString& val)
+void MyMoneyFile::setValue(const TQString& key, const TQString& val)
{
checkTransaction(__PRETTY_FUNCTION__);
@@ -1250,7 +1250,7 @@ void MyMoneyFile::setValue(const QString& key, const QString& val)
m_storage->setValue(key, val);
}
-void MyMoneyFile::deletePair(const QString& key)
+void MyMoneyFile::deletePair(const TQString& key)
{
checkTransaction(__PRETTY_FUNCTION__);
@@ -1265,7 +1265,7 @@ void MyMoneyFile::addSchedule(MyMoneySchedule& sched)
checkTransaction(__PRETTY_FUNCTION__);
MyMoneyTransaction transaction = sched.transaction();
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) {
// the following line will throw an exception if the
// account does not exist or is one of the standard accounts
@@ -1287,7 +1287,7 @@ void MyMoneyFile::modifySchedule(const MyMoneySchedule& sched)
checkTransaction(__PRETTY_FUNCTION__);
MyMoneyTransaction transaction = sched.transaction();
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) {
// the following line will throw an exception if the
// account does not exist or is one of the standard accounts
@@ -1318,18 +1318,18 @@ void MyMoneyFile::removeSchedule(const MyMoneySchedule& sched)
addNotification(sched.id(), false);
}
-const MyMoneySchedule MyMoneyFile::schedule(const QString& id) const
+const MyMoneySchedule MyMoneyFile::schedule(const TQString& id) const
{
return d->m_cache.schedule(id);
}
-const QValueList<MyMoneySchedule> MyMoneyFile::scheduleList(
- const QString& accountId,
+const TQValueList<MyMoneySchedule> MyMoneyFile::scheduleList(
+ const TQString& accountId,
const MyMoneySchedule::typeE type,
const MyMoneySchedule::occurenceE occurence,
const MyMoneySchedule::paymentTypeE paymentType,
- const QDate& startDate,
- const QDate& endDate,
+ const TQDate& startDate,
+ const TQDate& endDate,
const bool overdue) const
{
checkStorage();
@@ -1338,29 +1338,29 @@ const QValueList<MyMoneySchedule> MyMoneyFile::scheduleList(
}
-const QStringList MyMoneyFile::consistencyCheck(void)
+const TQStringList MyMoneyFile::consistencyCheck(void)
{
- QValueList<MyMoneyAccount> list;
- QValueList<MyMoneyAccount>::Iterator it_a;
- QValueList<MyMoneySchedule>::Iterator it_sch;
- QValueList<MyMoneyPayee>::Iterator it_p;
- QValueList<MyMoneyTransaction>::Iterator it_t;
- QValueList<MyMoneyReport>::Iterator it_r;
- QStringList accountRebuild;
- QStringList::ConstIterator it_c;
+ TQValueList<MyMoneyAccount> list;
+ TQValueList<MyMoneyAccount>::Iterator it_a;
+ TQValueList<MyMoneySchedule>::Iterator it_sch;
+ TQValueList<MyMoneyPayee>::Iterator it_p;
+ TQValueList<MyMoneyTransaction>::Iterator it_t;
+ TQValueList<MyMoneyReport>::Iterator it_r;
+ TQStringList accountRebuild;
+ TQStringList::ConstIterator it_c;
- QMap<QString, bool> interestAccounts;
+ TQMap<TQString, bool> interestAccounts;
- MyMoneyAccount parent;
+ MyMoneyAccount tqparent;
MyMoneyAccount child;
MyMoneyAccount toplevel;
- QString parentId;
- QStringList rc;
+ TQString tqparentId;
+ TQStringList rc;
int problemCount = 0;
int unfixedCount = 0;
- QString problemAccount;
+ TQString problemAccount;
// check that we have a storage object
checkTransaction(__PRETTY_FUNCTION__);
@@ -1404,27 +1404,27 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
// check for loops in the hierarchy
- parentId = (*it_a).parentAccountId();
+ tqparentId = (*it_a).tqparentAccountId();
try {
bool dropOut = false;
- while(!isStandardAccount(parentId) && !dropOut) {
- parent = account(parentId);
- if(parent.id() == (*it_a).id()) {
- // parent loops, so we need to re-parent to toplevel account
- // find parent account in our list
+ while(!isStandardAccount(tqparentId) && !dropOut) {
+ tqparent = account(tqparentId);
+ if(tqparent.id() == (*it_a).id()) {
+ // tqparent loops, so we need to re-tqparent to toplevel account
+ // find tqparent account in our list
problemCount++;
- QValueList<MyMoneyAccount>::Iterator it_b;
+ TQValueList<MyMoneyAccount>::Iterator it_b;
for(it_b = list.begin(); it_b != list.end(); ++it_b) {
- if((*it_b).id() == parent.id()) {
+ if((*it_b).id() == tqparent.id()) {
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
- rc << i18n(" * Loop detected between this account and account '%2'.").arg((*it_b).name());
- rc << i18n(" Reparenting account '%2' to top level account '%1'.").arg(toplevel.name(), (*it_a).name());
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
+ rc << i18n(" * Loop detected between this account and account '%2'.").tqarg((*it_b).name());
+ rc << i18n(" Retqparenting account '%2' to top level account '%1'.").tqarg(toplevel.name(), (*it_a).name());
(*it_a).setParentAccountId(toplevel.id());
- if(accountRebuild.contains(toplevel.id()) == 0)
+ if(accountRebuild.tqcontains(toplevel.id()) == 0)
accountRebuild << toplevel.id();
- if(accountRebuild.contains((*it_a).id()) == 0)
+ if(accountRebuild.tqcontains((*it_a).id()) == 0)
accountRebuild << (*it_a).id();
dropOut = true;
break;
@@ -1432,70 +1432,70 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
}
}
- parentId = parent.parentAccountId();
+ tqparentId = tqparent.tqparentAccountId();
}
} catch(MyMoneyException *e) {
- // if we don't know about a parent, we catch it later
+ // if we don't know about a tqparent, we catch it later
delete e;
}
- // check that the parent exists
- parentId = (*it_a).parentAccountId();
+ // check that the tqparent exists
+ tqparentId = (*it_a).tqparentAccountId();
try {
- parent = account(parentId);
- if((*it_a).accountGroup() != parent.accountGroup()) {
+ tqparent = account(tqparentId);
+ if((*it_a).accountGroup() != tqparent.accountGroup()) {
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- // the parent belongs to a different group, so we reconnect to the
+ // the tqparent belongs to a different group, so we reconnect to the
// master group account (asset, liability, etc) to which this account
// should belong and update it in the engine.
- rc << i18n(" * Parent account '%1' belongs to a different group.").arg(parent.name());
- rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name());
+ rc << i18n(" * Parent account '%1' belongs to a different group.").tqarg(tqparent.name());
+ rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name());
(*it_a).setParentAccountId(toplevel.id());
// make sure to rebuild the sub-accounts of the top account
// and the one we removed this account from
- if(accountRebuild.contains(toplevel.id()) == 0)
+ if(accountRebuild.tqcontains(toplevel.id()) == 0)
accountRebuild << toplevel.id();
- if(accountRebuild.contains(parent.id()) == 0)
- accountRebuild << parent.id();
- } else if(!parent.accountList().contains((*it_a).id())) {
+ if(accountRebuild.tqcontains(tqparent.id()) == 0)
+ accountRebuild << tqparent.id();
+ } else if(!tqparent.accountList().tqcontains((*it_a).id())) {
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- // parent exists, but does not have a reference to the account
- rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").arg(parent.name(), problemAccount);
- if(accountRebuild.contains(parent.id()) == 0)
- accountRebuild << parent.id();
+ // tqparent exists, but does not have a reference to the account
+ rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").tqarg(tqparent.name(), problemAccount);
+ if(accountRebuild.tqcontains(tqparent.id()) == 0)
+ accountRebuild << tqparent.id();
}
} catch(MyMoneyException *e) {
delete e;
- // apparently, the parent does not exist anymore. we reconnect to the
+ // aptqparently, the tqparent does not exist anymore. we reconnect to the
// master group account (asset, liability, etc) to which this account
// should belong and update it in the engine.
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- rc << i18n(" * The parent with id %1 does not exist anymore.").arg(parentId);
- rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name());
+ rc << i18n(" * The tqparent with id %1 does not exist anymore.").tqarg(tqparentId);
+ rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name());
(*it_a).setParentAccountId(toplevel.id());
addNotification((*it_a).id());
// make sure to rebuild the sub-accounts of the top account
- if(accountRebuild.contains(toplevel.id()) == 0)
+ if(accountRebuild.tqcontains(toplevel.id()) == 0)
accountRebuild << toplevel.id();
}
- // now check that all the children exist and have the correct type
+ // now check that all the tqchildren exist and have the correct type
for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end(); ++it_c) {
// check that the child exists
try {
@@ -1504,11 +1504,11 @@ const QStringList MyMoneyFile::consistencyCheck(void)
problemCount++;
if(problemAccount != (*it_a).name()) {
problemAccount = (*it_a).name();
- rc << i18n("* Problem with account '%1'").arg(problemAccount);
+ rc << i18n("* Problem with account '%1'").tqarg(problemAccount);
}
- rc << i18n(" * Child account with id %1 does not exist anymore.").arg(*it_c);
+ rc << i18n(" * Child account with id %1 does not exist anymore.").tqarg(*it_c);
rc << i18n(" The child account list will be reconstructed.");
- if(accountRebuild.contains((*it_a).id()) == 0)
+ if(accountRebuild.tqcontains((*it_a).id()) == 0)
accountRebuild << (*it_a).id();
}
}
@@ -1539,8 +1539,8 @@ const QStringList MyMoneyFile::consistencyCheck(void)
// clear the affected lists
for(it_a = list.begin(); it_a != list.end(); ++it_a) {
- if(accountRebuild.contains((*it_a).id())) {
- rc << QString(" %1").arg((*it_a).name());
+ if(accountRebuild.tqcontains((*it_a).id())) {
+ rc << TQString(" %1").tqarg((*it_a).name());
// clear the account list
for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end();) {
(*it_a).removeAccountId(*it_c);
@@ -1551,11 +1551,11 @@ const QStringList MyMoneyFile::consistencyCheck(void)
// reconstruct the lists
for(it_a = list.begin(); it_a != list.end(); ++it_a) {
- QValueList<MyMoneyAccount>::Iterator it;
- parentId = (*it_a).parentAccountId();
- if(accountRebuild.contains(parentId)) {
+ TQValueList<MyMoneyAccount>::Iterator it;
+ tqparentId = (*it_a).tqparentAccountId();
+ if(accountRebuild.tqcontains(tqparentId)) {
for(it = list.begin(); it != list.end(); ++it) {
- if((*it).id() == parentId) {
+ if((*it).id() == tqparentId) {
(*it).addAccountId((*it_a).id());
break;
}
@@ -1565,21 +1565,21 @@ const QStringList MyMoneyFile::consistencyCheck(void)
// update the engine objects
for(it_a = list.begin(); it_a != list.end(); ++it_a) {
- if(accountRebuild.contains((*it_a).id())) {
+ if(accountRebuild.tqcontains((*it_a).id())) {
try {
m_storage->modifyAccount(*it_a, true);
addNotification((*it_a).id());
} catch (MyMoneyException *e) {
delete e;
- rc << i18n(" * Unable to update account data for account %1 in engine").arg((*it_a).name());
+ rc << i18n(" * Unable to update account data for account %1 in engine").tqarg((*it_a).name());
}
}
}
// For some reason, files exist with invalid ids. This has been found in the payee id
// so we fix them here
- QValueList<MyMoneyPayee> pList = payeeList();
- QMap<QString, QString>payeeConversionMap;
+ TQValueList<MyMoneyPayee> pList = payeeList();
+ TQMap<TQString, TQString>payeeConversionMap;
for(it_p = pList.begin(); it_p != pList.end(); ++it_p) {
if((*it_p).id().length() > 7) {
@@ -1589,20 +1589,20 @@ const QStringList MyMoneyFile::consistencyCheck(void)
payee.clearId();
m_storage->addPayee(payee);
payeeConversionMap[(*it_p).id()] = payee.id();
- rc << i18n(" * Payee %1 recreated with fixed id").arg(payee.name());
+ rc << i18n(" * Payee %1 recreated with fixed id").tqarg(payee.name());
++problemCount;
}
}
// Fix the transactions
- QValueList<MyMoneyTransaction> tList;
+ TQValueList<MyMoneyTransaction> tList;
MyMoneyTransactionFilter filter;
filter.setReportAllSplits(false);
m_storage->transactionList(tList, filter);
// Generate the list of interest accounts
for(it_t = tList.begin(); it_t != tList.end(); ++it_t) {
const MyMoneyTransaction& t = (*it_t);
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) {
if((*it_s).action() == MyMoneySplit::ActionInterest)
interestAccounts[(*it_s).accountId()] = true;
@@ -1610,15 +1610,15 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
for(it_t = tList.begin(); it_t != tList.end(); ++it_t) {
MyMoneyTransaction t = (*it_t);
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
bool tChanged = false;
for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) {
bool sChanged = false;
MyMoneySplit s = (*it_s);
- if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) {
+ if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) {
s.setPayeeId(payeeConversionMap[s.payeeId()]);
sChanged = true;
- rc << i18n(" * Payee id updated in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * Payee id updated in split of transaction '%1'.").tqarg(t.id());
++problemCount;
}
@@ -1631,27 +1631,27 @@ const QStringList MyMoneyFile::consistencyCheck(void)
// use the value as master if the transaction is balanced
if(t.splitSum().isZero()) {
s.setShares(s.value());
- rc << i18n(" * shares set to value in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * shares set to value in split of transaction '%1'.").tqarg(t.id());
} else {
s.setValue(s.shares());
- rc << i18n(" * value set to shares in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * value set to shares in split of transaction '%1'.").tqarg(t.id());
}
sChanged = true;
++problemCount;
}
} catch(MyMoneyException *e) {
- rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").arg(t.id(), (*it_s).id(), (*it_s).accountId());
+ rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").tqarg(t.id(), (*it_s).id(), (*it_s).accountId());
++problemCount;
++unfixedCount;
delete e;
}
// make sure the interest splits are marked correct as such
- if(interestAccounts.find(s.accountId()) != interestAccounts.end()
+ if(interestAccounts.tqfind(s.accountId()) != interestAccounts.end()
&& s.action() != MyMoneySplit::ActionInterest) {
s.setAction(MyMoneySplit::ActionInterest);
sChanged = true;
- rc << i18n(" * action marked as interest in split of transaction '%1'.").arg(t.id());
+ rc << i18n(" * action marked as interest in split of transaction '%1'.").tqarg(t.id());
++problemCount;
}
@@ -1666,34 +1666,34 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
// Fix the schedules
- QValueList<MyMoneySchedule> schList = scheduleList();
+ TQValueList<MyMoneySchedule> schList = scheduleList();
for(it_sch = schList.begin(); it_sch != schList.end(); ++it_sch) {
MyMoneySchedule sch = (*it_sch);
MyMoneyTransaction t = sch.transaction();
bool tChanged = false;
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) {
MyMoneySplit s = (*it_s);
bool sChanged = false;
- if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) {
+ if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) {
s.setPayeeId(payeeConversionMap[s.payeeId()]);
sChanged = true;
- rc << i18n(" * Payee id updated in split of schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * Payee id updated in split of schedule '%1'.").tqarg((*it_sch).name());
++problemCount;
}
if(!(*it_s).value().isZero() && (*it_s).shares().isZero()) {
s.setShares(s.value());
sChanged = true;
- rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").arg((*it_sch).name());
+ rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").tqarg((*it_sch).name());
rc << i18n(" Shares set to value.");
++problemCount;
}
// make sure, we don't have a bankid stored with a split in a schedule
if(!(*it_s).bankID().isEmpty()) {
- s.setBankID(QString());
+ s.setBankID(TQString());
sChanged = true;
- rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").arg((*it_sch).name());
+ rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").tqarg((*it_sch).name());
++problemCount;
}
@@ -1706,16 +1706,16 @@ const QStringList MyMoneyFile::consistencyCheck(void)
// use the value as master if the transaction is balanced
if(t.splitSum().isZero()) {
s.setShares(s.value());
- rc << i18n(" * shares set to value in split in schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * shares set to value in split in schedule '%1'.").tqarg((*it_sch).name());
} else {
s.setValue(s.shares());
- rc << i18n(" * value set to shares in split in schedule '%1'.").arg((*it_sch).name());
+ rc << i18n(" * value set to shares in split in schedule '%1'.").tqarg((*it_sch).name());
}
sChanged = true;
++problemCount;
}
} catch(MyMoneyException *e) {
- rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").arg((*it_sch).name(), (*it_s).id(), (*it_s).accountId());
+ rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").tqarg((*it_sch).name(), (*it_s).id(), (*it_s).accountId());
++problemCount;
++unfixedCount;
delete e;
@@ -1732,16 +1732,16 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
// Fix the reports
- QValueList<MyMoneyReport> rList = reportList();
+ TQValueList<MyMoneyReport> rList = reportList();
for(it_r = rList.begin(); it_r != rList.end(); ++it_r) {
MyMoneyReport r = *it_r;
- QStringList pList;
- QStringList::Iterator it_p;
+ TQStringList pList;
+ TQStringList::Iterator it_p;
(*it_r).payees(pList);
bool rChanged = false;
for(it_p = pList.begin(); it_p != pList.end(); ++it_p) {
- if(payeeConversionMap.find(*it_p) != payeeConversionMap.end()) {
- rc << i18n(" * Payee id updated in report '%1'.").arg((*it_r).name());
+ if(payeeConversionMap.tqfind(*it_p) != payeeConversionMap.end()) {
+ rc << i18n(" * Payee id updated in report '%1'.").tqarg((*it_r).name());
++problemCount;
r.removeReference(*it_p);
r.addPayee(payeeConversionMap[*it_p]);
@@ -1754,11 +1754,11 @@ const QStringList MyMoneyFile::consistencyCheck(void)
}
// erase old payee ids
- QMap<QString, QString>::Iterator it_m;
+ TQMap<TQString, TQString>::Iterator it_m;
for(it_m = payeeConversionMap.begin(); it_m != payeeConversionMap.end(); ++it_m) {
MyMoneyPayee payee = this->payee(it_m.key());
removePayee(payee);
- rc << i18n(" * Payee '%1' removed.").arg(payee.id());
+ rc << i18n(" * Payee '%1' removed.").tqarg(payee.id());
++problemCount;
}
@@ -1768,23 +1768,23 @@ const QStringList MyMoneyFile::consistencyCheck(void)
rc << i18n("Finish! Data is consistent.");
else
rc << i18n("Finish! %1 problem(s) corrected. %2 problem(s) still present.")
- .arg(problemCount).arg(unfixedCount);
+ .tqarg(problemCount).tqarg(unfixedCount);
return rc;
}
-QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& name)
+TQString MyMoneyFile::createCategory(const MyMoneyAccount& base, const TQString& name)
{
checkTransaction(__PRETTY_FUNCTION__);
- MyMoneyAccount parent = base;
- QString categoryText;
+ MyMoneyAccount tqparent = base;
+ TQString categoryText;
if(base.id() != expense().id() && base.id() != income().id())
throw new MYMONEYEXCEPTION("Invalid base category");
- QStringList subAccounts = QStringList::split(AccountSeperator, name);
- QStringList::Iterator it;
+ TQStringList subAccounts = TQStringList::split(AccountSeperator, name);
+ TQStringList::Iterator it;
for (it = subAccounts.begin(); it != subAccounts.end(); ++it)
{
MyMoneyAccount categoryAccount;
@@ -1800,9 +1800,9 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n
// Only create the account if it doesn't exist
try
{
- QString categoryId = categoryToAccount(categoryText);
+ TQString categoryId = categoryToAccount(categoryText);
if (categoryId.isEmpty())
- addAccount(categoryAccount, parent);
+ addAccount(categoryAccount, tqparent);
else
{
categoryAccount = account(categoryId);
@@ -1812,23 +1812,23 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n
{
qDebug("Unable to add account %s, %s, %s: %s",
categoryAccount.name().latin1(),
- parent.name().latin1(),
+ tqparent.name().latin1(),
categoryText.latin1(),
e->what().latin1());
delete e;
}
- parent = categoryAccount;
+ tqparent = categoryAccount;
}
return categoryToAccount(name);
}
-const QValueList<MyMoneySchedule> MyMoneyFile::scheduleListEx( int scheduleTypes,
+const TQValueList<MyMoneySchedule> MyMoneyFile::scheduleListEx( int scheduleTypes,
int scheduleOcurrences,
int schedulePaymentTypes,
- QDate startDate,
- const QStringList& accounts) const
+ TQDate startDate,
+ const TQStringList& accounts) const
{
checkStorage();
@@ -1871,7 +1871,7 @@ void MyMoneyFile::removeSecurity(const MyMoneySecurity& security)
addNotification(security.id(), false);
}
-const MyMoneySecurity& MyMoneyFile::security(const QString& id) const
+const MyMoneySecurity& MyMoneyFile::security(const TQString& id) const
{
if(id.isEmpty())
return baseCurrency();
@@ -1879,7 +1879,7 @@ const MyMoneySecurity& MyMoneyFile::security(const QString& id) const
return d->m_cache.security(id);
}
-const QValueList<MyMoneySecurity> MyMoneyFile::securityList(void) const
+const TQValueList<MyMoneySecurity> MyMoneyFile::securityList(void) const
{
checkStorage();
@@ -1933,7 +1933,7 @@ void MyMoneyFile::removeCurrency(const MyMoneySecurity& currency)
addNotification(currency.id(), false);
}
-const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const
+const MyMoneySecurity& MyMoneyFile::currency(const TQString& id) const
{
if(id.isEmpty())
return baseCurrency();
@@ -1944,14 +1944,14 @@ const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const
return curr;
}
-const QValueList<MyMoneySecurity> MyMoneyFile::currencyList(void) const
+const TQValueList<MyMoneySecurity> MyMoneyFile::currencyList(void) const
{
checkStorage();
return m_storage->currencyList();
}
-const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString& second) const
+const TQString& MyMoneyFile::foreignCurrency(const TQString& first, const TQString& second) const
{
if(baseCurrency().id() == second)
return first;
@@ -1961,7 +1961,7 @@ const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString&
const MyMoneySecurity& MyMoneyFile::baseCurrency(void) const
{
if(d->m_baseCurrency.id().isEmpty()) {
- QString id = QString(value("kmm-baseCurrency"));
+ TQString id = TQString(value("kmm-baseCurrency"));
if(!id.isEmpty())
d->m_baseCurrency = currency(id);
}
@@ -1986,7 +1986,7 @@ void MyMoneyFile::setBaseCurrency(const MyMoneySecurity& curr)
void MyMoneyFile::addPrice(const MyMoneyPrice& price)
{
- if(price.rate(QString()).isZero())
+ if(price.rate(TQString()).isZero())
return;
checkTransaction(__PRETTY_FUNCTION__);
@@ -2007,11 +2007,11 @@ void MyMoneyFile::removePrice(const MyMoneyPrice& price)
m_storage->removePrice(price);
}
-const MyMoneyPrice MyMoneyFile::price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const
+const MyMoneyPrice MyMoneyFile::price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const
{
checkStorage();
- QString to(toId);
+ TQString to(toId);
if(to.isEmpty())
to = value("kmm-baseCurrency");
// if some id is missing, we can return an empty price object
@@ -2039,11 +2039,11 @@ const MyMoneyPriceList MyMoneyFile::priceList(void) const
return m_storage->priceList();
}
-bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const
+bool MyMoneyFile::hasAccount(const TQString& id, const TQString& name) const
{
MyMoneyAccount acc = d->m_cache.account(id);
- QStringList list = acc.accountList();
- QStringList::ConstIterator it;
+ TQStringList list = acc.accountList();
+ TQStringList::ConstIterator it;
bool rc = false;
for(it = list.begin(); rc == false && it != list.end(); ++it) {
MyMoneyAccount a = d->m_cache.account(*it);
@@ -2053,7 +2053,7 @@ bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const
return rc;
}
-const QValueList<MyMoneyReport> MyMoneyFile::reportList( void ) const
+const TQValueList<MyMoneyReport> MyMoneyFile::reportList( void ) const
{
checkStorage();
@@ -2089,7 +2089,7 @@ unsigned MyMoneyFile::countReports(void) const
return m_storage->countReports();
}
-const MyMoneyReport MyMoneyFile::report( const QString& id ) const
+const MyMoneyReport MyMoneyFile::report( const TQString& id ) const
{
checkStorage();
@@ -2107,7 +2107,7 @@ void MyMoneyFile::removeReport(const MyMoneyReport& report)
}
-const QValueList<MyMoneyBudget> MyMoneyFile::budgetList( void ) const
+const TQValueList<MyMoneyBudget> MyMoneyFile::budgetList( void ) const
{
checkStorage();
@@ -2124,7 +2124,7 @@ void MyMoneyFile::addBudget( MyMoneyBudget& budget )
m_storage->addBudget( budget );
}
-const MyMoneyBudget MyMoneyFile::budgetByName(const QString& name) const
+const MyMoneyBudget MyMoneyFile::budgetByName(const TQString& name) const
{
checkStorage();
@@ -2150,7 +2150,7 @@ unsigned MyMoneyFile::countBudgets(void) const
return m_storage->countBudgets();
}
-const MyMoneyBudget MyMoneyFile::budget( const QString& id ) const
+const MyMoneyBudget MyMoneyFile::budget( const TQString& id ) const
{
checkStorage();
@@ -2175,17 +2175,17 @@ bool MyMoneyFile::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArr
return m_storage->isReferenced(obj, skipChecks);
}
-bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const
+bool MyMoneyFile::checkNoUsed(const TQString& accId, const TQString& no) const
{
// by definition, an empty string or a non-numeric string is not used
- QRegExp exp(QString("(.*\\D)?(\\d+)(\\D.*)?"));
+ TQRegExp exp(TQString("(.*\\D)?(\\d+)(\\D.*)?"));
if(no.isEmpty() || exp.search(no) == -1)
return false;
MyMoneyTransactionFilter filter;
filter.addAccount(accId);
- QValueList<MyMoneyTransaction> transactions = transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
while ( it_t != transactions.end() ) {
try {
MyMoneySplit split;
@@ -2202,14 +2202,14 @@ bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const
return false;
}
-QString MyMoneyFile::highestCheckNo(const QString& accId) const
+TQString MyMoneyFile::highestCheckNo(const TQString& accId) const
{
unsigned64 lno = 0, cno;
- QString no;
+ TQString no;
MyMoneyTransactionFilter filter;
filter.addAccount(accId);
- QValueList<MyMoneyTransaction> transactions = transactionList(filter);
- QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
+ TQValueList<MyMoneyTransaction> transactions = transactionList(filter);
+ TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin();
while ( it_t != transactions.end() ) {
try {
// Test whether the transaction also includes a split into
@@ -2243,7 +2243,7 @@ void MyMoneyFile::preloadCache(void)
checkStorage();
d->m_cache.clear();
- QValueList<MyMoneyAccount> a_list;
+ TQValueList<MyMoneyAccount> a_list;
m_storage->accountList(a_list);
d->m_cache.preloadAccount(a_list);
d->m_cache.preloadPayee(m_storage->payeeList());
@@ -2256,7 +2256,7 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const
{
bool rc = false;
if(t.splitCount() == 2) {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) {
MyMoneyAccount acc = account((*it_s).accountId());
if(acc.isIncomeExpense())
@@ -2270,8 +2270,8 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const
bool MyMoneyFile::referencesClosedAccount(const MyMoneyTransaction& t) const
{
- QValueList<MyMoneySplit>::const_iterator it_s;
- const QValueList<MyMoneySplit>& list = t.splits();
+ TQValueList<MyMoneySplit>::const_iterator it_s;
+ const TQValueList<MyMoneySplit>& list = t.splits();
for(it_s = list.begin(); it_s != list.end(); ++it_s) {
if(referencesClosedAccount(*it_s))
break;