diff options
Diffstat (limited to 'kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp')
-rw-r--r-- | kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp | 84 |
1 files changed, 42 insertions, 42 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; } |