summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/storage
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2 (patch)
tree6a288b084438ed144c0fbd4a34a9a22caf4d6b04 /kmymoney2/mymoney/storage
parent154e6e6105157c321cbd578d238c525da419f868 (diff)
downloadkmymoney-7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2.tar.gz
kmymoney-7e51b6d5ddc01fc3bc69f30bc5d3933a7709dbf2.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney/storage')
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp84
-rw-r--r--kmymoney2/mymoney/storage/mymoneymap.h10
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp108
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h2
-rw-r--r--kmymoney2/mymoney/storage/mymoneystorageanon.cpp6
-rw-r--r--kmymoney2/mymoney/storage/mymoneystoragesql.cpp84
6 files changed, 147 insertions, 147 deletions
diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
index d34bb83..8bafce8 100644
--- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
@@ -115,14 +115,14 @@ void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& ac
startTransaction();
accountList = m_sql->fetchAccounts(accountIdList, true);
- theParent = accountList.tqfind(tqparent.id());
+ theParent = accountList.find(tqparent.id());
if(theParent == accountList.end()) {
TQString msg = "Unknown tqparent account '";
msg += tqparent.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
- theChild = accountList.tqfind(account.id());
+ theChild = accountList.find(account.id());
if(theChild == accountList.end()) {
TQString msg = "Unknown child account '";
msg += account.id() + "'";
@@ -160,7 +160,7 @@ const MyMoneyPayee MyMoneyDatabaseMgr::payee(const TQString& id) const
{
TQMap<TQString, MyMoneyPayee>::ConstIterator it;
TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(id));
- it = payeeList.tqfind(id);
+ it = payeeList.find(id);
if(it == payeeList.end())
throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'");
@@ -194,7 +194,7 @@ void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee)
TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()), true);
TQMap<TQString, MyMoneyPayee>::ConstIterator it;
- it = payeeList.tqfind(payee.id());
+ it = payeeList.find(payee.id());
if(it == payeeList.end()) {
TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -210,7 +210,7 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee)
TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()));
TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
- it_p = payeeList.tqfind(payee.id());
+ it_p = payeeList.find(payee.id());
if(it_p == payeeList.end()) {
TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -250,7 +250,7 @@ const MyMoneyAccount MyMoneyDatabaseMgr::account(const TQString& id) const
if (m_sql)
{
TQMap <TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(TQString(id));
- TQMap <TQString, MyMoneyAccount>::ConstIterator pos = accountList.tqfind(id);
+ TQMap <TQString, MyMoneyAccount>::ConstIterator pos = accountList.find(id);
// locate the account and if present, return it's data
if(pos != accountList.end())
@@ -479,7 +479,7 @@ const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const TQString& id) con
TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(id));
- pos = institutionList.tqfind(id);
+ pos = institutionList.find(id);
if(pos != institutionList.end())
return *pos;
throw new MYMONEYEXCEPTION("unknown institution");
@@ -512,7 +512,7 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool
// locate the account in the file global pool
startTransaction();
TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts (TQString(account.id()), true);
- pos = accountList.tqfind(account.id());
+ pos = accountList.find(account.id());
if(pos != accountList.end()) {
// check if the new info is based on the old one.
// this is the case, when the file and the id
@@ -555,7 +555,7 @@ void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution
TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
// locate the institution in the file global pool
- pos = institutionList.tqfind(institution.id());
+ pos = institutionList.find(institution.id());
if(pos != institutionList.end()) {
m_sql->modifyInstitution(institution);
} else
@@ -599,7 +599,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
// new data seems to be ok. find old version of transaction
// in our pool. Throw exception if unknown.
-// if(!m_transactionKeys.tqcontains(transaction.id()))
+// if(!m_transactionKeys.contains(transaction.id()))
// throw new MYMONEYEXCEPTION("invalid transaction id");
// TQString oldKey = m_transactionKeys[transaction.id()];
@@ -609,7 +609,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
-// it_t = transactionList.tqfind(oldKey);
+// it_t = transactionList.find(oldKey);
it_t = transactionList.begin();
if(it_t == transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -673,11 +673,11 @@ void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount
if(!account.parentAccountId().isEmpty()) {
MyMoneyDatabaseMgr::account(account.parentAccountId());
- oldParent = accountList.tqfind(account.parentAccountId());
+ oldParent = accountList.find(account.parentAccountId());
}
- newParent = accountList.tqfind(tqparent.id());
- childAccount = accountList.tqfind(account.id());
+ newParent = accountList.find(tqparent.id());
+ childAccount = accountList.find(account.id());
MyMoneyAccount acc;
if(!account.parentAccountId().isEmpty()) {
@@ -708,12 +708,12 @@ void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction
TQMap<TQString, TQString>::ConstIterator it_k;
TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
-// it_k = m_transactionKeys.tqfind(transaction.id());
+// it_k = m_transactionKeys.find(transaction.id());
// if(it_k == m_transactionKeys.end())
// throw new MYMONEYEXCEPTION("invalid transaction to be deleted");
TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')");
-// it_t = transactionList.tqfind(*it_k);
+// it_t = transactionList.find(*it_k);
it_t = transactionList.begin();
if(it_t == transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -823,11 +823,11 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account)
// locate the account in the file global pool
- it_a = accountList.tqfind(account.id());
+ it_a = accountList.find(account.id());
if(it_a == accountList.end())
throw new MYMONEYEXCEPTION("Internal error: account not found in list");
- it_p = accountList.tqfind(tqparent.id());
+ it_p = accountList.find(tqparent.id());
if(it_p == accountList.end())
throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list");
@@ -872,7 +872,7 @@ void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution
TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(institution.id()));
TQMap<TQString, MyMoneyInstitution>::ConstIterator it_i;
- it_i = institutionList.tqfind(institution.id());
+ it_i = institutionList.find(institution.id());
if(it_i != institutionList.end()) {
// mark file as changed
m_sql->removeInstitution(institution);
@@ -884,7 +884,7 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& id) con
{
// get the full key of this transaction, throw exception
// if it's invalid (unknown)
- //if(!m_transactionKeys.tqcontains(id))
+ //if(!m_transactionKeys.contains(id))
// throw new MYMONEYEXCEPTION("invalid transaction id");
// check if this key is in the list, throw exception if not
@@ -893,7 +893,7 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& id) con
//there should only be one transaction in the map, if it was found, so check the size of the map
//return the first element.
- //if(!transactionList.tqcontains(key))
+ //if(!transactionList.contains(key))
if(!transactionList.size())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -919,10 +919,10 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate&
MyMoneyMoney result(0);
MyMoneyAccount acc;
TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*TQString(id)*/);
- //TQMap<TQString, MyMoneyAccount>::const_iterator accpos = accountList.tqfind(id);
+ //TQMap<TQString, MyMoneyAccount>::const_iterator accpos = accountList.find(id);
if (date_ != TQDate()) qDebug ("request balance for %s at %s", id.data(), TQString(date_.toString(Qt::ISODate)).latin1());
// if(!date_.isValid() && MyMoneyFile::instance()->account(id).accountType() != MyMoneyAccount::Stock) {
-// if(accountList.tqfind(id) != accountList.end())
+// if(accountList.find(id) != accountList.end())
// return accountList[id].balance();
// return MyMoneyMoney(0);
// }
@@ -991,7 +991,7 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& account
TQMap<TQString, MyMoneyAccount>::ConstIterator acc;
// find account object in list, throw exception if unknown
- acc = m_accountList.tqfind(account);
+ acc = m_accountList.find(account);
if(acc == m_accountList.end())
throw new MYMONEYEXCEPTION("unknown account id");
@@ -1068,7 +1068,7 @@ void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security)
TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(security.id()), true);
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = securitiesList.tqfind(security.id());
+ it = securitiesList.find(security.id());
if(it == securitiesList.end())
{
TQString msg = "Unknown security '";
@@ -1086,7 +1086,7 @@ void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security)
// FIXME: check referential integrity
- it = securitiesList.tqfind(security.id());
+ it = securitiesList.find(security.id());
if(it == securitiesList.end())
{
TQString msg = "Unknown security '";
@@ -1100,7 +1100,7 @@ void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security)
const MyMoneySecurity MyMoneyDatabaseMgr::security(const TQString& id) const
{
TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(id));
- TQMap<TQString, MyMoneySecurity>::ConstIterator it = securitiesList.tqfind(id);
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it = securitiesList.find(id);
if(it != securitiesList.end())
{
return it.data();
@@ -1116,8 +1116,8 @@ void MyMoneyDatabaseMgr::addPrice(const MyMoneyPrice& price)
{
MyMoneyPriceEntries::ConstIterator it;
MyMoneyPriceList priceList = m_sql->fetchPrices();
- it = priceList[MyMoneySecurityPair(price.from(), price.to())].tqfind(price.date());
- // do not tqreplace, if the information did not change.
+ it = priceList[MyMoneySecurityPair(price.from(), price.to())].find(price.date());
+ // do not replace, if the information did not change.
if(it != priceList[MyMoneySecurityPair(price.from(), price.to())].end()) {
if((*it).rate((*it).to()) == price.rate(price.to())
&& (*it).source() == price.source())
@@ -1163,7 +1163,7 @@ void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched)
TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = scheduleList.tqfind(sched.id());
+ it = scheduleList.find(sched.id());
if(it == scheduleList.end()) {
TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1177,7 +1177,7 @@ void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched)
TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = scheduleList.tqfind(sched.id());
+ it = scheduleList.find(sched.id());
if(it == scheduleList.end()) {
TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1194,7 +1194,7 @@ const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const TQString& id) const
TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
// locate the schedule and if present, return it's data
- pos = scheduleList.tqfind(id);
+ pos = scheduleList.find(id);
if(pos != scheduleList.end())
return (*pos);
@@ -1325,7 +1325,7 @@ const TQValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int sched
if (accounts.count() > 0)
{
- if (accounts.tqcontains((*pos).account().id()))
+ if (accounts.contains((*pos).account().id()))
continue;
}
@@ -1342,7 +1342,7 @@ void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency)
TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.tqfind(currency.id());
+ it = currencyList.find(currency.id());
if(it != currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id()));
}
@@ -1356,7 +1356,7 @@ void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency)
TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.tqfind(currency.id());
+ it = currencyList.find(currency.id());
if(it == currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id()));
}
@@ -1371,7 +1371,7 @@ void MyMoneyDatabaseMgr::removeCurrency(const MyMoneySecurity& currency)
// FIXME: check referential integrity
- it = currencyList.tqfind(currency.id());
+ it = currencyList.find(currency.id());
if(it == currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id()));
}
@@ -1387,7 +1387,7 @@ const MyMoneySecurity MyMoneyDatabaseMgr::currency(const TQString& id) const
TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(id));
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.tqfind(id);
+ it = currencyList.find(id);
if(it == currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id));
}
@@ -1429,7 +1429,7 @@ void MyMoneyDatabaseMgr::modifyReport( const MyMoneyReport& report )
TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = reportList.tqfind(report.id());
+ it = reportList.find(report.id());
if(it == reportList.end()) {
TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1453,7 +1453,7 @@ void MyMoneyDatabaseMgr::removeReport(const MyMoneyReport& report)
TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = reportList.tqfind(report.id());
+ it = reportList.find(report.id());
if(it == reportList.end()) {
TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1491,7 +1491,7 @@ void MyMoneyDatabaseMgr::modifyBudget( const MyMoneyBudget& budget )
{
//TQMap<TQString, MyMoneyBudget>::ConstIterator it;
- //it = m_budgetList.tqfind(budget.id());
+ //it = m_budgetList.find(budget.id());
//if(it == m_budgetList.end()) {
// TQString msg = "Unknown budget '" + budget.id() + "'";
// throw new MYMONEYEXCEPTION(msg);
@@ -1521,7 +1521,7 @@ void MyMoneyDatabaseMgr::removeBudget(const MyMoneyBudget& budget)
{
// TQMap<TQString, MyMoneyBudget>::ConstIterator it;
//
-// it = m_budgetList.tqfind(budget.id());
+// it = m_budgetList.find(budget.id());
// if(it == m_budgetList.end()) {
// TQString msg = "Unknown budget '" + budget.id() + "'";
// throw new MYMONEYEXCEPTION(msg);
@@ -1670,7 +1670,7 @@ void MyMoneyDatabaseMgr::setLastModificationDate(const TQDate& val)
bool MyMoneyDatabaseMgr::isDuplicateTransaction(const TQString& /*id*/) const
{
//FIXME: figure out the real id from the key and check the DB.
-//return m_transactionKeys.tqcontains(id);
+//return m_transactionKeys.contains(id);
return false;
}
diff --git a/kmymoney2/mymoney/storage/mymoneymap.h b/kmymoney2/mymoney/storage/mymoneymap.h
index 7582112..c914416 100644
--- a/kmymoney2/mymoney/storage/mymoneymap.h
+++ b/kmymoney2/mymoney/storage/mymoneymap.h
@@ -123,9 +123,9 @@ public:
const T& operator[] ( const Key& k ) const
{ TQT_CHECK_INVALID_MAP_ELEMENT; return TQMap<Key,T>::operator[](k); }
- inline TQ_TYPENAME TQMap<Key, T>::const_iterator tqfind(const Key& k) const
+ inline TQ_TYPENAME TQMap<Key, T>::const_iterator find(const Key& k) const
{
- return TQMap<Key,T>::tqfind(k);
+ return TQMap<Key,T>::find(k);
}
inline TQ_TYPENAME TQMap<Key, T>::const_iterator begin(void) const
@@ -138,9 +138,9 @@ public:
return TQMap<Key,T>::end();
}
- inline bool tqcontains(const Key& k) const
+ inline bool contains(const Key& k) const
{
- return tqfind(k) != end();
+ return find(k) != end();
}
inline void map(TQMap<Key, T>& that) const
@@ -307,7 +307,7 @@ main()
printf("b.name() = %s\n", b.name().data());
TQMap<TQString, MyMoneyAccount>::ConstIterator it;
- it = container.tqfind("001");
+ it = container.find("001");
it = container.begin();
} catch(MyMoneyException *e) {
diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
index 9977811..efc88b7 100644
--- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
@@ -137,7 +137,7 @@ void MyMoneySeqAccessMgr::setAccountName(const TQString& id, const TQString& nam
const MyMoneyAccount MyMoneySeqAccessMgr::account(const TQString& id) const
{
// locate the account and if present, return it's data
- if(m_accountList.tqfind(id) != m_accountList.end())
+ if(m_accountList.find(id) != m_accountList.end())
return m_accountList[id];
// throw an exception, if it does not exist
@@ -175,7 +175,7 @@ void MyMoneySeqAccessMgr::addPayee(MyMoneyPayee& payee)
const MyMoneyPayee MyMoneySeqAccessMgr::payee(const TQString& id) const
{
TQMap<TQString, MyMoneyPayee>::ConstIterator it;
- it = m_payeeList.tqfind(id);
+ it = m_payeeList.find(id);
if(it == m_payeeList.end())
throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'");
@@ -202,7 +202,7 @@ void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee)
{
TQMap<TQString, MyMoneyPayee>::ConstIterator it;
- it = m_payeeList.tqfind(payee.id());
+ it = m_payeeList.find(payee.id());
if(it == m_payeeList.end()) {
TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -216,7 +216,7 @@ void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee)
TQMap<TQString, MyMoneySchedule>::ConstIterator it_s;
TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
- it_p = m_payeeList.tqfind(payee.id());
+ it_p = m_payeeList.find(payee.id());
if(it_p == m_payeeList.end()) {
TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -253,14 +253,14 @@ void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& a
TQMap<TQString, MyMoneyAccount>::ConstIterator theParent;
TQMap<TQString, MyMoneyAccount>::ConstIterator theChild;
- theParent = m_accountList.tqfind(tqparent.id());
+ theParent = m_accountList.find(tqparent.id());
if(theParent == m_accountList.end()) {
TQString msg = "Unknown tqparent account '";
msg += tqparent.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
- theChild = m_accountList.tqfind(account.id());
+ theChild = m_accountList.find(account.id());
if(theChild == m_accountList.end()) {
TQString msg = "Unknown child account '";
msg += account.id() + "'";
@@ -467,7 +467,7 @@ const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const TQString& id) co
{
TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
- pos = m_institutionList.tqfind(id);
+ pos = m_institutionList.find(id);
if(pos != m_institutionList.end())
return *pos;
throw new MYMONEYEXCEPTION("unknown institution");
@@ -483,7 +483,7 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo
TQMap<TQString, MyMoneyAccount>::ConstIterator pos;
// locate the account in the file global pool
- pos = m_accountList.tqfind(account.id());
+ pos = m_accountList.find(account.id());
if(pos != m_accountList.end()) {
// check if the new info is based on the old one.
// this is the case, when the file and the id
@@ -518,7 +518,7 @@ void MyMoneySeqAccessMgr::modifyInstitution(const MyMoneyInstitution& institutio
TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
// locate the institution in the file global pool
- pos = m_institutionList.tqfind(institution.id());
+ pos = m_institutionList.find(institution.id());
if(pos != m_institutionList.end()) {
m_institutionList.modify(institution.id(), institution);
@@ -553,16 +553,16 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio
// new data seems to be ok. find old version of transaction
// in our pool. Throw exception if unknown.
- if(!m_transactionKeys.tqcontains(transaction.id()))
+ if(!m_transactionKeys.contains(transaction.id()))
throw new MYMONEYEXCEPTION("invalid transaction id");
TQString oldKey = m_transactionKeys[transaction.id()];
- if(!m_transactionList.tqcontains(oldKey))
+ if(!m_transactionList.contains(oldKey))
throw new MYMONEYEXCEPTION("invalid transaction key");
TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
- it_t = m_transactionList.tqfind(oldKey);
+ it_t = m_transactionList.find(oldKey);
if(it_t == m_transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -608,14 +608,14 @@ void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccoun
MyMoneySeqAccessMgr::account(tqparent.id());
if(!account.parentAccountId().isEmpty()) {
MyMoneySeqAccessMgr::account(account.parentAccountId());
- oldParent = m_accountList.tqfind(account.parentAccountId());
+ oldParent = m_accountList.find(account.parentAccountId());
}
if(account.accountType() == MyMoneyAccount::Stock && tqparent.accountType() != MyMoneyAccount::Investment)
throw new MYMONEYEXCEPTION("Cannot move a stock acocunt into a non-investment account");
- newParent = m_accountList.tqfind(tqparent.id());
- childAccount = m_accountList.tqfind(account.id());
+ newParent = m_accountList.find(tqparent.id());
+ childAccount = m_accountList.find(account.id());
MyMoneyAccount acc;
if(!account.parentAccountId().isEmpty()) {
@@ -648,11 +648,11 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio
TQMap<TQString, TQString>::ConstIterator it_k;
TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
- it_k = m_transactionKeys.tqfind(transaction.id());
+ it_k = m_transactionKeys.find(transaction.id());
if(it_k == m_transactionKeys.end())
throw new MYMONEYEXCEPTION("invalid transaction to be deleted");
- it_t = m_transactionList.tqfind(*it_k);
+ it_t = m_transactionList.find(*it_k);
if(it_t == m_transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -708,11 +708,11 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account)
// locate the account in the file global pool
- it_a = m_accountList.tqfind(account.id());
+ it_a = m_accountList.find(account.id());
if(it_a == m_accountList.end())
throw new MYMONEYEXCEPTION("Internal error: account not found in list");
- it_p = m_accountList.tqfind(tqparent.id());
+ it_p = m_accountList.find(tqparent.id());
if(it_p == m_accountList.end())
throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list");
@@ -756,7 +756,7 @@ void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institutio
{
TQMap<TQString, MyMoneyInstitution>::ConstIterator it_i;
- it_i = m_institutionList.tqfind(institution.id());
+ it_i = m_institutionList.find(institution.id());
if(it_i != m_institutionList.end()) {
m_institutionList.remove(institution.id());
@@ -816,14 +816,14 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& id) co
{
// get the full key of this transaction, throw exception
// if it's invalid (unknown)
- if(!m_transactionKeys.tqcontains(id)) {
+ if(!m_transactionKeys.contains(id)) {
TQString msg = TQString("Invalid transaction id '%1'").tqarg(id);
throw new MYMONEYEXCEPTION(msg);
}
// check if this key is in the list, throw exception if not
TQString key = m_transactionKeys[id];
- if(!m_transactionList.tqcontains(key)) {
+ if(!m_transactionList.contains(key)) {
TQString msg = TQString("Invalid transaction key '%1'").tqarg(key);
throw new MYMONEYEXCEPTION(msg);
}
@@ -837,7 +837,7 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& accoun
TQMap<TQString, MyMoneyAccount>::ConstIterator acc;
// find account object in list, throw exception if unknown
- acc = m_accountList.tqfind(account);
+ acc = m_accountList.find(account);
if(acc == m_accountList.end())
throw new MYMONEYEXCEPTION("unknown account id");
@@ -872,7 +872,7 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const TQString& id, const TQDate
MyMoneyAccount acc;
// if (date != TQDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1());
if(!date.isValid() && account(id).accountType() != MyMoneyAccount::Stock) {
- if(m_accountList.tqfind(id) != m_accountList.end())
+ if(m_accountList.find(id) != m_accountList.end())
return m_accountList[id].balance();
return MyMoneyMoney(0);
}
@@ -975,12 +975,12 @@ const unsigned int MyMoneyFile::moveSplits(const TQString& oldAccount, const TQS
if(cnt != 0) {
// now update all the accounts that were referenced
TQMap<TQString, MyMoneyAccount>::Iterator acc;
- acc = m_accountList.tqfind(oldAccount);
+ acc = m_accountList.find(oldAccount);
if(acc != m_accountList.end()) {
(*acc).touch();
refreshAccountTransactionList(acc);
}
- acc = m_accountList.tqfind(newAccount);
+ acc = m_accountList.find(newAccount);
if(acc != m_accountList.end()) {
(*acc).touch();
refreshAccountTransactionList(acc);
@@ -1019,7 +1019,7 @@ void MyMoneySeqAccessMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& ma
lastId = (*it_a).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextAccountID = atol(lastId.mid(pos));
}
@@ -1042,7 +1042,7 @@ void MyMoneySeqAccessMgr::loadTransactions(const TQMap<TQString, MyMoneyTransact
m_transactionKeys = keys;
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextTransactionID = atol(lastId.mid(pos));
}
@@ -1060,7 +1060,7 @@ void MyMoneySeqAccessMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitut
lastId = (*it_i).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextInstitutionID = atol(lastId.mid(pos));
}
@@ -1081,7 +1081,7 @@ void MyMoneySeqAccessMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& map)
}
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextPayeeID = atol(lastId.mid(pos));
}
@@ -1099,7 +1099,7 @@ void MyMoneySeqAccessMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>&
lastId = (*it_s).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextSecurityID = atol(lastId.mid(pos));
}
@@ -1196,7 +1196,7 @@ void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched)
{
TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = m_scheduleList.tqfind(sched.id());
+ it = m_scheduleList.find(sched.id());
if(it == m_scheduleList.end()) {
TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1209,7 +1209,7 @@ void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched)
{
TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = m_scheduleList.tqfind(sched.id());
+ it = m_scheduleList.find(sched.id());
if(it == m_scheduleList.end()) {
TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1224,7 +1224,7 @@ const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const TQString& id) const
TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
// locate the schedule and if present, return it's data
- pos = m_scheduleList.tqfind(id);
+ pos = m_scheduleList.find(id);
if(pos != m_scheduleList.end())
return (*pos);
@@ -1323,7 +1323,7 @@ void MyMoneySeqAccessMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>&
lastId = (*it_s).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextScheduleID = atol(lastId.mid(pos));
}
@@ -1370,7 +1370,7 @@ const TQValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int sched
if (accounts.count() > 0)
{
- if (accounts.tqcontains((*pos).account().id()))
+ if (accounts.contains((*pos).account().id()))
continue;
}
@@ -1395,7 +1395,7 @@ void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security)
{
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_securitiesList.tqfind(security.id());
+ it = m_securitiesList.find(security.id());
if(it == m_securitiesList.end())
{
TQString msg = "Unknown security '";
@@ -1412,7 +1412,7 @@ void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security)
// FIXME: check referential integrity
- it = m_securitiesList.tqfind(security.id());
+ it = m_securitiesList.find(security.id());
if(it == m_securitiesList.end())
{
TQString msg = "Unknown security '";
@@ -1425,7 +1425,7 @@ void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security)
const MyMoneySecurity MyMoneySeqAccessMgr::security(const TQString& id) const
{
- TQMap<TQString, MyMoneySecurity>::ConstIterator it = m_securitiesList.tqfind(id);
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it = m_securitiesList.find(id);
if(it != m_securitiesList.end())
{
return it.data();
@@ -1444,7 +1444,7 @@ void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency)
{
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.tqfind(currency.id());
+ it = m_currencyList.find(currency.id());
if(it != m_currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id()));
}
@@ -1456,7 +1456,7 @@ void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency)
{
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.tqfind(currency.id());
+ it = m_currencyList.find(currency.id());
if(it == m_currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id()));
}
@@ -1470,7 +1470,7 @@ void MyMoneySeqAccessMgr::removeCurrency(const MyMoneySecurity& currency)
// FIXME: check referential integrity
- it = m_currencyList.tqfind(currency.id());
+ it = m_currencyList.find(currency.id());
if(it == m_currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id()));
}
@@ -1485,7 +1485,7 @@ const MyMoneySecurity MyMoneySeqAccessMgr::currency(const TQString& id) const
}
TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.tqfind(id);
+ it = m_currencyList.find(id);
if(it == m_currencyList.end()) {
throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id));
}
@@ -1525,7 +1525,7 @@ void MyMoneySeqAccessMgr::loadReports(const TQMap<TQString, MyMoneyReport>& map)
lastId = (*it_r).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextReportID = atol(lastId.mid(pos));
}
@@ -1535,7 +1535,7 @@ void MyMoneySeqAccessMgr::modifyReport( const MyMoneyReport& report )
{
TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = m_reportList.tqfind(report.id());
+ it = m_reportList.find(report.id());
if(it == m_reportList.end()) {
TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1565,7 +1565,7 @@ void MyMoneySeqAccessMgr::removeReport( const MyMoneyReport& report )
{
TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = m_reportList.tqfind(report.id());
+ it = m_reportList.find(report.id());
if(it == m_reportList.end()) {
TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1599,7 +1599,7 @@ void MyMoneySeqAccessMgr::loadBudgets(const TQMap<TQString, MyMoneyBudget>& map)
lastId = (*it_b).id();
}
- int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
+ int pos = lastId.find(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextBudgetID = atol(lastId.mid(pos));
}
@@ -1622,7 +1622,7 @@ void MyMoneySeqAccessMgr::modifyBudget( const MyMoneyBudget& budget )
{
TQMap<TQString, MyMoneyBudget>::ConstIterator it;
- it = m_budgetList.tqfind(budget.id());
+ it = m_budgetList.find(budget.id());
if(it == m_budgetList.end()) {
TQString msg = "Unknown budget '" + budget.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1652,7 +1652,7 @@ void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget )
{
TQMap<TQString, MyMoneyBudget>::ConstIterator it;
- it = m_budgetList.tqfind(budget.id());
+ it = m_budgetList.find(budget.id());
if(it == m_budgetList.end()) {
TQString msg = "Unknown budget '" + budget.id() + "'";
throw new MYMONEYEXCEPTION(msg);
@@ -1665,7 +1665,7 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price)
{
MyMoneySecurityPair pricePair(price.from(), price.to());
TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.tqfind(pricePair);
+ it_m = m_priceList.find(pricePair);
MyMoneyPriceEntries entries;
if(it_m != m_priceList.end()) {
@@ -1677,7 +1677,7 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price)
// an existing one.
MyMoneyPriceEntries::ConstIterator it;
- it = entries.tqfind(price.date());
+ it = entries.find(price.date());
if(it != entries.end()) {
if((*it).rate(TQString()) == price.rate(TQString())
&& (*it).source() == price.source())
@@ -1699,7 +1699,7 @@ void MyMoneySeqAccessMgr::removePrice(const MyMoneyPrice& price)
{
MyMoneySecurityPair pricePair(price.from(), price.to());
TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.tqfind(pricePair);
+ it_m = m_priceList.find(pricePair);
MyMoneyPriceEntries entries;
if(it_m != m_priceList.end()) {
@@ -1736,7 +1736,7 @@ const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQSt
// If the caller selected an exact entry, we can search for
// it using the date as the key
if(exactDate) {
- it = m_priceList[MyMoneySecurityPair(fromId, toId)].tqfind(date);
+ it = m_priceList[MyMoneySecurityPair(fromId, toId)].find(date);
if(it != m_priceList[MyMoneySecurityPair(fromId, toId)].end())
rc = *it;
@@ -1778,7 +1778,7 @@ void MyMoneySeqAccessMgr::rebuildAccountBalances(void)
if(!(*it_s).shares().isZero()) {
const TQString& id = (*it_s).accountId();
// locate the account and if present, update data
- if(map.tqfind(id) != map.end()) {
+ if(map.find(id) != map.end()) {
map[id].adjustBalance(*it_s);
}
}
diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h
index abca654..f570d92 100644
--- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h
+++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h
@@ -465,7 +465,7 @@ public:
* This method returns whether a given transaction is already in memory, to avoid
* reloading it from the database
*/
- bool isDuplicateTransaction(const TQString& id) const { return m_transactionKeys.tqcontains(id); }
+ bool isDuplicateTransaction(const TQString& id) const { return m_transactionKeys.contains(id); }
/**
* This method returns the number of transactions currently known to file
diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp
index bb0ab60..db35647 100644
--- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp
+++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp
@@ -120,7 +120,7 @@ void MyMoneyStorageANON::writePayee(TQDomElement& payee, const MyMoneyPayee& _p)
TQStringList keys;
MyMoneyPayee::payeeMatchType matchType = p.matchData(ignoreCase, keys);
TQRegExp exp("[A-Za-z]");
- p.setMatchData(matchType, ignoreCase, TQStringList::split(";", keys.join(";").tqreplace(exp, "x")));
+ p.setMatchData(matchType, ignoreCase, TQStringList::split(";", keys.join(";").replace(exp, "x")));
MyMoneyStorageXML::writePayee(payee, p);
}
@@ -180,9 +180,9 @@ void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp)
for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it)
{
- if ( zKvpXNumber.tqcontains( it.key() ) || it.key().left(3)=="ir-" )
+ if ( zKvpXNumber.contains( it.key() ) || it.key().left(3)=="ir-" )
pairs[it.key()] = hideNumber(MyMoneyMoney(it.data())).toString();
- else if ( zKvpNoModify.tqcontains( it.key() ) )
+ else if ( zKvpNoModify.contains( it.key() ) )
pairs[it.key()] = it.data();
else
pairs[it.key()] = hideString(it.data());
diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
index f479c5c..4995d02 100644
--- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
+++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp
@@ -71,7 +71,7 @@ bool MyMoneySqlQuery::exec () {
bool MyMoneySqlQuery::prepare ( const TQString & query ) {
if (m_db->isSqlite3()) {
TQString newQuery = query;
- return (TQSqlQuery::prepare (newQuery.tqreplace("FOR UPDATE", "")));
+ return (TQSqlQuery::prepare (newQuery.replace("FOR UPDATE", "")));
}
return (TQSqlQuery::prepare (query));
}
@@ -136,8 +136,8 @@ try {
m_dbType = m_drivers.driverToType(driverName);
//get the input options
TQStringList options = TQStringList::split(',', url.queryItem("options"));
- m_loadAll = options.tqcontains("loadAll")/*|| m_mode == 0*/;
- m_override = options.tqcontains("override");
+ m_loadAll = options.contains("loadAll")/*|| m_mode == 0*/;
+ m_override = options.contains("override");
// create the database connection
TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash
@@ -279,7 +279,7 @@ int MyMoneyStorageSql::upgradeDb() {
// prior to dbv6, 'version' format was 'dbversion.fixLevel+1'
// as of dbv6, these are separate fields
TQString version = q.value(0).toString();
- if (version.tqcontains('.')) {
+ if (version.contains('.')) {
m_dbVersion = q.value(0).toString().section('.', 0, 0).toUInt();
m_storage->setFileFixVersion(q.value(0).toString().section('.', 1, 1).toUInt() - 1);
} else {
@@ -358,7 +358,7 @@ bool MyMoneyStorageSql::addColumn
const TQString& after){
if ((m_dbType == Sqlite3) && (!after.isEmpty()))
qFatal("sqlite doesn't support 'AFTER'; use sqliteAlterTable");
- if (record(t.name()).tqcontains(c.name()))
+ if (record(t.name()).contains(c.name()))
return (true);
TQSqlQuery q(this);
TQString afterString = ";";
@@ -385,7 +385,7 @@ bool MyMoneyStorageSql::dropColumn
(const MyMoneyDbTable& t, const TQString& col){
if (m_dbType == Sqlite3)
qFatal("sqlite doesn't support 'DROP COLUMN'; use sqliteAlterTable");
- if (!record(t.name()).tqcontains(col))
+ if (!record(t.name()).contains(col))
return (true);
TQSqlQuery q(this);
q.prepare("ALTER TABLE " + t.name() + " DROP COLUMN "
@@ -712,7 +712,7 @@ int MyMoneyStorageSql::upgradeToV6() {
bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) {
DBG("*** Entering MyMoneyStorageSql::sqliteAlterTable");
TQString tempTableName = t.name();
- tempTableName.tqreplace("kmm", "tmp");
+ tempTableName.replace("kmm", "tmp");
TQSqlQuery q(this);
q.prepare (TQString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";"));
if (!q.exec()) {
@@ -756,12 +756,12 @@ int MyMoneyStorageSql::createTables () {
}
for (TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) {
- if (!lowerTables.tqcontains(tt.key().lower())) createTable (tt.data());
+ if (!lowerTables.contains(tt.key().lower())) createTable (tt.data());
}
MyMoneySqlQuery q(this);
for (TQMapConstIterator<TQString, MyMoneyDbView> tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) {
- if (!lowerTables.tqcontains(tt.key().lower())) {
+ if (!lowerTables.contains(tt.key().lower())) {
q.prepare (tt.data().createString());
if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").tqarg(tt.key())));
}
@@ -972,7 +972,7 @@ void MyMoneyStorageSql::writeInstitutions() {
q2.prepare (m_db.m_tables["kmmInstitutions"].insertString());
signalProgress(0, list.count(), "Writing Institutions...");
for(it = list.begin(); it != list.end(); ++it) {
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeInstitution(*it, q);
} else {
@@ -1062,7 +1062,7 @@ void MyMoneyStorageSql::writePayees() {
q2.prepare (m_db.m_tables["kmmPayees"].insertString());
TQValueList<MyMoneyPayee>::ConstIterator it;
for(it = list.begin(); it != list.end(); ++it) {
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writePayee(*it, q);
} else {
@@ -1224,7 +1224,7 @@ void MyMoneyStorageSql::writeAccounts() {
// Update the accounts that exist; insert the ones that do not.
for(it = list.begin(); it != list.end(); ++it, ++i) {
m_transactionCountMap[(*it).id()] = m_storagePtr->transactionCount((*it).id());
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeAccount(*it, q);
} else {
@@ -1365,7 +1365,7 @@ void MyMoneyStorageSql::writeTransactions() {
q.prepare (m_db.m_tables["kmmTransactions"].updateString());
q2.prepare (m_db.m_tables["kmmTransactions"].insertString());
for(it = list.begin(); it != list.end(); ++it, ++i) {
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeTransaction((*it).id(), *it, q, "N");
} else {
@@ -1506,7 +1506,7 @@ void MyMoneyStorageSql::writeSplits(const TQString& txId, const TQString& type,
q.prepare (m_db.m_tables["kmmSplits"].updateString());
q2.prepare (m_db.m_tables["kmmSplits"].insertString());
for(it = splitList.begin(), i = 0; it != splitList.end(); ++it, ++i) {
- if (dbList.tqcontains(i)) {
+ if (dbList.contains(i)) {
dbList.remove (i);
writeSplit(txId, (*it), type, i, q);
} else {
@@ -1543,20 +1543,20 @@ void MyMoneyStorageSql::writeSplit(const TQString& txId, const MyMoneySplit& spl
q.bindValue(":value", split.value().toString());
q.bindValue(":valueFormatted", split.value()
.formatMoney("", -1, false)
- .tqreplace(TQChar(','), TQChar('.')));
+ .replace(TQChar(','), TQChar('.')));
q.bindValue(":shares", split.shares().toString());
MyMoneyAccount acc = m_storagePtr->account(split.accountId());
MyMoneySecurity sec = m_storagePtr->security(acc.currencyId());
q.bindValue(":sharesFormatted",
split.shares().
formatMoney("", MyMoneyMoney::denomToPrec(sec.smallestAccountFraction()), false).
- tqreplace(TQChar(','), TQChar('.')));
+ replace(TQChar(','), TQChar('.')));
MyMoneyMoney price = split.actualPrice();
if (!price.isZero()) {
q.bindValue(":price", price.toString());
q.bindValue(":priceFormatted", price.formatMoney
("", KMyMoneySettings::pricePrecision(), false)
- .tqreplace(TQChar(','), TQChar('.')));
+ .replace(TQChar(','), TQChar('.')));
} else {
q.bindValue(":price", TQString());
q.bindValue(":priceFormatted", TQString());
@@ -1591,7 +1591,7 @@ void MyMoneyStorageSql::writeSchedules() {
q.prepare (m_db.m_tables["kmmSchedules"].updateString());
q2.prepare (m_db.m_tables["kmmSchedules"].insertString());
bool insert = true;
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
insert = false;
writeSchedule(*it, q, insert);
@@ -1730,7 +1730,7 @@ void MyMoneyStorageSql::writeSecurities() {
q.prepare (m_db.m_tables["kmmSecurities"].updateString());
q2.prepare (m_db.m_tables["kmmSecurities"].insertString());
for(TQValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) {
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeSecurity((*it), q);
} else {
@@ -1911,7 +1911,7 @@ void MyMoneyStorageSql::writeCurrencies() {
q.prepare (m_db.m_tables["kmmCurrencies"].updateString());
q2.prepare (m_db.m_tables["kmmCurrencies"].insertString());
for(TQValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) {
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeCurrency((*it), q);
} else {
@@ -2000,7 +2000,7 @@ void MyMoneyStorageSql::writeReports() {
q.prepare (m_db.m_tables["kmmReportConfig"].updateString());
q2.prepare (m_db.m_tables["kmmReportConfig"].insertString());
for(it = list.begin(); it != list.end(); ++it){
- if (dbList.tqcontains((*it).id())) {
+ if (dbList.contains((*it).id())) {
dbList.remove ((*it).id());
writeReport(*it, q);
} else {
@@ -2082,7 +2082,7 @@ void MyMoneyStorageSql::writeBudgets() {
q.prepare (m_db.m_tables["kmmBudgetConfig"].updateString());
q2.prepare (m_db.m_tables["kmmBudgetConfig"].insertString());
for(it = list.begin(); it != list.end(); ++it){
- if (dbList.tqcontains((*it).name())) {
+ if (dbList.contains((*it).name())) {
dbList.remove ((*it).name());
writeBudget(*it, q);
} else {
@@ -2570,7 +2570,7 @@ const TQMap<TQString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const TQ
TQMapIterator<TQString, MyMoneyAccount> it_acc;
TQMapIterator<TQString, MyMoneyAccount> accListEnd = accList.end();
while (sq.next()) {
- it_acc = accList.tqfind(sq.value(1).toString());
+ it_acc = accList.find(sq.value(1).toString());
if (it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) {
while (sq.isValid() && it_acc != accListEnd
&& it_acc.data().id() == sq.value(1).toString()) {
@@ -2794,7 +2794,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
// TQStringList::iterator it;
// bool allAccountsLoaded = true;
// for (it = accounts.begin(); it != accounts.end(); ++it) {
-// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) {
+// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) {
// allAccountsLoaded = false;
// break;
// }
@@ -2883,7 +2883,7 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
TQString accountsClause = "";
TQStringList::const_iterator it;
for (it = accounts.begin(); it != accounts.end(); ++it) {
-// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) {
+// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) {
accountsClause.append(TQString("%1 '%2'")
.tqarg(itemConnector).tqarg(*it));
itemConnector = ", ";
@@ -2914,8 +2914,8 @@ const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (
}
}
// I've given up trying to work out the logic. we keep getting the wrong number of close brackets
- int obc = whereClause.tqcontains('(');
- int cbc = whereClause.tqcontains(')');
+ int obc = whereClause.contains('(');
+ int cbc = whereClause.contains(')');
if (cbc > obc) {
qFatal("invalid where clause - %s", whereClause.latin1());
}
@@ -3771,7 +3771,7 @@ long unsigned MyMoneyStorageSql::calcHighId
(const long unsigned& i, const TQString& id) {
DBG("*** Entering MyMoneyStorageSql::calcHighId");
TQString nid = id;
- long unsigned high = (unsigned long) nid.tqreplace(TQRegExp("[A-Z]*"), "").toULongLong();
+ long unsigned high = (unsigned long) nid.replace(TQRegExp("[A-Z]*"), "").toULongLong();
return std::max(high, i);
}
@@ -4124,19 +4124,19 @@ const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const {
for (fit = fi.begin(); fit != fi.end(); ++fit) {
TQString toReplace = (*fit)->name();
toReplace.prepend(':');
- TQString tqreplace = "NULL";
+ TQString replace = "NULL";
if ((*fit)->name() == "version")
- tqreplace = TQString::number(m_currentVersion);
+ replace = TQString::number(m_currentVersion);
if ((*fit)->name() == "fixLevel")
- tqreplace = TQString::number
+ replace = TQString::number
(MyMoneyFile::instance()->storage()->currentFixVersion());
if ((*fit)->name() == "created")
- tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate);
+ replace = TQDate::tqcurrentDate().toString(Qt::ISODate);
if ((*fit)->name() == "lastModified")
- tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate);
+ replace = TQDate::tqcurrentDate().toString(Qt::ISODate);
if ((*fit)->name() == "updateInProgress")
- tqreplace = enclose("N");
- qs.tqreplace(toReplace, tqreplace);
+ replace = enclose("N");
+ qs.replace(toReplace, replace);
}
qs += "\n\n";
retval += qs;
@@ -4161,18 +4161,18 @@ const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const {
for (act = ac.end(), --act; act != ac.begin(); --act) {
TQString toReplace = (*act)->name();
toReplace.prepend(':');
- TQString tqreplace = "NULL";
+ TQString replace = "NULL";
if ((*act)->name() == "accountType")
- tqreplace = TQString::number(pac->accountType());
+ replace = TQString::number(pac->accountType());
if ((*act)->name() == "accountTypeString")
- tqreplace = enclose(pac->name());
+ replace = enclose(pac->name());
if ((*act)->name() == "isStockAccount")
- tqreplace = enclose("N");
+ replace = enclose("N");
if ((*act)->name() == "accountName")
- tqreplace = enclose(pac->name());
- qs.tqreplace(toReplace, tqreplace);
+ replace = enclose(pac->name());
+ qs.replace(toReplace, replace);
}
- qs.tqreplace (":id", enclose(pac->id())); // a real kludge
+ qs.replace (":id", enclose(pac->id())); // a real kludge
qs += "\n\n";
retval += qs;
}