summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp')
-rw-r--r--kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp612
1 files changed, 306 insertions, 306 deletions
diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
index 7341ec1..5c9abed 100644
--- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.cpp
@@ -44,7 +44,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr()
m_nextBudgetID = 0;
m_user = MyMoneyPayee();
m_dirty = false;
- m_creationDate = QDate::currentDate();
+ m_creationDate = TQDate::tqcurrentDate();
// setup standard accounts
MyMoneyAccount acc_l;
@@ -70,14 +70,14 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr()
MyMoneyAccount acc_q;
acc_q.setAccountType(MyMoneyAccount::Equity);
acc_q.setName("Equity");
- MyMoneyAccount equity(STD_ACC_EQUITY, acc_q);
+ MyMoneyAccount equity(STD_ACC_ETQUITY, acc_q);
- QMap<QString, MyMoneyAccount> map;
+ TQMap<TQString, MyMoneyAccount> map;
map[STD_ACC_ASSET] = asset;
map[STD_ACC_LIABILITY] = liability;
map[STD_ACC_INCOME] = income;
map[STD_ACC_EXPENSE] = expense;
- map[STD_ACC_EQUITY] = equity;
+ map[STD_ACC_ETQUITY] = equity;
// load account list with inital accounts
m_accountList = map;
@@ -89,7 +89,7 @@ MyMoneySeqAccessMgr::MyMoneySeqAccessMgr()
m_balanceCache[STD_ACC_ASSET] = balance;
m_balanceCache[STD_ACC_EXPENSE] = balance;
m_balanceCache[STD_ACC_INCOME] = balance;
- m_balanceCache[STD_ACC_EQUITY] = balance;
+ m_balanceCache[STD_ACC_ETQUITY] = balance;
// initialize for file fixes (see kmymoneyview.cpp)
m_currentFixVersion = 2;
@@ -115,16 +115,16 @@ KSharedPtr <MyMoneyStorageSql> MyMoneySeqAccessMgr::connectToDatabase
return 0;
}
-bool MyMoneySeqAccessMgr::isStandardAccount(const QString& id) const
+bool MyMoneySeqAccessMgr::isStandardAccount(const TQString& id) const
{
return id == STD_ACC_LIABILITY
|| id == STD_ACC_ASSET
|| id == STD_ACC_EXPENSE
|| id == STD_ACC_INCOME
- || id == STD_ACC_EQUITY;
+ || id == STD_ACC_ETQUITY;
}
-void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name)
+void MyMoneySeqAccessMgr::setAccountName(const TQString& id, const TQString& name)
{
if(!isStandardAccount(id))
throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()");
@@ -134,20 +134,20 @@ void MyMoneySeqAccessMgr::setAccountName(const QString& id, const QString& name)
m_accountList.modify(acc.id(), acc);
}
-const MyMoneyAccount MyMoneySeqAccessMgr::account(const QString& id) const
+const MyMoneyAccount MyMoneySeqAccessMgr::account(const TQString& id) const
{
// locate the account and if present, return it's data
- if(m_accountList.find(id) != m_accountList.end())
+ if(m_accountList.tqfind(id) != m_accountList.end())
return m_accountList[id];
// throw an exception, if it does not exist
- QString msg = "Unknown account id '" + id + "'";
+ TQString msg = "Unknown account id '" + id + "'";
throw new MYMONEYEXCEPTION(msg);
}
-void MyMoneySeqAccessMgr::accountList(QValueList<MyMoneyAccount>& list) const
+void MyMoneySeqAccessMgr::accountList(TQValueList<MyMoneyAccount>& list) const
{
- QMap<QString, MyMoneyAccount>::ConstIterator it;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it;
for(it = m_accountList.begin(); it != m_accountList.end(); ++it) {
if(!isStandardAccount((*it).id())) {
list.append(*it);
@@ -172,22 +172,22 @@ void MyMoneySeqAccessMgr::addPayee(MyMoneyPayee& payee)
payee = newPayee;
}
-const MyMoneyPayee MyMoneySeqAccessMgr::payee(const QString& id) const
+const MyMoneyPayee MyMoneySeqAccessMgr::payee(const TQString& id) const
{
- QMap<QString, MyMoneyPayee>::ConstIterator it;
- it = m_payeeList.find(id);
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it;
+ it = m_payeeList.tqfind(id);
if(it == m_payeeList.end())
throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'");
return *it;
}
-const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const
+const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const TQString& payee) const
{
if(payee.isEmpty())
return MyMoneyPayee::null;
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
for(it_p = m_payeeList.begin(); it_p != m_payeeList.end(); ++it_p) {
if((*it_p).name() == payee) {
@@ -200,11 +200,11 @@ const MyMoneyPayee MyMoneySeqAccessMgr::payeeByName(const QString& payee) const
void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee)
{
- QMap<QString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it;
- it = m_payeeList.find(payee.id());
+ it = m_payeeList.tqfind(payee.id());
if(it == m_payeeList.end()) {
- QString msg = "Unknown payee '" + payee.id() + "'";
+ TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_payeeList.modify((*it).id(), payee);
@@ -212,27 +212,27 @@ void MyMoneySeqAccessMgr::modifyPayee(const MyMoneyPayee& payee)
void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee)
{
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneySchedule>::ConstIterator it_s;
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
- it_p = m_payeeList.find(payee.id());
+ it_p = m_payeeList.tqfind(payee.id());
if(it_p == m_payeeList.end()) {
- QString msg = "Unknown payee '" + payee.id() + "'";
+ TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
// scan all transactions to check if the payee is still referenced
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
if((*it_t).hasReferenceTo(payee.id())) {
- throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("transaction"));
+ throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("transaction"));
}
}
// check referential integrity in schedules
for(it_s = m_scheduleList.begin(); it_s != m_scheduleList.end(); ++it_s) {
if((*it_s).hasReferenceTo(payee.id())) {
- throw new MYMONEYEXCEPTION(QString("Cannot remove payee that is still referenced to a %1").arg("schedule"));
+ throw new MYMONEYEXCEPTION(TQString("Cannot remove payee that is still referenced to a %1").tqarg("schedule"));
}
}
@@ -242,27 +242,27 @@ void MyMoneySeqAccessMgr::removePayee(const MyMoneyPayee& payee)
m_payeeList.remove((*it_p).id());
}
-const QValueList<MyMoneyPayee> MyMoneySeqAccessMgr::payeeList(void) const
+const TQValueList<MyMoneyPayee> MyMoneySeqAccessMgr::payeeList(void) const
{
return m_payeeList.values();
}
-void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account)
+void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account)
{
- QMap<QString, MyMoneyAccount>::ConstIterator theParent;
- QMap<QString, MyMoneyAccount>::ConstIterator theChild;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theChild;
- theParent = m_accountList.find(parent.id());
+ theParent = m_accountList.tqfind(tqparent.id());
if(theParent == m_accountList.end()) {
- QString msg = "Unknown parent account '";
- msg += parent.id() + "'";
+ TQString msg = "Unknown tqparent account '";
+ msg += tqparent.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
- theChild = m_accountList.find(account.id());
+ theChild = m_accountList.tqfind(account.id());
if(theChild == m_accountList.end()) {
- QString msg = "Unknown child account '";
+ TQString msg = "Unknown child account '";
msg += account.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -270,10 +270,10 @@ void MyMoneySeqAccessMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& acc
MyMoneyAccount acc = *theParent;
acc.addAccountId(account.id());
m_accountList.modify(acc.id(), acc);
- parent = acc;
+ tqparent = acc;
acc = *theChild;
- acc.setParentAccountId(parent.id());
+ acc.setParentAccountId(tqparent.id());
m_accountList.modify(acc.id(), acc);
account = acc;
@@ -291,7 +291,7 @@ void MyMoneySeqAccessMgr::addInstitution(MyMoneyInstitution& institution)
institution = newInstitution;
}
-unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const
+unsigned int MyMoneySeqAccessMgr::transactionCount(const TQString& account) const
{
unsigned int cnt = 0;
@@ -299,8 +299,8 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const
cnt = m_transactionList.count();
} else {
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
// scan all transactions
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
@@ -326,11 +326,11 @@ unsigned int MyMoneySeqAccessMgr::transactionCount(const QString& account) const
return cnt;
}
-const QMap<QString, unsigned long> MyMoneySeqAccessMgr::transactionCountMap(void) const
+const TQMap<TQString, unsigned long> MyMoneySeqAccessMgr::transactionCountMap(void) const
{
- QMap<QString, unsigned long> map;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, unsigned long> map;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
// scan all transactions
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
@@ -352,49 +352,49 @@ unsigned int MyMoneySeqAccessMgr::accountCount(void) const
return m_accountList.count();
}
-QString MyMoneySeqAccessMgr::nextPayeeID(void)
+TQString MyMoneySeqAccessMgr::nextPayeeID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextPayeeID);
id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0');
return id;
}
-QString MyMoneySeqAccessMgr::nextInstitutionID(void)
+TQString MyMoneySeqAccessMgr::nextInstitutionID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextInstitutionID);
id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0');
return id;
}
-QString MyMoneySeqAccessMgr::nextAccountID(void)
+TQString MyMoneySeqAccessMgr::nextAccountID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextAccountID);
id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0');
return id;
}
-QString MyMoneySeqAccessMgr::nextTransactionID(void)
+TQString MyMoneySeqAccessMgr::nextTransactionID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextTransactionID);
id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0');
return id;
}
-QString MyMoneySeqAccessMgr::nextScheduleID(void)
+TQString MyMoneySeqAccessMgr::nextScheduleID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextScheduleID);
id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0');
return id;
}
-QString MyMoneySeqAccessMgr::nextSecurityID(void)
+TQString MyMoneySeqAccessMgr::nextSecurityID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextSecurityID);
id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0');
return id;
@@ -416,7 +416,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const
throw new MYMONEYEXCEPTION("invalid post date");
// now check the splits
- 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 lines will throw an exception if the
// account or payee do not exist
@@ -426,7 +426,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const
}
MyMoneyTransaction newTransaction(nextTransactionID(), transaction);
- QString key = newTransaction.uniqueSortKey();
+ TQString key = newTransaction.uniqueSortKey();
m_transactionList.insert(key, newTransaction);
m_transactionKeys.insert(newTransaction.id(), key);
@@ -439,7 +439,7 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const
acc.adjustBalance(*it_s);
if(!skipAccountUpdate) {
acc.touch();
- invalidateBalanceCache(acc.id());
+ tqinvalidateBalanceCache(acc.id());
}
m_accountList.modify(acc.id(), acc);
}
@@ -448,12 +448,12 @@ void MyMoneySeqAccessMgr::addTransaction(MyMoneyTransaction& transaction, const
void MyMoneySeqAccessMgr::touch(void)
{
m_dirty = true;
- m_lastModificationDate = QDate::currentDate();
+ m_lastModificationDate = TQDate::tqcurrentDate();
}
-bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const
+bool MyMoneySeqAccessMgr::hasActiveSplits(const TQString& id) const
{
- QMap<QString, MyMoneyTransaction>::ConstIterator it;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it;
for(it = m_transactionList.begin(); it != m_transactionList.end(); ++it) {
if((*it).accountReferenced(id)) {
@@ -463,39 +463,39 @@ bool MyMoneySeqAccessMgr::hasActiveSplits(const QString& id) const
return false;
}
-const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const QString& id) const
+const MyMoneyInstitution MyMoneySeqAccessMgr::institution(const TQString& id) const
{
- QMap<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
- pos = m_institutionList.find(id);
+ pos = m_institutionList.tqfind(id);
if(pos != m_institutionList.end())
return *pos;
throw new MYMONEYEXCEPTION("unknown institution");
}
-const QValueList<MyMoneyInstitution> MyMoneySeqAccessMgr::institutionList(void) const
+const TQValueList<MyMoneyInstitution> MyMoneySeqAccessMgr::institutionList(void) const
{
return m_institutionList.values();
}
void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const bool skipCheck)
{
- QMap<QString, MyMoneyAccount>::ConstIterator pos;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator pos;
// locate the account in the file global pool
- pos = m_accountList.find(account.id());
+ pos = m_accountList.tqfind(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
// as well as the type are equal.
- if((((*pos).parentAccountId() == account.parentAccountId())
+ if((((*pos).tqparentAccountId() == account.tqparentAccountId())
&& ((*pos).accountType() == account.accountType()))
|| (skipCheck == true)) {
// make sure that all the referenced objects exist
if(!account.institutionId().isEmpty())
institution(account.institutionId());
- QValueList<QString>::ConstIterator it_a;
+ TQValueList<TQString>::ConstIterator it_a;
for(it_a = account.accountList().begin(); it_a != account.accountList().end(); ++it_a) {
this->account(*it_a);
}
@@ -503,8 +503,8 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo
// update information in account list
m_accountList.modify(account.id(), account);
- // invalidate cached balance
- invalidateBalanceCache(account.id());
+ // tqinvalidate cached balance
+ tqinvalidateBalanceCache(account.id());
} else
throw new MYMONEYEXCEPTION("Invalid information for update");
@@ -515,10 +515,10 @@ void MyMoneySeqAccessMgr::modifyAccount(const MyMoneyAccount& account, const boo
void MyMoneySeqAccessMgr::modifyInstitution(const MyMoneyInstitution& institution)
{
- QMap<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
// locate the institution in the file global pool
- pos = m_institutionList.find(institution.id());
+ pos = m_institutionList.tqfind(institution.id());
if(pos != m_institutionList.end()) {
m_institutionList.modify(institution.id(), institution);
@@ -542,7 +542,7 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio
throw new MYMONEYEXCEPTION("invalid transaction to be modified");
// now check the splits
- 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 lines will throw an exception if the
// account or payee do not exist
@@ -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.contains(transaction.id()))
+ if(!m_transactionKeys.tqcontains(transaction.id()))
throw new MYMONEYEXCEPTION("invalid transaction id");
- QString oldKey = m_transactionKeys[transaction.id()];
- if(!m_transactionList.contains(oldKey))
+ TQString oldKey = m_transactionKeys[transaction.id()];
+ if(!m_transactionList.tqcontains(oldKey))
throw new MYMONEYEXCEPTION("invalid transaction key");
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
- it_t = m_transactionList.find(oldKey);
+ it_t = m_transactionList.tqfind(oldKey);
if(it_t == m_transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
@@ -571,14 +571,14 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio
MyMoneyAccount acc = m_accountList[(*it_s).accountId()];
acc.adjustBalance(*it_s, true); // reverse the adjust operation (reverse = true)
acc.touch();
- invalidateBalanceCache(acc.id());
+ tqinvalidateBalanceCache(acc.id());
m_accountList.modify(acc.id(), acc);
}
for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) {
MyMoneyAccount acc = m_accountList[(*it_s).accountId()];
acc.adjustBalance(*it_s);
acc.touch();
- invalidateBalanceCache(acc.id());
+ tqinvalidateBalanceCache(acc.id());
m_accountList.modify(acc.id(), acc);
}
@@ -586,54 +586,54 @@ void MyMoneySeqAccessMgr::modifyTransaction(const MyMoneyTransaction& transactio
m_transactionList.remove(oldKey);
// add new transaction to lists
- QString newKey = transaction.uniqueSortKey();
+ TQString newKey = transaction.uniqueSortKey();
m_transactionList.insert(newKey, transaction);
m_transactionKeys.modify(transaction.id(), newKey);
}
-void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent)
+void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent)
{
- reparentAccount(account, parent, true);
+ reparentAccount(account, tqparent, true);
}
-void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool /* sendNotification */)
+void MyMoneySeqAccessMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool /* sendNotification */)
{
- QMap<QString, MyMoneyAccount>::ConstIterator oldParent;
- QMap<QString, MyMoneyAccount>::ConstIterator newParent;
- QMap<QString, MyMoneyAccount>::ConstIterator childAccount;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator oldParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator newParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator childAccount;
// verify that accounts exist. If one does not,
// an exception is thrown
MyMoneySeqAccessMgr::account(account.id());
- MyMoneySeqAccessMgr::account(parent.id());
- if(!account.parentAccountId().isEmpty()) {
- MyMoneySeqAccessMgr::account(account.parentAccountId());
- oldParent = m_accountList.find(account.parentAccountId());
+ MyMoneySeqAccessMgr::account(tqparent.id());
+ if(!account.tqparentAccountId().isEmpty()) {
+ MyMoneySeqAccessMgr::account(account.tqparentAccountId());
+ oldParent = m_accountList.tqfind(account.tqparentAccountId());
}
- if(account.accountType() == MyMoneyAccount::Stock && parent.accountType() != MyMoneyAccount::Investment)
+ 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.find(parent.id());
- childAccount = m_accountList.find(account.id());
+ newParent = m_accountList.tqfind(tqparent.id());
+ childAccount = m_accountList.tqfind(account.id());
MyMoneyAccount acc;
- if(!account.parentAccountId().isEmpty()) {
+ if(!account.tqparentAccountId().isEmpty()) {
acc = (*oldParent);
acc.removeAccountId(account.id());
m_accountList.modify(acc.id(), acc);
}
- parent = (*newParent);
- parent.addAccountId(account.id());
- m_accountList.modify(parent.id(), parent);
+ tqparent = (*newParent);
+ tqparent.addAccountId(account.id());
+ m_accountList.modify(tqparent.id(), tqparent);
account = (*childAccount);
- account.setParentAccountId(parent.id());
+ account.setParentAccountId(tqparent.id());
m_accountList.modify(account.id(), account);
#if 0
- // make sure the type is the same as the new parent. This does not work for stock and investment
+ // make sure the type is the same as the new tqparent. This does not work for stock and investment
if(account.accountType() != MyMoneyAccount::Stock && account.accountType() != MyMoneyAccount::Investment)
(*childAccount).setAccountType((*newParent).accountType());
#endif
@@ -645,18 +645,18 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio
if(transaction.id().isEmpty())
throw new MYMONEYEXCEPTION("invalid transaction to be deleted");
- QMap<QString, QString>::ConstIterator it_k;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, TQString>::ConstIterator it_k;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
- it_k = m_transactionKeys.find(transaction.id());
+ it_k = m_transactionKeys.tqfind(transaction.id());
if(it_k == m_transactionKeys.end())
throw new MYMONEYEXCEPTION("invalid transaction to be deleted");
- it_t = m_transactionList.find(*it_k);
+ it_t = m_transactionList.tqfind(*it_k);
if(it_t == m_transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
// scan the splits and collect all accounts that need
// to be updated after the removal of this transaction
@@ -665,7 +665,7 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio
acc.adjustBalance(*it_s, true); // reverse = true
acc.touch();
m_accountList.modify(acc.id(), acc);
- invalidateBalanceCache(acc.id());
+ tqinvalidateBalanceCache(acc.id());
}
// FIXME: check if any split is frozen and throw exception
@@ -677,12 +677,12 @@ void MyMoneySeqAccessMgr::removeTransaction(const MyMoneyTransaction& transactio
void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account)
{
- MyMoneyAccount parent;
+ MyMoneyAccount tqparent;
- // check that the account and it's parent exist
+ // check that the account and it's tqparent exist
// this will throw an exception if the id is unknown
MyMoneySeqAccessMgr::account(account.id());
- parent = MyMoneySeqAccessMgr::account(account.parentAccountId());
+ tqparent = MyMoneySeqAccessMgr::account(account.tqparentAccountId());
// check that it's not one of the standard account groups
if(isStandardAccount(account.id()))
@@ -692,10 +692,10 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account)
throw new MYMONEYEXCEPTION("Unable to remove account with active splits");
}
- // re-parent all sub-ordinate accounts to the parent of the account
+ // re-tqparent all sub-ordinate accounts to the tqparent of the account
// to be deleted. First round check that all accounts exist, second
- // round do the re-parenting.
- QStringList::ConstIterator it;
+ // round do the re-tqparenting.
+ TQStringList::ConstIterator it;
for(it = account.accountList().begin(); it != account.accountList().end(); ++it) {
MyMoneySeqAccessMgr::account(*it);
}
@@ -703,18 +703,18 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account)
// if one of the accounts did not exist, an exception had been
// thrown and we would not make it until here.
- QMap<QString, MyMoneyAccount>::ConstIterator it_a;
- QMap<QString, MyMoneyAccount>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it_a;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it_p;
// locate the account in the file global pool
- it_a = m_accountList.find(account.id());
+ it_a = m_accountList.tqfind(account.id());
if(it_a == m_accountList.end())
throw new MYMONEYEXCEPTION("Internal error: account not found in list");
- it_p = m_accountList.find(parent.id());
+ it_p = m_accountList.tqfind(tqparent.id());
if(it_p == m_accountList.end())
- throw new MYMONEYEXCEPTION("Internal error: parent account not found in list");
+ throw new MYMONEYEXCEPTION("Internal error: tqparent account not found in list");
if(!account.institutionId().isEmpty())
throw new MYMONEYEXCEPTION("Cannot remove account still attached to an institution");
@@ -729,34 +729,34 @@ void MyMoneySeqAccessMgr::removeAccount(const MyMoneyAccount& account)
if((*it_a).id() == account.id()
&& (*it_a).accountType() == account.accountType()) {
- // second round over sub-ordinate accounts: do re-parenting
+ // second round over sub-ordinate accounts: do re-tqparenting
// but only if the list contains at least one entry
// FIXME: move this logic to MyMoneyFile
if((*it_a).accountList().count() > 0) {
while((*it_a).accountList().count() > 0) {
it = (*it_a).accountList().begin();
MyMoneyAccount acc(MyMoneySeqAccessMgr::account(*it));
- reparentAccount(acc, parent, false);
+ reparentAccount(acc, tqparent, false);
}
}
- // remove account from parent's list
- parent.removeAccountId(account.id());
- m_accountList.modify(parent.id(), parent);
+ // remove account from tqparent's list
+ tqparent.removeAccountId(account.id());
+ m_accountList.modify(tqparent.id(), tqparent);
// remove account from the global account pool
m_accountList.remove(account.id());
// remove from balance list
m_balanceCache.remove(account.id());
- invalidateBalanceCache(parent.id());
+ tqinvalidateBalanceCache(tqparent.id());
}
}
void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institution)
{
- QMap<QString, MyMoneyInstitution>::ConstIterator it_i;
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator it_i;
- it_i = m_institutionList.find(institution.id());
+ it_i = m_institutionList.tqfind(institution.id());
if(it_i != m_institutionList.end()) {
m_institutionList.remove(institution.id());
@@ -764,11 +764,11 @@ void MyMoneySeqAccessMgr::removeInstitution(const MyMoneyInstitution& institutio
throw new MYMONEYEXCEPTION("invalid institution");
}
-void MyMoneySeqAccessMgr::transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
+void MyMoneySeqAccessMgr::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
// This code is used now. It adds the transaction to the list for
@@ -789,55 +789,55 @@ void MyMoneySeqAccessMgr::transactionList(QValueList<MyMoneyTransaction>& list,
}
}
-void MyMoneySeqAccessMgr::transactionList(QValueList< QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
+void MyMoneySeqAccessMgr::transactionList(TQValueList< TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
if(filter.match(*it_t)) {
- QValueList<MyMoneySplit>::const_iterator it_s;
+ TQValueList<MyMoneySplit>::const_iterator it_s;
for(it_s = filter.matchingSplits().begin(); it_s != filter.matchingSplits().end(); ++it_s) {
- list.append(qMakePair(*it_t, *it_s));
+ list.append(tqMakePair(*it_t, *it_s));
}
}
}
}
-const QValueList<MyMoneyTransaction> MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const
+const TQValueList<MyMoneyTransaction> MyMoneySeqAccessMgr::transactionList(MyMoneyTransactionFilter& filter) const
{
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
transactionList(list, filter);
return list;
}
-const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& id) const
+const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& id) const
{
// get the full key of this transaction, throw exception
// if it's invalid (unknown)
- if(!m_transactionKeys.contains(id)) {
- QString msg = QString("Invalid transaction id '%1'").arg(id);
+ if(!m_transactionKeys.tqcontains(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
- QString key = m_transactionKeys[id];
- if(!m_transactionList.contains(key)) {
- QString msg = QString("Invalid transaction key '%1'").arg(key);
+ TQString key = m_transactionKeys[id];
+ if(!m_transactionList.tqcontains(key)) {
+ TQString msg = TQString("Invalid transaction key '%1'").tqarg(key);
throw new MYMONEYEXCEPTION(msg);
}
return m_transactionList[key];
}
-const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account, const int idx) const
+const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const TQString& account, const int idx) const
{
/* removed with MyMoneyAccount::Transaction
- QMap<QString, MyMoneyAccount>::ConstIterator acc;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator acc;
// find account object in list, throw exception if unknown
- acc = m_accountList.find(account);
+ acc = m_accountList.tqfind(account);
if(acc == m_accountList.end())
throw new MYMONEYEXCEPTION("unknown account id");
@@ -849,7 +849,7 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account
*/
// new implementation if the above code does not work anymore
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
MyMoneyAccount acc = m_accountList[account];
MyMoneyTransactionFilter filter;
@@ -866,36 +866,36 @@ const MyMoneyTransaction MyMoneySeqAccessMgr::transaction(const QString& account
return transaction(list[idx].id());
}
-const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneySeqAccessMgr::balance(const TQString& id, const TQDate& date) const
{
MyMoneyMoney result(0);
MyMoneyAccount acc;
- // if (date != QDate()) qDebug ("request balance for %s at %s", id.data(), date.toString(Qt::ISODate).latin1());
+ // 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.find(id) != m_accountList.end())
+ if(m_accountList.tqfind(id) != m_accountList.end())
return m_accountList[id].balance();
return MyMoneyMoney(0);
}
if(m_balanceCache[id].valid == false || date != m_balanceCacheDate) {
- QMap<QString, MyMoneyMoney> balances;
- QMap<QString, MyMoneyMoney>::ConstIterator it_b;
+ TQMap<TQString, MyMoneyMoney> balances;
+ TQMap<TQString, MyMoneyMoney>::ConstIterator it_b;
if (date != m_balanceCacheDate) {
m_balanceCache.clear();
m_balanceCacheDate = date;
}
- QValueList<MyMoneyTransaction> list;
- QValueList<MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
MyMoneyTransactionFilter filter;
- filter.setDateFilter(QDate(), date);
+ filter.setDateFilter(TQDate(), date);
filter.setReportAllSplits(false);
transactionList(list, filter);
for(it_t = list.begin(); it_t != list.end(); ++it_t) {
for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s){
- const QString& aid = (*it_s).accountId();
+ const TQString& aid = (*it_s).accountId();
if((*it_s).action() == MyMoneySplit::ActionSplitShares) {
balances[aid] = balances[aid] * (*it_s).shares();
} else {
@@ -911,7 +911,7 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate&
}
// fill all accounts w/o transactions to zero
- QMap<QString, MyMoneyAccount>::ConstIterator it_a;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it_a;
for(it_a = m_accountList.begin(); it_a != m_accountList.end(); ++it_a) {
if(m_balanceCache[(*it_a).id()].valid == false) {
MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1));
@@ -928,10 +928,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::balance(const QString& id, const QDate&
return result;
}
-const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const TQString& id, const TQDate& date) const
{
- QStringList accounts;
- QStringList::ConstIterator it_a;
+ TQStringList accounts;
+ TQStringList::ConstIterator it_a;
MyMoneyMoney result(balance(id, date));
@@ -952,10 +952,10 @@ const MyMoneyMoney MyMoneySeqAccessMgr::totalBalance(const QString& id, const QD
* the functionality, we can turn it back on. BTW: the stuff is untested ;-)
*/
/*
-const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QString& newAccount)
+const unsigned int MyMoneyFile::moveSplits(const TQString& oldAccount, const TQString& newAccount)
{
- QMap<QString, MyMoneyTransaction>::Iterator it_t;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyTransaction>::Iterator it_t;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
unsigned int cnt = 0;
// scan all transactions
@@ -974,13 +974,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr
if(cnt != 0) {
// now update all the accounts that were referenced
- QMap<QString, MyMoneyAccount>::Iterator acc;
- acc = m_accountList.find(oldAccount);
+ TQMap<TQString, MyMoneyAccount>::Iterator acc;
+ acc = m_accountList.tqfind(oldAccount);
if(acc != m_accountList.end()) {
(*acc).touch();
refreshAccountTransactionList(acc);
}
- acc = m_accountList.find(newAccount);
+ acc = m_accountList.tqfind(newAccount);
if(acc != m_accountList.end()) {
(*acc).touch();
refreshAccountTransactionList(acc);
@@ -993,13 +993,13 @@ const unsigned int MyMoneyFile::moveSplits(const QString& oldAccount, const QStr
}
*/
-void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id)
+void MyMoneySeqAccessMgr::tqinvalidateBalanceCache(const TQString& id)
{
if(!id.isEmpty()) {
try {
m_balanceCache[id].valid = false;
if(!isStandardAccount(id)) {
- invalidateBalanceCache(account(id).parentAccountId());
+ tqinvalidateBalanceCache(account(id).tqparentAccountId());
}
} catch (MyMoneyException *e) {
delete e;
@@ -1007,33 +1007,33 @@ void MyMoneySeqAccessMgr::invalidateBalanceCache(const QString& id)
}
}
-void MyMoneySeqAccessMgr::loadAccounts(const QMap<QString, MyMoneyAccount>& map)
+void MyMoneySeqAccessMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& map)
{
m_accountList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyAccount>::const_iterator it_a;
- QString lastId("");
+ TQMap<TQString, MyMoneyAccount>::const_iterator it_a;
+ TQString lastId("");
for(it_a = map.begin(); it_a != map.end(); ++it_a) {
if(!isStandardAccount((*it_a).id()) && ((*it_a).id() > lastId))
lastId = (*it_a).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextAccountID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadTransactions(const QMap<QString, MyMoneyTransaction>& map)
+void MyMoneySeqAccessMgr::loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map)
{
m_transactionList = map;
// now fill the key map and
// identify the last used id
- QString lastId("");
- QMap<QString, QString> keys;
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQString lastId("");
+ TQMap<TQString, TQString> keys;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
for(it_t = map.begin(); it_t != map.end(); ++it_t) {
keys[(*it_t).id()] = it_t.key();
if((*it_t).id() > lastId)
@@ -1042,37 +1042,37 @@ void MyMoneySeqAccessMgr::loadTransactions(const QMap<QString, MyMoneyTransactio
m_transactionKeys = keys;
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextTransactionID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadInstitutions(const QMap<QString, MyMoneyInstitution>& map)
+void MyMoneySeqAccessMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map)
{
m_institutionList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyInstitution>::const_iterator it_i;
- QString lastId("");
+ TQMap<TQString, MyMoneyInstitution>::const_iterator it_i;
+ TQString lastId("");
for(it_i = map.begin(); it_i != map.end(); ++it_i) {
if((*it_i).id() > lastId)
lastId = (*it_i).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextInstitutionID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadPayees(const QMap<QString, MyMoneyPayee>& map)
+void MyMoneySeqAccessMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& map)
{
m_payeeList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyPayee>::const_iterator it_p;
- QString lastId("");
+ TQMap<TQString, MyMoneyPayee>::const_iterator it_p;
+ TQString lastId("");
for(it_p = map.begin(); it_p != map.end(); ++it_p) {
if((*it_p).id().length() <= PAYEE_ID_SIZE+1) {
if((*it_p).id() > lastId)
@@ -1081,31 +1081,31 @@ void MyMoneySeqAccessMgr::loadPayees(const QMap<QString, MyMoneyPayee>& map)
}
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextPayeeID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadSecurities(const QMap<QString, MyMoneySecurity>& map)
+void MyMoneySeqAccessMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>& map)
{
m_securitiesList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneySecurity>::const_iterator it_s;
- QString lastId("");
+ TQMap<TQString, MyMoneySecurity>::const_iterator it_s;
+ TQString lastId("");
for(it_s = map.begin(); it_s != map.end(); ++it_s) {
if((*it_s).id() > lastId)
lastId = (*it_s).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextSecurityID = atol(lastId.mid(pos));
}
}
-void MyMoneySeqAccessMgr::loadCurrencies(const QMap<QString, MyMoneySecurity>& map)
+void MyMoneySeqAccessMgr::loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map)
{
m_currencyList = map;
}
@@ -1150,29 +1150,29 @@ void MyMoneySeqAccessMgr::loadBudgetId(const unsigned long id)
m_nextBudgetID = id;
}
-const QString MyMoneySeqAccessMgr::value(const QString& key) const
+const TQString MyMoneySeqAccessMgr::value(const TQString& key) const
{
return MyMoneyKeyValueContainer::value(key);
}
-void MyMoneySeqAccessMgr::setValue(const QString& key, const QString& val)
+void MyMoneySeqAccessMgr::setValue(const TQString& key, const TQString& val)
{
MyMoneyKeyValueContainer::setValue(key, val);
touch();
}
-void MyMoneySeqAccessMgr::deletePair(const QString& key)
+void MyMoneySeqAccessMgr::deletePair(const TQString& key)
{
MyMoneyKeyValueContainer::deletePair(key);
touch();
}
-const QMap<QString, QString> MyMoneySeqAccessMgr::pairs(void) const
+const TQMap<TQString, TQString> MyMoneySeqAccessMgr::pairs(void) const
{
return MyMoneyKeyValueContainer::pairs();
}
-void MyMoneySeqAccessMgr::setPairs(const QMap<QString, QString>& list)
+void MyMoneySeqAccessMgr::setPairs(const TQMap<TQString, TQString>& list)
{
MyMoneyKeyValueContainer::setPairs(list);
touch();
@@ -1194,11 +1194,11 @@ void MyMoneySeqAccessMgr::addSchedule(MyMoneySchedule& sched)
void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched)
{
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = m_scheduleList.find(sched.id());
+ it = m_scheduleList.tqfind(sched.id());
if(it == m_scheduleList.end()) {
- QString msg = "Unknown schedule '" + sched.id() + "'";
+ TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1207,11 +1207,11 @@ void MyMoneySeqAccessMgr::modifySchedule(const MyMoneySchedule& sched)
void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched)
{
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = m_scheduleList.find(sched.id());
+ it = m_scheduleList.tqfind(sched.id());
if(it == m_scheduleList.end()) {
- QString msg = "Unknown schedule '" + sched.id() + "'";
+ TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1219,31 +1219,31 @@ void MyMoneySeqAccessMgr::removeSchedule(const MyMoneySchedule& sched)
m_scheduleList.remove(sched.id());
}
-const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const QString& id) const
+const MyMoneySchedule MyMoneySeqAccessMgr::schedule(const TQString& id) const
{
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
// locate the schedule and if present, return it's data
- pos = m_scheduleList.find(id);
+ pos = m_scheduleList.tqfind(id);
if(pos != m_scheduleList.end())
return (*pos);
// throw an exception, if it does not exist
- QString msg = "Unknown schedule id '" + id + "'";
+ TQString msg = "Unknown schedule id '" + id + "'";
throw new MYMONEYEXCEPTION(msg);
}
-const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
- const QString& accountId,
+const TQValueList<MyMoneySchedule> MyMoneySeqAccessMgr::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
{
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
// qDebug("scheduleList()");
@@ -1270,8 +1270,8 @@ const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
if(!accountId.isEmpty()) {
MyMoneyTransaction t = (*pos).transaction();
- QValueList<MyMoneySplit>::ConstIterator it;
- QValueList<MyMoneySplit> splits;
+ TQValueList<MyMoneySplit>::ConstIterator it;
+ TQValueList<MyMoneySplit> splits;
splits = t.splits();
for(it = splits.begin(); it != splits.end(); ++it) {
if((*it).accountId() == accountId)
@@ -1311,19 +1311,19 @@ const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleList(
return list;
}
-void MyMoneySeqAccessMgr::loadSchedules(const QMap<QString, MyMoneySchedule>& map)
+void MyMoneySeqAccessMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>& map)
{
m_scheduleList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneySchedule>::const_iterator it_s;
- QString lastId("");
+ TQMap<TQString, MyMoneySchedule>::const_iterator it_s;
+ TQString lastId("");
for(it_s = map.begin(); it_s != map.end(); ++it_s) {
if((*it_s).id() > lastId)
lastId = (*it_s).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextScheduleID = atol(lastId.mid(pos));
}
@@ -1334,16 +1334,16 @@ void MyMoneySeqAccessMgr::loadScheduleId(const unsigned long id)
m_nextScheduleID = id;
}
-const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes,
+const TQValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int scheduleTypes,
int scheduleOcurrences,
int schedulePaymentTypes,
- QDate date,
- const QStringList& accounts) const
+ TQDate date,
+ const TQStringList& accounts) const
{
// qDebug("scheduleListEx");
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
if (!date.isValid())
return list;
@@ -1370,7 +1370,7 @@ const QValueList<MyMoneySchedule> MyMoneySeqAccessMgr::scheduleListEx(int schedu
if (accounts.count() > 0)
{
- if (accounts.contains((*pos).account().id()))
+ if (accounts.tqcontains((*pos).account().id()))
continue;
}
@@ -1393,12 +1393,12 @@ void MyMoneySeqAccessMgr::addSecurity(MyMoneySecurity& security)
void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_securitiesList.find(security.id());
+ it = m_securitiesList.tqfind(security.id());
if(it == m_securitiesList.end())
{
- QString msg = "Unknown security '";
+ TQString msg = "Unknown security '";
msg += security.id() + "' during modifySecurity()";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1408,14 +1408,14 @@ void MyMoneySeqAccessMgr::modifySecurity(const MyMoneySecurity& security)
void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
// FIXME: check referential integrity
- it = m_securitiesList.find(security.id());
+ it = m_securitiesList.tqfind(security.id());
if(it == m_securitiesList.end())
{
- QString msg = "Unknown security '";
+ TQString msg = "Unknown security '";
msg += security.id() + "' during removeSecurity()";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1423,9 +1423,9 @@ void MyMoneySeqAccessMgr::removeSecurity(const MyMoneySecurity& security)
m_securitiesList.remove(security.id());
}
-const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const
+const MyMoneySecurity MyMoneySeqAccessMgr::security(const TQString& id) const
{
- QMap<QString, MyMoneySecurity>::ConstIterator it = m_securitiesList.find(id);
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it = m_securitiesList.tqfind(id);
if(it != m_securitiesList.end())
{
return it.data();
@@ -1434,7 +1434,7 @@ const MyMoneySecurity MyMoneySeqAccessMgr::security(const QString& id) const
return MyMoneySecurity();
}
-const QValueList<MyMoneySecurity> MyMoneySeqAccessMgr::securityList(void) const
+const TQValueList<MyMoneySecurity> MyMoneySeqAccessMgr::securityList(void) const
{
//qDebug("securityList: Security list size is %d, this=%8p", m_equitiesList.size(), (void*)this);
return m_securitiesList.values();
@@ -1442,11 +1442,11 @@ const QValueList<MyMoneySecurity> MyMoneySeqAccessMgr::securityList(void) const
void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.find(currency.id());
+ it = m_currencyList.tqfind(currency.id());
if(it != m_currencyList.end()) {
- throw new MYMONEYEXCEPTION(QString("Cannot add currency with existing id %1").arg(currency.id().data()));
+ throw new MYMONEYEXCEPTION(TQString("Cannot add currency with existing id %1").tqarg(currency.id()));
}
m_currencyList.insert(currency.id(), currency);
@@ -1454,11 +1454,11 @@ void MyMoneySeqAccessMgr::addCurrency(const MyMoneySecurity& currency)
void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.find(currency.id());
+ it = m_currencyList.tqfind(currency.id());
if(it == m_currencyList.end()) {
- throw new MYMONEYEXCEPTION(QString("Cannot modify currency with unknown id %1").arg(currency.id().data()));
+ throw new MYMONEYEXCEPTION(TQString("Cannot modify currency with unknown id %1").tqarg(currency.id()));
}
m_currencyList.modify(currency.id(), currency);
@@ -1466,39 +1466,39 @@ void MyMoneySeqAccessMgr::modifyCurrency(const MyMoneySecurity& currency)
void MyMoneySeqAccessMgr::removeCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
// FIXME: check referential integrity
- it = m_currencyList.find(currency.id());
+ it = m_currencyList.tqfind(currency.id());
if(it == m_currencyList.end()) {
- throw new MYMONEYEXCEPTION(QString("Cannot remove currency with unknown id %1").arg(currency.id().data()));
+ throw new MYMONEYEXCEPTION(TQString("Cannot remove currency with unknown id %1").tqarg(currency.id()));
}
m_currencyList.remove(currency.id());
}
-const MyMoneySecurity MyMoneySeqAccessMgr::currency(const QString& id) const
+const MyMoneySecurity MyMoneySeqAccessMgr::currency(const TQString& id) const
{
if(id.isEmpty()) {
}
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = m_currencyList.find(id);
+ it = m_currencyList.tqfind(id);
if(it == m_currencyList.end()) {
- throw new MYMONEYEXCEPTION(QString("Cannot retrieve currency with unknown id '%1'").arg(id.data()));
+ throw new MYMONEYEXCEPTION(TQString("Cannot retrieve currency with unknown id '%1'").tqarg(id));
}
return *it;
}
-const QValueList<MyMoneySecurity> MyMoneySeqAccessMgr::currencyList(void) const
+const TQValueList<MyMoneySecurity> MyMoneySeqAccessMgr::currencyList(void) const
{
return m_currencyList.values();
}
-const QValueList<MyMoneyReport> MyMoneySeqAccessMgr::reportList(void) const
+const TQValueList<MyMoneyReport> MyMoneySeqAccessMgr::reportList(void) const
{
return m_reportList.values();
}
@@ -1513,19 +1513,19 @@ void MyMoneySeqAccessMgr::addReport( MyMoneyReport& report )
report = newReport;
}
-void MyMoneySeqAccessMgr::loadReports(const QMap<QString, MyMoneyReport>& map)
+void MyMoneySeqAccessMgr::loadReports(const TQMap<TQString, MyMoneyReport>& map)
{
m_reportList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyReport>::const_iterator it_r;
- QString lastId("");
+ TQMap<TQString, MyMoneyReport>::const_iterator it_r;
+ TQString lastId("");
for(it_r = map.begin(); it_r != map.end(); ++it_r) {
if((*it_r).id() > lastId)
lastId = (*it_r).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextReportID = atol(lastId.mid(pos));
}
@@ -1533,19 +1533,19 @@ void MyMoneySeqAccessMgr::loadReports(const QMap<QString, MyMoneyReport>& map)
void MyMoneySeqAccessMgr::modifyReport( const MyMoneyReport& report )
{
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = m_reportList.find(report.id());
+ it = m_reportList.tqfind(report.id());
if(it == m_reportList.end()) {
- QString msg = "Unknown report '" + report.id() + "'";
+ TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_reportList.modify(report.id(), report);
}
-QString MyMoneySeqAccessMgr::nextReportID(void)
+TQString MyMoneySeqAccessMgr::nextReportID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextReportID);
id = "R" + id.rightJustify(REPORT_ID_SIZE, '0');
return id;
@@ -1556,25 +1556,25 @@ unsigned MyMoneySeqAccessMgr::countReports(void) const
return m_reportList.count();
}
-const MyMoneyReport MyMoneySeqAccessMgr::report( const QString& _id ) const
+const MyMoneyReport MyMoneySeqAccessMgr::report( const TQString& _id ) const
{
return m_reportList[_id];
}
void MyMoneySeqAccessMgr::removeReport( const MyMoneyReport& report )
{
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = m_reportList.find(report.id());
+ it = m_reportList.tqfind(report.id());
if(it == m_reportList.end()) {
- QString msg = "Unknown report '" + report.id() + "'";
+ TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_reportList.remove(report.id());
}
-const QValueList<MyMoneyBudget> MyMoneySeqAccessMgr::budgetList(void) const
+const TQValueList<MyMoneyBudget> MyMoneySeqAccessMgr::budgetList(void) const
{
return m_budgetList.values();
}
@@ -1587,27 +1587,27 @@ void MyMoneySeqAccessMgr::addBudget( MyMoneyBudget& budget )
budget = newBudget;
}
-void MyMoneySeqAccessMgr::loadBudgets(const QMap<QString, MyMoneyBudget>& map)
+void MyMoneySeqAccessMgr::loadBudgets(const TQMap<TQString, MyMoneyBudget>& map)
{
m_budgetList = map;
// scan the map to identify the last used id
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
- QString lastId("");
+ TQMap<TQString, MyMoneyBudget>::const_iterator it_b;
+ TQString lastId("");
for(it_b = map.begin(); it_b != map.end(); ++it_b) {
if((*it_b).id() > lastId)
lastId = (*it_b).id();
}
- int pos = lastId.find(QRegExp("\\d+"), 0);
+ int pos = lastId.tqfind(TQRegExp("\\d+"), 0);
if(pos != -1) {
m_nextBudgetID = atol(lastId.mid(pos));
}
}
-const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) const
+const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const TQString& budget) const
{
- QMap<QString, MyMoneyBudget>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyBudget>::ConstIterator it_p;
for(it_p = m_budgetList.begin(); it_p != m_budgetList.end(); ++it_p) {
if((*it_p).name() == budget) {
@@ -1620,19 +1620,19 @@ const MyMoneyBudget MyMoneySeqAccessMgr::budgetByName(const QString& budget) con
void MyMoneySeqAccessMgr::modifyBudget( const MyMoneyBudget& budget )
{
- QMap<QString, MyMoneyBudget>::ConstIterator it;
+ TQMap<TQString, MyMoneyBudget>::ConstIterator it;
- it = m_budgetList.find(budget.id());
+ it = m_budgetList.tqfind(budget.id());
if(it == m_budgetList.end()) {
- QString msg = "Unknown budget '" + budget.id() + "'";
+ TQString msg = "Unknown budget '" + budget.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_budgetList.modify(budget.id(), budget);
}
-QString MyMoneySeqAccessMgr::nextBudgetID(void)
+TQString MyMoneySeqAccessMgr::nextBudgetID(void)
{
- QString id;
+ TQString id;
id.setNum(++m_nextBudgetID);
id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0');
return id;
@@ -1643,18 +1643,18 @@ unsigned MyMoneySeqAccessMgr::countBudgets(void) const
return m_budgetList.count();
}
-MyMoneyBudget MyMoneySeqAccessMgr::budget( const QString& _id ) const
+MyMoneyBudget MyMoneySeqAccessMgr::budget( const TQString& _id ) const
{
return m_budgetList[_id];
}
void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget )
{
- QMap<QString, MyMoneyBudget>::ConstIterator it;
+ TQMap<TQString, MyMoneyBudget>::ConstIterator it;
- it = m_budgetList.find(budget.id());
+ it = m_budgetList.tqfind(budget.id());
if(it == m_budgetList.end()) {
- QString msg = "Unknown budget '" + budget.id() + "'";
+ TQString msg = "Unknown budget '" + budget.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1664,8 +1664,8 @@ void MyMoneySeqAccessMgr::removeBudget( const MyMoneyBudget& budget )
void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price)
{
MyMoneySecurityPair pricePair(price.from(), price.to());
- QMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.find(pricePair);
+ TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
+ it_m = m_priceList.tqfind(pricePair);
MyMoneyPriceEntries entries;
if(it_m != m_priceList.end()) {
@@ -1677,9 +1677,9 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price)
// an existing one.
MyMoneyPriceEntries::ConstIterator it;
- it = entries.find(price.date());
+ it = entries.tqfind(price.date());
if(it != entries.end()) {
- if((*it).rate(QString()) == price.rate(QString())
+ if((*it).rate(TQString()) == price.rate(TQString())
&& (*it).source() == price.source())
// in case the information did not change, we don't do anything
return;
@@ -1698,8 +1698,8 @@ void MyMoneySeqAccessMgr::addPrice(const MyMoneyPrice& price)
void MyMoneySeqAccessMgr::removePrice(const MyMoneyPrice& price)
{
MyMoneySecurityPair pricePair(price.from(), price.to());
- QMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
- it_m = m_priceList.find(pricePair);
+ TQMap<MyMoneySecurityPair, MyMoneyPriceEntries>::ConstIterator it_m;
+ it_m = m_priceList.tqfind(pricePair);
MyMoneyPriceEntries entries;
if(it_m != m_priceList.end()) {
@@ -1723,20 +1723,20 @@ const MyMoneyPriceList MyMoneySeqAccessMgr::priceList(void) const
return list;
}
-const MyMoneyPrice MyMoneySeqAccessMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const
+const MyMoneyPrice MyMoneySeqAccessMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const
{
MyMoneyPrice rc;
MyMoneyPriceEntries::ConstIterator it;
- QDate date(_date);
+ TQDate date(_date);
// If no valid date is passed, we use today's date.
if(!date.isValid())
- date = QDate::currentDate();
+ date = TQDate::tqcurrentDate();
// 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)].find(date);
+ it = m_priceList[MyMoneySecurityPair(fromId, toId)].tqfind(date);
if(it != m_priceList[MyMoneySecurityPair(fromId, toId)].end())
rc = *it;
@@ -1761,24 +1761,24 @@ void MyMoneySeqAccessMgr::clearCache(void)
void MyMoneySeqAccessMgr::rebuildAccountBalances(void)
{
// reset the balance of all accounts to 0
- QMap<QString, MyMoneyAccount> map;
+ TQMap<TQString, MyMoneyAccount> map;
m_accountList.map(map);
- QMap<QString, MyMoneyAccount>::iterator it_a;
+ TQMap<TQString, MyMoneyAccount>::iterator it_a;
for(it_a = map.begin(); it_a != map.end(); ++it_a) {
(*it_a).setBalance(MyMoneyMoney(0));
}
// now scan over all transactions and all splits and setup the balances
- QMap<QString, MyMoneyTransaction>::const_iterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::const_iterator it_t;
for(it_t = m_transactionList.begin(); it_t != m_transactionList.end(); ++it_t) {
- const QValueList<MyMoneySplit>& splits = (*it_t).splits();
- QValueList<MyMoneySplit>::const_iterator it_s = splits.begin();
+ const TQValueList<MyMoneySplit>& splits = (*it_t).splits();
+ TQValueList<MyMoneySplit>::const_iterator it_s = splits.begin();
for(; it_s != splits.end(); ++it_s ) {
if(!(*it_s).shares().isZero()) {
- const QString& id = (*it_s).accountId();
+ const TQString& id = (*it_s).accountId();
// locate the account and if present, update data
- if(map.find(id) != map.end()) {
+ if(map.tqfind(id) != map.end()) {
map[id].adjustBalance(*it_s);
}
}
@@ -1796,14 +1796,14 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi
// you miss the report checks in the following lines ;)
bool rc = false;
- const QString& id = obj.id();
- QMap<QString, MyMoneyTransaction>::const_iterator it_t;
- QMap<QString, MyMoneyAccount>::const_iterator it_a;
- QMap<QString, MyMoneyInstitution>::const_iterator it_i;
- QMap<QString, MyMoneyPayee>::const_iterator it_p;
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
- QMap<QString, MyMoneySchedule>::const_iterator it_sch;
- QMap<QString, MyMoneySecurity>::const_iterator it_sec;
+ const TQString& id = obj.id();
+ TQMap<TQString, MyMoneyTransaction>::const_iterator it_t;
+ TQMap<TQString, MyMoneyAccount>::const_iterator it_a;
+ TQMap<TQString, MyMoneyInstitution>::const_iterator it_i;
+ TQMap<TQString, MyMoneyPayee>::const_iterator it_p;
+ TQMap<TQString, MyMoneyBudget>::const_iterator it_b;
+ TQMap<TQString, MyMoneySchedule>::const_iterator it_sch;
+ TQMap<TQString, MyMoneySecurity>::const_iterator it_sec;
MyMoneyPriceList::const_iterator it_pr;
// FIXME optimize the list of objects we have to checks
@@ -1853,7 +1853,7 @@ bool MyMoneySeqAccessMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFi
rc = (*it_sec).hasReferenceTo(id);
}
}
- // within the pricelist we don't have to scan each entry. Checking the QPair
+ // within the pricelist we don't have to scan each entry. Checking the TQPair
// members of the MyMoneySecurityPair is enough as they are identical to the
// two security ids
if(!skipCheck[RefCheckPrice]) {
@@ -1917,10 +1917,10 @@ void MyMoneySeqAccessMgr::rollbackTransaction(void)
m_priceList.rollbackTransaction();
}
-void MyMoneySeqAccessMgr::removeReferences(const QString& id)
+void MyMoneySeqAccessMgr::removeReferences(const TQString& id)
{
- QMap<QString, MyMoneyReport>::const_iterator it_r;
- QMap<QString, MyMoneyBudget>::const_iterator it_b;
+ TQMap<TQString, MyMoneyReport>::const_iterator it_r;
+ TQMap<TQString, MyMoneyBudget>::const_iterator it_b;
// remove from reports
for(it_r = m_reportList.begin(); it_r != m_reportList.end(); ++it_r) {