summaryrefslogtreecommitdiffstats
path: root/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp')
-rw-r--r--kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp674
1 files changed, 337 insertions, 337 deletions
diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
index e845094..e80feaf 100644
--- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
+++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.cpp
@@ -26,8 +26,8 @@
#define PASS } catch (MyMoneyException *e) { throw; }
MyMoneyDatabaseMgr::MyMoneyDatabaseMgr() :
-m_creationDate (QDate::currentDate ()),
-m_lastModificationDate (QDate::currentDate ()),
+m_creationDate (TQDate::tqcurrentDate ()),
+m_lastModificationDate (TQDate::tqcurrentDate ()),
m_sql (0)
{ }
@@ -38,10 +38,10 @@ MyMoneyDatabaseMgr::~MyMoneyDatabaseMgr()
const MyMoneyPayee MyMoneyDatabaseMgr::user(void) const
{ return m_user; }
-const QDate MyMoneyDatabaseMgr::creationDate(void) const
+const TQDate MyMoneyDatabaseMgr::creationDate(void) const
{ return m_creationDate; }
-const QDate MyMoneyDatabaseMgr::lastModificationDate(void) const
+const TQDate MyMoneyDatabaseMgr::lastModificationDate(void) const
{ return m_lastModificationDate; }
unsigned int MyMoneyDatabaseMgr::currentFixVersion(void) const
@@ -61,27 +61,27 @@ void MyMoneyDatabaseMgr::setFileFixVersion(const unsigned int v)
{ m_fileFixVersion = v; }
// methods provided by MyMoneyKeyValueContainer
-const QString MyMoneyDatabaseMgr::value(const QString& key) const
+const TQString MyMoneyDatabaseMgr::value(const TQString& key) const
{
return MyMoneyKeyValueContainer::value(key);
}
-void MyMoneyDatabaseMgr::setValue(const QString& key, const QString& val)
+void MyMoneyDatabaseMgr::setValue(const TQString& key, const TQString& val)
{
MyMoneyKeyValueContainer::setValue(key, val);
}
-void MyMoneyDatabaseMgr::deletePair(const QString& key)
+void MyMoneyDatabaseMgr::deletePair(const TQString& key)
{
MyMoneyKeyValueContainer::deletePair(key);
}
-const QMap<QString, QString> MyMoneyDatabaseMgr::pairs(void) const
+const TQMap<TQString, TQString> MyMoneyDatabaseMgr::pairs(void) const
{
return MyMoneyKeyValueContainer::pairs();
}
-void MyMoneyDatabaseMgr::setPairs(const QMap<QString, QString>& list)
+void MyMoneyDatabaseMgr::setPairs(const TQMap<TQString, TQString>& list)
{
MyMoneyKeyValueContainer::setPairs(list);
}
@@ -104,43 +104,43 @@ void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& account)
}
}
-void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& parent, MyMoneyAccount& account)
+void MyMoneyDatabaseMgr::addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account)
{
- QMap<QString, MyMoneyAccount> accountList;
- QStringList accountIdList;
- QMap<QString, MyMoneyAccount>::ConstIterator theParent;
- QMap<QString, MyMoneyAccount>::ConstIterator theChild;
+ TQMap<TQString, MyMoneyAccount> accountList;
+ TQStringList accountIdList;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theParent;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator theChild;
- accountIdList << parent.id() << account.id();
+ accountIdList << tqparent.id() << account.id();
startTransaction();
accountList = m_sql->fetchAccounts(accountIdList, true);
- theParent = accountList.find(parent.id());
+ theParent = accountList.tqfind(tqparent.id());
if(theParent == accountList.end()) {
- QString msg = "Unknown parent account '";
- msg += parent.id() + "'";
+ TQString msg = "Unknown tqparent account '";
+ msg += tqparent.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
- theChild = accountList.find(account.id());
+ theChild = accountList.tqfind(account.id());
if(theChild == accountList.end()) {
- QString msg = "Unknown child account '";
+ TQString msg = "Unknown child account '";
msg += account.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
MyMoneyAccount acc = *theParent;
acc.addAccountId(account.id());
- parent = acc;
+ tqparent = acc;
acc = *theChild;
- acc.setParentAccountId(parent.id());
+ acc.setParentAccountId(tqparent.id());
account = acc;
//FIXME: MyMoneyBalanceCacheItem balance;
//FIXME: m_balanceCache[account.id()] = balance;
- m_sql->modifyAccount(parent);
+ m_sql->modifyAccount(tqparent);
m_sql->modifyAccount(account);
commitTransaction();
}
@@ -156,29 +156,29 @@ void MyMoneyDatabaseMgr::addPayee(MyMoneyPayee& payee)
}
}
-const MyMoneyPayee MyMoneyDatabaseMgr::payee(const QString& id) const
+const MyMoneyPayee MyMoneyDatabaseMgr::payee(const TQString& id) const
{
- QMap<QString, MyMoneyPayee>::ConstIterator it;
- QMap<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(id));
- it = payeeList.find(id);
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(id));
+ it = payeeList.tqfind(id);
if(it == payeeList.end())
throw new MYMONEYEXCEPTION("Unknown payee '" + id + "'");
return *it;
}
-const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const
+const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const TQString& payee) const
{
if(payee.isEmpty())
return MyMoneyPayee::null;
- QMap<QString, MyMoneyPayee> payeeList;
+ TQMap<TQString, MyMoneyPayee> payeeList;
TRY
payeeList = m_sql->fetchPayees();
PASS
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
for(it_p = payeeList.begin(); it_p != payeeList.end(); ++it_p) {
if((*it_p).name() == payee) {
@@ -191,12 +191,12 @@ const MyMoneyPayee MyMoneyDatabaseMgr::payeeByName(const QString& payee) const
void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee)
{
- QMap<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(payee.id()), true);
- QMap<QString, MyMoneyPayee>::ConstIterator it;
+ TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()), true);
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it;
- it = payeeList.find(payee.id());
+ it = payeeList.tqfind(payee.id());
if(it == payeeList.end()) {
- QString msg = "Unknown payee '" + payee.id() + "'";
+ TQString msg = "Unknown payee '" + payee.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -205,30 +205,30 @@ void MyMoneyDatabaseMgr::modifyPayee(const MyMoneyPayee& payee)
void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee)
{
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneySchedule>::ConstIterator it_s;
- QMap<QString, MyMoneyPayee> payeeList = m_sql->fetchPayees(QString(payee.id()));
- QMap<QString, MyMoneyPayee>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it_s;
+ TQMap<TQString, MyMoneyPayee> payeeList = m_sql->fetchPayees(TQString(payee.id()));
+ TQMap<TQString, MyMoneyPayee>::ConstIterator it_p;
- it_p = payeeList.find(payee.id());
+ it_p = payeeList.tqfind(payee.id());
if(it_p == 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
- QMap<QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(); // make sure they're all here
+ TQMap<TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(); // make sure they're all here
for(it_t = transactionList.begin(); it_t != 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
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(); // make sure they're all here
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(); // make sure they're all here
for(it_s = scheduleList.begin(); it_s != 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"));
}
}
// remove any reference to report and/or budget
@@ -237,20 +237,20 @@ void MyMoneyDatabaseMgr::removePayee(const MyMoneyPayee& payee)
m_sql->removePayee(payee);
}
-const QValueList<MyMoneyPayee> MyMoneyDatabaseMgr::payeeList(void) const
+const TQValueList<MyMoneyPayee> MyMoneyDatabaseMgr::payeeList(void) const
{
if (m_sql)
return m_sql->fetchPayees().values();
else
- return QValueList<MyMoneyPayee> ();
+ return TQValueList<MyMoneyPayee> ();
}
-const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const
+const MyMoneyAccount MyMoneyDatabaseMgr::account(const TQString& id) const
{
if (m_sql)
{
- QMap <QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(QString(id));
- QMap <QString, MyMoneyAccount>::ConstIterator pos = accountList.find(id);
+ TQMap <TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(TQString(id));
+ TQMap <TQString, MyMoneyAccount>::ConstIterator pos = accountList.tqfind(id);
// locate the account and if present, return it's data
if(pos != accountList.end())
@@ -258,27 +258,27 @@ const MyMoneyAccount MyMoneyDatabaseMgr::account(const QString& id) const
}
// throw an exception, if it does not exist
- QString msg = "Unknown account id '" + id + "'";
+ TQString msg = "Unknown account id '" + id + "'";
throw new MYMONEYEXCEPTION(msg);
}
-bool MyMoneyDatabaseMgr::isStandardAccount(const QString& id) const
+bool MyMoneyDatabaseMgr::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 MyMoneyDatabaseMgr::setAccountName(const QString& id, const QString& name)
+void MyMoneyDatabaseMgr::setAccountName(const TQString& id, const TQString& name)
{
if(!isStandardAccount(id))
throw new MYMONEYEXCEPTION("Only standard accounts can be modified using setAccountName()");
if (m_sql) {
startTransaction();
- MyMoneyAccount acc = m_sql->fetchAccounts(QString(id), true) [id];
+ MyMoneyAccount acc = m_sql->fetchAccounts(TQString(id), true) [id];
acc.setName(name);
m_sql->modifyAccount(acc);
commitTransaction();
@@ -298,9 +298,9 @@ void MyMoneyDatabaseMgr::addInstitution(MyMoneyInstitution& institution)
}
}
-const QString MyMoneyDatabaseMgr::nextPayeeID(void)
+const TQString MyMoneyDatabaseMgr::nextPayeeID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementPayeeId()));
id = "P" + id.rightJustify(PAYEE_ID_SIZE, '0');
@@ -308,9 +308,9 @@ const QString MyMoneyDatabaseMgr::nextPayeeID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextInstitutionID(void)
+const TQString MyMoneyDatabaseMgr::nextInstitutionID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementInstitutionId()));
id = "I" + id.rightJustify(INSTITUTION_ID_SIZE, '0');
@@ -318,9 +318,9 @@ const QString MyMoneyDatabaseMgr::nextInstitutionID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextAccountID(void)
+const TQString MyMoneyDatabaseMgr::nextAccountID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementAccountId()));
id = "A" + id.rightJustify(ACCOUNT_ID_SIZE, '0');
@@ -328,9 +328,9 @@ const QString MyMoneyDatabaseMgr::nextAccountID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextBudgetID(void)
+const TQString MyMoneyDatabaseMgr::nextBudgetID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementBudgetId()));
id = "B" + id.rightJustify(BUDGET_ID_SIZE, '0');
@@ -338,9 +338,9 @@ const QString MyMoneyDatabaseMgr::nextBudgetID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextReportID(void)
+const TQString MyMoneyDatabaseMgr::nextReportID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementReportId()));
id = "R" + id.rightJustify(REPORT_ID_SIZE, '0');
@@ -348,9 +348,9 @@ const QString MyMoneyDatabaseMgr::nextReportID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextTransactionID(void)
+const TQString MyMoneyDatabaseMgr::nextTransactionID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementTransactionId()));
id = "T" + id.rightJustify(TRANSACTION_ID_SIZE, '0');
@@ -358,9 +358,9 @@ const QString MyMoneyDatabaseMgr::nextTransactionID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextScheduleID(void)
+const TQString MyMoneyDatabaseMgr::nextScheduleID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementScheduleId()));
id = "SCH" + id.rightJustify(SCHEDULE_ID_SIZE, '0');
@@ -368,9 +368,9 @@ const QString MyMoneyDatabaseMgr::nextScheduleID(void)
return id;
}
-const QString MyMoneyDatabaseMgr::nextSecurityID(void)
+const TQString MyMoneyDatabaseMgr::nextSecurityID(void)
{
- QString id;
+ TQString id;
if (m_sql) {
id.setNum(ulong(m_sql->incrementSecurityId()));
id = "E" + id.rightJustify(SECURITY_ID_SIZE, '0');
@@ -393,7 +393,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b
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
@@ -403,7 +403,7 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b
}
MyMoneyTransaction newTransaction(nextTransactionID(), transaction);
- QString key = newTransaction.uniqueSortKey();
+ TQString key = newTransaction.uniqueSortKey();
m_sql->addTransaction(newTransaction);
@@ -415,18 +415,18 @@ void MyMoneyDatabaseMgr::addTransaction(MyMoneyTransaction& transaction, const b
acc.adjustBalance((*it_s));
if(!skipAccountUpdate) {
acc.touch();
-//FIXME: invalidateBalanceCache(acc.id());
+//FIXME: tqinvalidateBalanceCache(acc.id());
}
m_sql->modifyAccount(acc);
}
}
-bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const
+bool MyMoneyDatabaseMgr::hasActiveSplits(const TQString& id) const
{
- QMap<QString, MyMoneyTransaction>::ConstIterator it;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it;
MyMoneyTransactionFilter f(id);
- QMap<QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
+ TQMap<TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
for(it = transactionList.begin(); it != transactionList.end(); ++it) {
if((*it).accountReferenced(id)) {
@@ -447,12 +447,12 @@ bool MyMoneyDatabaseMgr::hasActiveSplits(const QString& id) const
* @param date return balance for specific date
* @return balance of the account as MyMoneyMoney object
*/
-//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date);
+//const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date);
-const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneyDatabaseMgr::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));
@@ -460,26 +460,26 @@ const MyMoneyMoney MyMoneyDatabaseMgr::totalBalance(const QString& id, const QDa
for (it_a = accounts.begin(); it_a != accounts.end(); ++it_a) {
accounts += MyMoneyFile::instance()->account(*it_a).accountList();
}
- std::list <QString> tempList (accounts.begin(), accounts.end());
+ std::list <TQString> tempList (accounts.begin(), accounts.end());
tempList.sort();;
tempList.unique();
- accounts = QStringList(tempList);
+ accounts = TQStringList(tempList);
- QMap<QString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accounts, date);
- for (QMap<QString, MyMoneyMoney>::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) {
+ TQMap<TQString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accounts, date);
+ for (TQMap<TQString, MyMoneyMoney>::ConstIterator it_b = balanceMap.begin(); it_b != balanceMap.end(); ++it_b) {
result += it_b.data();
}
return result;
}
-const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const QString& id) const
+const MyMoneyInstitution MyMoneyDatabaseMgr::institution(const TQString& id) const
{
- QMap<QString, MyMoneyInstitution>::ConstIterator pos;
- QMap<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(id));
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(id));
- pos = institutionList.find(id);
+ pos = institutionList.tqfind(id);
if(pos != institutionList.end())
return *pos;
throw new MYMONEYEXCEPTION("unknown institution");
@@ -496,35 +496,35 @@ unsigned int MyMoneyDatabaseMgr::accountCount(void) const
return m_sql->getRecCount("kmmAccounts");
}
-const QValueList<MyMoneyInstitution> MyMoneyDatabaseMgr::institutionList(void) const
+const TQValueList<MyMoneyInstitution> MyMoneyDatabaseMgr::institutionList(void) const
{
if (m_sql) {
return m_sql->fetchInstitutions().values();
} else {
- return QValueList<MyMoneyInstitution> ();
+ return TQValueList<MyMoneyInstitution> ();
}
}
void MyMoneyDatabaseMgr::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
startTransaction();
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts (QString(account.id()), true);
- pos = accountList.find(account.id());
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts (TQString(account.id()), true);
+ pos = accountList.tqfind(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
// 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);
}
@@ -532,8 +532,8 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool
// update information in account list
//m_accountList.modify(account.id(), account);
- // invalidate cached balance
-//FIXME: invalidateBalanceCache(account.id());
+ // tqinvalidate cached balance
+//FIXME: tqinvalidateBalanceCache(account.id());
// mark file as changed
m_sql->modifyAccount(account);
@@ -551,11 +551,11 @@ void MyMoneyDatabaseMgr::modifyAccount(const MyMoneyAccount& account, const bool
void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution)
{
- QMap<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(institution.id()));
- QMap<QString, MyMoneyInstitution>::ConstIterator pos;
+ TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(institution.id()));
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator pos;
// locate the institution in the file global pool
- pos = institutionList.find(institution.id());
+ pos = institutionList.tqfind(institution.id());
if(pos != institutionList.end()) {
m_sql->modifyInstitution(institution);
} else
@@ -572,7 +572,7 @@ void MyMoneyDatabaseMgr::modifyInstitution(const MyMoneyInstitution& institution
*/
void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction)
{
- QMap<QString, bool> modifiedAccounts;
+ TQMap<TQString, bool> modifiedAccounts;
// perform some checks to see that the transaction stuff is OK. For
// now we assume that
@@ -588,7 +588,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
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
@@ -599,29 +599,29 @@ 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.contains(transaction.id()))
+// if(!m_transactionKeys.tqcontains(transaction.id()))
// throw new MYMONEYEXCEPTION("invalid transaction id");
-// QString oldKey = m_transactionKeys[transaction.id()];
- QMap <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')");
+// TQString oldKey = m_transactionKeys[transaction.id()];
+ TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')");
// if(transactionList.size() != 1)
// throw new MYMONEYEXCEPTION("invalid transaction key");
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
-// it_t = transactionList.find(oldKey);
+// it_t = transactionList.tqfind(oldKey);
it_t = transactionList.begin();
if(it_t == transactionList.end())
throw new MYMONEYEXCEPTION("invalid transaction key");
// mark all accounts referenced in old and new transaction data
// as modified
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) {
MyMoneyAccount acc = accountList[(*it_s).accountId()];
acc.adjustBalance((*it_s), true);
acc.touch();
-//FIXME: invalidateBalanceCache(acc.id());
+//FIXME: tqinvalidateBalanceCache(acc.id());
//m_accountList.modify(acc.id(), acc);
m_sql->modifyAccount(acc);
//modifiedAccounts[(*it_s).accountId()] = true;
@@ -630,7 +630,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
MyMoneyAccount acc = accountList[(*it_s).accountId()];
acc.adjustBalance((*it_s));
acc.touch();
-//FIXME: invalidateBalanceCache(acc.id());
+//FIXME: tqinvalidateBalanceCache(acc.id());
//m_accountList.modify(acc.id(), acc);
m_sql->modifyAccount(acc);
//modifiedAccounts[(*it_s).accountId()] = true;
@@ -640,7 +640,7 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
// m_sql->removeTransaction(oldKey);
// add new transaction to lists
- // QString newKey = transaction.uniqueSortKey();
+ // TQString newKey = transaction.uniqueSortKey();
// m_sql->insertTransaction(newKey, transaction);
//m_transactionKeys.modify(transaction.id(), newKey);
@@ -648,88 +648,88 @@ void MyMoneyDatabaseMgr::modifyTransaction(const MyMoneyTransaction& transaction
m_sql->modifyTransaction(transaction);
}
-void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent)
+void MyMoneyDatabaseMgr::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent)
{
- 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");
- QStringList accountIdList;
- QMap<QString, MyMoneyAccount>::ConstIterator oldParent;
- QMap<QString, MyMoneyAccount>::ConstIterator newParent;
- QMap<QString, MyMoneyAccount>::ConstIterator childAccount;
+ TQStringList accountIdList;
+ 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
- accountIdList << account.id() << parent.id();
+ accountIdList << account.id() << tqparent.id();
MyMoneyDatabaseMgr::account(account.id());
- MyMoneyDatabaseMgr::account(parent.id());
+ MyMoneyDatabaseMgr::account(tqparent.id());
- if(!account.parentAccountId().isEmpty()) {
- accountIdList << account.parentAccountId();
+ if(!account.tqparentAccountId().isEmpty()) {
+ accountIdList << account.tqparentAccountId();
}
startTransaction();
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
- if(!account.parentAccountId().isEmpty()) {
- MyMoneyDatabaseMgr::account(account.parentAccountId());
- oldParent = accountList.find(account.parentAccountId());
+ if(!account.tqparentAccountId().isEmpty()) {
+ MyMoneyDatabaseMgr::account(account.tqparentAccountId());
+ oldParent = accountList.tqfind(account.tqparentAccountId());
}
- newParent = accountList.find(parent.id());
- childAccount = accountList.find(account.id());
+ newParent = accountList.tqfind(tqparent.id());
+ childAccount = accountList.tqfind(account.id());
MyMoneyAccount acc;
- if(!account.parentAccountId().isEmpty()) {
+ if(!account.tqparentAccountId().isEmpty()) {
acc = (*oldParent);
acc.removeAccountId(account.id());
m_sql->modifyAccount(acc);
}
- parent = (*newParent);
- parent.addAccountId(account.id());
+ tqparent = (*newParent);
+ tqparent.addAccountId(account.id());
account = (*childAccount);
- account.setParentAccountId(parent.id());
+ account.setParentAccountId(tqparent.id());
- m_sql->modifyAccount(parent);
+ m_sql->modifyAccount(tqparent);
m_sql->modifyAccount(account);
commitTransaction();
}
void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction)
{
- QMap<QString, bool> modifiedAccounts;
+ TQMap<TQString, bool> modifiedAccounts;
// first perform all the checks
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");
- QMap <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(transaction.id()) + "')");
-// it_t = transactionList.find(*it_k);
+ TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + TQString(transaction.id()) + "')");
+// it_t = transactionList.tqfind(*it_k);
it_t = transactionList.begin();
if(it_t == 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
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts();
for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) {
MyMoneyAccount acc = accountList[(*it_s).accountId()];
// modifiedAccounts[(*it_s).accountId()] = true;
acc.adjustBalance((*it_s), true);
acc.touch();
m_sql->modifyAccount(acc);
-//FIXME: invalidateBalanceCache(acc.id());
+//FIXME: tqinvalidateBalanceCache(acc.id());
}
// FIXME: check if any split is frozen and throw exception
@@ -742,20 +742,20 @@ void MyMoneyDatabaseMgr::removeTransaction(const MyMoneyTransaction& transaction
m_sql->removeTransaction(transaction);
}
-unsigned int MyMoneyDatabaseMgr::transactionCount(const QString& account) const
+unsigned int MyMoneyDatabaseMgr::transactionCount(const TQString& account) const
{ return (m_sql->transactionCount(account)); }
-const QMap<QString, unsigned long> MyMoneyDatabaseMgr::transactionCountMap(void) const
+const TQMap<TQString, unsigned long> MyMoneyDatabaseMgr::transactionCountMap(void) const
{ return (m_sql->transactionCountMap()); }
-const QValueList<MyMoneyTransaction> MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const
+const TQValueList<MyMoneyTransaction> MyMoneyDatabaseMgr::transactionList(MyMoneyTransactionFilter& filter) const
{
- QValueList<MyMoneyTransaction> list;
+ TQValueList<MyMoneyTransaction> list;
transactionList(list, filter);
return list;
}
-void MyMoneyDatabaseMgr::transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyDatabaseMgr::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
@@ -764,22 +764,22 @@ void MyMoneyDatabaseMgr::transactionList(QValueList<MyMoneyTransaction>& list, M
PASS
}
-void MyMoneyDatabaseMgr::transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
+void MyMoneyDatabaseMgr::transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const
{
list.clear();
- MyMoneyMap<QString, MyMoneyTransaction> transactionList;
+ MyMoneyMap<TQString, MyMoneyTransaction> transactionList;
TRY
if (m_sql) transactionList = m_sql->fetchTransactions(filter);
PASS
- QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
- QMap<QString, MyMoneyTransaction>::ConstIterator txEnd = transactionList.end();
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t;
+ TQMap<TQString, MyMoneyTransaction>::ConstIterator txEnd = transactionList.end();
for(it_t = transactionList.begin(); it_t != txEnd; ++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));
}
}
}
@@ -787,12 +787,12 @@ void MyMoneyDatabaseMgr::transactionList(QValueList<QPair<MyMoneyTransaction, My
void MyMoneyDatabaseMgr::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
MyMoneyDatabaseMgr::account(account.id());
- parent = MyMoneyDatabaseMgr::account(account.parentAccountId());
+ tqparent = MyMoneyDatabaseMgr::account(account.tqparentAccountId());
// check that it's not one of the standard account groups
if(isStandardAccount(account.id()))
@@ -802,10 +802,10 @@ void MyMoneyDatabaseMgr::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) {
MyMoneyDatabaseMgr::account(*it);
}
@@ -813,23 +813,23 @@ void MyMoneyDatabaseMgr::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.
- QStringList accountIdList;
- accountIdList << parent.id() << account.id();
+ TQStringList accountIdList;
+ accountIdList << tqparent.id() << account.id();
startTransaction();
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(accountIdList, true);
- 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 = accountList.find(account.id());
+ it_a = accountList.tqfind(account.id());
if(it_a == accountList.end())
throw new MYMONEYEXCEPTION("Internal error: account not found in list");
- it_p = accountList.find(parent.id());
+ it_p = accountList.tqfind(tqparent.id());
if(it_p == 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");
@@ -842,25 +842,25 @@ void MyMoneyDatabaseMgr::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) {
for(it = (*it_a).accountList().begin(); it != (*it_a).accountList().end(); ++it) {
MyMoneyAccount acc(MyMoneyDatabaseMgr::account(*it));
- reparentAccount(acc, parent);//, false);
+ reparentAccount(acc, tqparent);//, false);
}
}
- // remove account from parent's list
- parent.removeAccountId(account.id());
- m_sql->modifyAccount(parent);
+ // remove account from tqparent's list
+ tqparent.removeAccountId(account.id());
+ m_sql->modifyAccount(tqparent);
// remove account from the global account pool
//m_accountList.remove(account.id());
// remove from balance list
//FIXME: m_balanceCache.remove(account.id());
-//FIXME: invalidateBalanceCache(parent.id());
+//FIXME: tqinvalidateBalanceCache(tqparent.id());
m_sql->removeAccount(account);
}
@@ -869,10 +869,10 @@ void MyMoneyDatabaseMgr::removeAccount(const MyMoneyAccount& account)
void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution)
{
- QMap<QString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(QString(institution.id()));
- QMap<QString, MyMoneyInstitution>::ConstIterator it_i;
+ TQMap<TQString, MyMoneyInstitution> institutionList = m_sql->fetchInstitutions(TQString(institution.id()));
+ TQMap<TQString, MyMoneyInstitution>::ConstIterator it_i;
- it_i = institutionList.find(institution.id());
+ it_i = institutionList.tqfind(institution.id());
if(it_i != institutionList.end()) {
// mark file as changed
m_sql->removeInstitution(institution);
@@ -880,31 +880,31 @@ void MyMoneyDatabaseMgr::removeInstitution(const MyMoneyInstitution& institution
throw new MYMONEYEXCEPTION("invalid institution");
}
-const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& id) const
+const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const TQString& id) const
{
// get the full key of this transaction, throw exception
// if it's invalid (unknown)
- //if(!m_transactionKeys.contains(id))
+ //if(!m_transactionKeys.tqcontains(id))
// throw new MYMONEYEXCEPTION("invalid transaction id");
// check if this key is in the list, throw exception if not
- //QString key = m_transactionKeys[id];
- QMap <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + QString(id) + "')");
+ //TQString key = m_transactionKeys[id];
+ TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions("('" + TQString(id) + "')");
//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.contains(key))
+ //if(!transactionList.tqcontains(key))
if(!transactionList.size())
throw new MYMONEYEXCEPTION("invalid transaction key");
return transactionList.begin().data();
}
-const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& date) const
+const MyMoneyMoney MyMoneyDatabaseMgr::balance(const TQString& id, const TQDate& date) const
{
- QStringList idList;
+ TQStringList idList;
idList.append(id);
- QMap<QString,MyMoneyMoney> tempMap = m_sql->fetchBalance(idList, date);
+ TQMap<TQString,MyMoneyMoney> tempMap = m_sql->fetchBalance(idList, date);
MyMoneyMoney returnValue = tempMap[id];
if (returnValue != MyMoneyMoney()) {
@@ -912,42 +912,42 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d
}
//DEBUG
- QDate date_ (date);
- //if (date_ == QDate()) date_ = QDate::currentDate();
+ TQDate date_ (date);
+ //if (date_ == TQDate()) date_ = TQDate::tqcurrentDate();
// END DEBUG
MyMoneyMoney result(0);
MyMoneyAccount acc;
- QMap<QString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*QString(id)*/);
- //QMap<QString, MyMoneyAccount>::const_iterator accpos = accountList.find(id);
- if (date_ != QDate()) qDebug ("request balance for %s at %s", id.data(), date_.toString(Qt::ISODate).latin1());
+ TQMap<TQString, MyMoneyAccount> accountList = m_sql->fetchAccounts(/*TQString(id)*/);
+ //TQMap<TQString, MyMoneyAccount>::const_iterator accpos = accountList.tqfind(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.find(id) != accountList.end())
+// if(accountList.tqfind(id) != accountList.end())
// return accountList[id].balance();
// return MyMoneyMoney(0);
// }
if(/*m_balanceCache[id].valid == false || date != m_balanceCacheDate) || */ m_sql != 0) {
- QMap<QString, MyMoneyMoney> balances;
- QMap<QString, MyMoneyMoney>::ConstIterator it_b;
+ TQMap<TQString, MyMoneyMoney> balances;
+ TQMap<TQString, MyMoneyMoney>::ConstIterator it_b;
//FIXME: if (date != m_balanceCacheDate) {
//FIXME: m_balanceCache.clear();
//FIXME: m_balanceCacheDate = date;
//FIXME: }
- QValueList<MyMoneyTransaction>::ConstIterator it_t;
- QValueList<MyMoneyTransaction>::ConstIterator txEnd;
- QValueList<MyMoneySplit>::ConstIterator it_s;
+ TQValueList<MyMoneyTransaction>::ConstIterator it_t;
+ TQValueList<MyMoneyTransaction>::ConstIterator txEnd;
+ TQValueList<MyMoneySplit>::ConstIterator it_s;
MyMoneyTransactionFilter filter;
filter.addAccount(id);
- filter.setDateFilter(QDate(), date_);
+ filter.setDateFilter(TQDate(), date_);
filter.setReportAllSplits(false);
- QValueList<MyMoneyTransaction> list = transactionList(filter);
+ TQValueList<MyMoneyTransaction> list = transactionList(filter);
txEnd = list.end();
for(it_t = list.begin(); it_t != txEnd; ++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 {
@@ -964,7 +964,7 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d
// fill all accounts w/o transactions to zero
// if (m_sql != 0) {
-// 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) {
//FIXME: if(m_balanceCache[(*it_a).id()].valid == false) {
//FIXME: MyMoneyBalanceCacheItem balance(MyMoneyMoney(0,1));
@@ -985,13 +985,13 @@ const MyMoneyMoney MyMoneyDatabaseMgr::balance(const QString& id, const QDate& d
return result;
}
-const MyMoneyTransaction MyMoneyDatabaseMgr::transaction(const QString& account, const int idx) const
+const MyMoneyTransaction MyMoneyDatabaseMgr::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");
@@ -1003,9 +1003,9 @@ const MyMoneyTransaction MyMoneyDatabaseMgr::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];
- MyMoneyAccount acc = m_sql->fetchAccounts(QString(account)) [account];
+ MyMoneyAccount acc = m_sql->fetchAccounts(TQString(account)) [account];
MyMoneyTransactionFilter filter;
if(acc.accountGroup() == MyMoneyAccount::Income
@@ -1026,12 +1026,12 @@ unsigned int MyMoneyDatabaseMgr::institutionCount(void) const
return m_sql->getRecCount("kmmInstitutions");
}
-void MyMoneyDatabaseMgr::accountList(QValueList<MyMoneyAccount>& list) const
+void MyMoneyDatabaseMgr::accountList(TQValueList<MyMoneyAccount>& list) const
{
- QMap <QString, MyMoneyAccount> accountList;
+ TQMap <TQString, MyMoneyAccount> accountList;
if (m_sql) accountList = m_sql->fetchAccounts();
- QMap<QString, MyMoneyAccount>::ConstIterator it;
- QMap<QString, MyMoneyAccount>::ConstIterator accEnd = accountList.end();
+ TQMap<TQString, MyMoneyAccount>::ConstIterator it;
+ TQMap<TQString, MyMoneyAccount>::ConstIterator accEnd = accountList.end();
for(it = accountList.begin(); it != accEnd; ++it) {
if(!isStandardAccount((*it).id())) {
list.append(*it);
@@ -1052,7 +1052,7 @@ const MyMoneyAccount MyMoneyDatabaseMgr::income(void) const
{ return MyMoneyFile::instance()->account(STD_ACC_INCOME); }
const MyMoneyAccount MyMoneyDatabaseMgr::equity(void) const
-{ return MyMoneyFile::instance()->account(STD_ACC_EQUITY); }
+{ return MyMoneyFile::instance()->account(STD_ACC_ETQUITY); }
void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security)
{
@@ -1065,13 +1065,13 @@ void MyMoneyDatabaseMgr::addSecurity(MyMoneySecurity& security)
void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security)
{
- QMap<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(security.id()), true);
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(security.id()), true);
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = securitiesList.find(security.id());
+ it = securitiesList.tqfind(security.id());
if(it == securitiesList.end())
{
- QString msg = "Unknown security '";
+ TQString msg = "Unknown security '";
msg += security.id() + "' during modifySecurity()";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1081,15 +1081,15 @@ void MyMoneyDatabaseMgr::modifySecurity(const MyMoneySecurity& security)
void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security)
{
- QMap<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(security.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(security.id()));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
// FIXME: check referential integrity
- it = securitiesList.find(security.id());
+ it = securitiesList.tqfind(security.id());
if(it == securitiesList.end())
{
- QString msg = "Unknown security '";
+ TQString msg = "Unknown security '";
msg += security.id() + "' during removeSecurity()";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1097,10 +1097,10 @@ void MyMoneyDatabaseMgr::removeSecurity(const MyMoneySecurity& security)
m_sql->removeSecurity(security);
}
-const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const
+const MyMoneySecurity MyMoneyDatabaseMgr::security(const TQString& id) const
{
- QMap<QString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(QString(id));
- QMap<QString, MyMoneySecurity>::ConstIterator it = securitiesList.find(id);
+ TQMap<TQString, MyMoneySecurity> securitiesList = m_sql->fetchSecurities(TQString(id));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it = securitiesList.tqfind(id);
if(it != securitiesList.end())
{
return it.data();
@@ -1109,15 +1109,15 @@ const MyMoneySecurity MyMoneyDatabaseMgr::security(const QString& id) const
return MyMoneySecurity();
}
-const QValueList<MyMoneySecurity> MyMoneyDatabaseMgr::securityList(void) const
+const TQValueList<MyMoneySecurity> MyMoneyDatabaseMgr::securityList(void) const
{ return m_sql->fetchSecurities().values(); }
void MyMoneyDatabaseMgr::addPrice(const MyMoneyPrice& price)
{
MyMoneyPriceEntries::ConstIterator it;
MyMoneyPriceList priceList = m_sql->fetchPrices();
- it = priceList[MyMoneySecurityPair(price.from(), price.to())].find(price.date());
- // do not replace, if the information did not change.
+ it = priceList[MyMoneySecurityPair(price.from(), price.to())].tqfind(price.date());
+ // do not tqreplace, 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())
@@ -1132,7 +1132,7 @@ void MyMoneyDatabaseMgr::removePrice(const MyMoneyPrice& price)
m_sql->removePrice(price);
}
-const MyMoneyPrice MyMoneyDatabaseMgr::price(const QString& fromId, const QString& toId, const QDate& _date, const bool exactDate) const
+const MyMoneyPrice MyMoneyDatabaseMgr::price(const TQString& fromId, const TQString& toId, const TQDate& _date, const bool exactDate) const
{
return m_sql->fetchSinglePrice(fromId, toId, _date, exactDate);
}
@@ -1160,12 +1160,12 @@ void MyMoneyDatabaseMgr::addSchedule(MyMoneySchedule& sched)
void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched)
{
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(sched.id()));
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = scheduleList.find(sched.id());
+ it = scheduleList.tqfind(sched.id());
if(it == scheduleList.end()) {
- QString msg = "Unknown schedule '" + sched.id() + "'";
+ TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1174,12 +1174,12 @@ void MyMoneyDatabaseMgr::modifySchedule(const MyMoneySchedule& sched)
void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched)
{
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(sched.id()));
- QMap<QString, MyMoneySchedule>::ConstIterator it;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(sched.id()));
+ TQMap<TQString, MyMoneySchedule>::ConstIterator it;
- it = scheduleList.find(sched.id());
+ it = scheduleList.tqfind(sched.id());
if(it == scheduleList.end()) {
- QString msg = "Unknown schedule '" + sched.id() + "'";
+ TQString msg = "Unknown schedule '" + sched.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1188,33 +1188,33 @@ void MyMoneyDatabaseMgr::removeSchedule(const MyMoneySchedule& sched)
m_sql->removeSchedule(sched);
}
-const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const QString& id) const
+const MyMoneySchedule MyMoneyDatabaseMgr::schedule(const TQString& id) const
{
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(QString(id));
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules(TQString(id));
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
// locate the schedule and if present, return it's data
- pos = scheduleList.find(id);
+ pos = scheduleList.tqfind(id);
if(pos != 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> MyMoneyDatabaseMgr::scheduleList(const QString& accountId,
+const TQValueList<MyMoneySchedule> MyMoneyDatabaseMgr::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> scheduleList;
+ TQMap<TQString, MyMoneySchedule> scheduleList;
if (m_sql) scheduleList = m_sql->fetchSchedules();
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
// qDebug("scheduleList()");
@@ -1241,8 +1241,8 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString
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)
@@ -1275,10 +1275,10 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString
if (!(*pos).isOverdue())
continue;
/*
- QDate nextPayment = (*pos).nextPayment((*pos).lastPayment());
+ TQDate nextPayment = (*pos).nextPayment((*pos).lastPayment());
if(!nextPayment.isValid())
continue;
- if(nextPayment >= QDate::currentDate())
+ if(nextPayment >= TQDate::tqcurrentDate())
continue;
*/
}
@@ -1289,16 +1289,16 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleList(const QString
return list;
}
-const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes,
+const TQValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int scheduleTypes,
int scheduleOcurrences,
int schedulePaymentTypes,
- QDate startDate,
- const QStringList& accounts) const
+ TQDate startDate,
+ const TQStringList& accounts) const
{
// qDebug("scheduleListEx");
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
- QMap<QString, MyMoneySchedule>::ConstIterator pos;
- QValueList<MyMoneySchedule> list;
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
+ TQMap<TQString, MyMoneySchedule>::ConstIterator pos;
+ TQValueList<MyMoneySchedule> list;
if (!startDate.isValid())
return list;
@@ -1325,7 +1325,7 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int schedu
if (accounts.count() > 0)
{
- if (accounts.contains((*pos).account().id()))
+ if (accounts.tqcontains((*pos).account().id()))
continue;
}
@@ -1339,12 +1339,12 @@ const QValueList<MyMoneySchedule> MyMoneyDatabaseMgr::scheduleListEx( int schedu
void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency)
{
if (m_sql) {
- QMap<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.find(currency.id());
+ it = currencyList.tqfind(currency.id());
if(it != 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_sql->addCurrency(currency);
@@ -1353,12 +1353,12 @@ void MyMoneyDatabaseMgr::addCurrency(const MyMoneySecurity& currency)
void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.find(currency.id());
+ it = currencyList.tqfind(currency.id());
if(it == 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_sql->modifyCurrency(currency);
@@ -1366,50 +1366,50 @@ void MyMoneyDatabaseMgr::modifyCurrency(const MyMoneySecurity& currency)
void MyMoneyDatabaseMgr::removeCurrency(const MyMoneySecurity& currency)
{
- QMap<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(currency.id()));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(currency.id()));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
// FIXME: check referential integrity
- it = currencyList.find(currency.id());
+ it = currencyList.tqfind(currency.id());
if(it == 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_sql->removeCurrency(currency);
}
-const MyMoneySecurity MyMoneyDatabaseMgr::currency(const QString& id) const
+const MyMoneySecurity MyMoneyDatabaseMgr::currency(const TQString& id) const
{
if(id.isEmpty()) {
}
- QMap<QString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(QString(id));
- QMap<QString, MyMoneySecurity>::ConstIterator it;
+ TQMap<TQString, MyMoneySecurity> currencyList = m_sql->fetchCurrencies(TQString(id));
+ TQMap<TQString, MyMoneySecurity>::ConstIterator it;
- it = currencyList.find(id);
+ it = currencyList.tqfind(id);
if(it == 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> MyMoneyDatabaseMgr::currencyList(void) const
+const TQValueList<MyMoneySecurity> MyMoneyDatabaseMgr::currencyList(void) const
{
if (m_sql) {
return m_sql->fetchCurrencies().values();
} else {
- return QValueList<MyMoneySecurity> ();
+ return TQValueList<MyMoneySecurity> ();
}
}
-const QValueList<MyMoneyReport> MyMoneyDatabaseMgr::reportList( void ) const
+const TQValueList<MyMoneyReport> MyMoneyDatabaseMgr::reportList( void ) const
{
if (m_sql) {
return m_sql->fetchReports().values();
} else {
- return QValueList<MyMoneyReport> ();
+ return TQValueList<MyMoneyReport> ();
}
}
@@ -1426,12 +1426,12 @@ void MyMoneyDatabaseMgr::addReport( MyMoneyReport& report )
void MyMoneyDatabaseMgr::modifyReport( const MyMoneyReport& report )
{
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports(QString(report.id()));
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
+ TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = reportList.find(report.id());
+ it = reportList.tqfind(report.id());
if(it == reportList.end()) {
- QString msg = "Unknown report '" + report.id() + "'";
+ TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
@@ -1443,26 +1443,26 @@ unsigned MyMoneyDatabaseMgr::countReports( void ) const
return m_sql->getRecCount("kmmReports");
}
-const MyMoneyReport MyMoneyDatabaseMgr::report( const QString& id ) const
+const MyMoneyReport MyMoneyDatabaseMgr::report( const TQString& id ) const
{
- return m_sql->fetchReports(QString(id))[id];
+ return m_sql->fetchReports(TQString(id))[id];
}
void MyMoneyDatabaseMgr::removeReport(const MyMoneyReport& report)
{
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports(QString(report.id()));
- QMap<QString, MyMoneyReport>::ConstIterator it;
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports(TQString(report.id()));
+ TQMap<TQString, MyMoneyReport>::ConstIterator it;
- it = reportList.find(report.id());
+ it = reportList.tqfind(report.id());
if(it == reportList.end()) {
- QString msg = "Unknown report '" + report.id() + "'";
+ TQString msg = "Unknown report '" + report.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_sql->removeReport(report);
}
-const QValueList<MyMoneyBudget> MyMoneyDatabaseMgr::budgetList( void ) const
+const TQValueList<MyMoneyBudget> MyMoneyDatabaseMgr::budgetList( void ) const
{
return m_sql->fetchBudgets().values();
}
@@ -1473,10 +1473,10 @@ void MyMoneyDatabaseMgr::addBudget( MyMoneyBudget& budget )
m_sql->addBudget(newBudget);
}
-const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) const
+const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const TQString& budget) const
{
- QMap<QString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
- QMap<QString, MyMoneyBudget>::ConstIterator it_p;
+ TQMap<TQString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget>::ConstIterator it_p;
for(it_p = budgets.begin(); it_p != budgets.end(); ++it_p) {
if((*it_p).name() == budget) {
@@ -1489,18 +1489,18 @@ const MyMoneyBudget MyMoneyDatabaseMgr::budgetByName(const QString& budget) cons
void MyMoneyDatabaseMgr::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);
startTransaction();
- if (m_sql->fetchBudgets(QString(budget.id()), true).empty()) {
- QString msg = "Unknown budget '" + budget.id() + "'";
+ if (m_sql->fetchBudgets(TQString(budget.id()), true).empty()) {
+ TQString msg = "Unknown budget '" + budget.id() + "'";
throw new MYMONEYEXCEPTION(msg);
}
m_sql->modifyBudget(budget);
@@ -1512,18 +1512,18 @@ unsigned MyMoneyDatabaseMgr::countBudgets( void ) const
return m_sql->getRecCount("kmmBudgetConfig");
}
-MyMoneyBudget MyMoneyDatabaseMgr::budget( const QString& id ) const
+MyMoneyBudget MyMoneyDatabaseMgr::budget( const TQString& id ) const
{
- return m_sql->fetchBudgets(QString(id)) [id];
+ return m_sql->fetchBudgets(TQString(id)) [id];
}
void MyMoneyDatabaseMgr::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);
// }
//
@@ -1537,7 +1537,7 @@ void MyMoneyDatabaseMgr::clearCache(void)
class isReferencedHelper {
public:
- isReferencedHelper(const QString& id)
+ isReferencedHelper(const TQString& id)
: m_id (id)
{}
@@ -1545,13 +1545,13 @@ class isReferencedHelper {
{ return obj.hasReferenceTo(m_id); }
private:
- QString m_id;
+ TQString m_id;
};
bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArray& skipCheck) const
{
bool rc = false;
- const QString& id = obj.id();
+ const TQString& id = obj.id();
MyMoneyPriceList::const_iterator it_pr;
@@ -1578,7 +1578,7 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil
skipTransactions = true;
}
if (! skipTransactions) {
- //QMap <QString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
+ //TQMap <TQString, MyMoneyTransaction> transactionList = m_sql->fetchTransactions(f);
//rc = (transactionList.end() != std::find_if(transactionList.begin(), transactionList.end(), isReferencedHelper(id)));
//if (rc != m_sql->isReferencedByTransaction(obj.id()))
// qDebug ("Transaction match inconsistency.");
@@ -1587,40 +1587,40 @@ bool MyMoneyDatabaseMgr::isReferenced(const MyMoneyObject& obj, const MyMoneyFil
}
if(!skipCheck[RefCheckAccount] && !rc) {
- QValueList<MyMoneyAccount> accountList;
+ TQValueList<MyMoneyAccount> accountList;
MyMoneyFile::instance()->accountList(accountList);
rc = (accountList.end() != std::find_if(accountList.begin(), accountList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckInstitution] && !rc) {
- QValueList<MyMoneyInstitution> institutionList;
+ TQValueList<MyMoneyInstitution> institutionList;
MyMoneyFile::instance()->institutionList(institutionList);
rc = (institutionList.end() != std::find_if(institutionList.begin(), institutionList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckPayee] && !rc) {
- QValueList<MyMoneyPayee> payeeList = MyMoneyFile::instance()->payeeList();
+ TQValueList<MyMoneyPayee> payeeList = MyMoneyFile::instance()->payeeList();
rc = (payeeList.end() != std::find_if(payeeList.begin(), payeeList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckReport] && !rc) {
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports();
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports();
rc = (reportList.end() != std::find_if(reportList.begin(), reportList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckBudget] && !rc) {
- QMap<QString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget> budgets = m_sql->fetchBudgets();
rc = (budgets.end() != std::find_if(budgets.begin(), budgets.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckSchedule] && !rc) {
- QMap<QString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
+ TQMap<TQString, MyMoneySchedule> scheduleList = m_sql->fetchSchedules();
rc = (scheduleList.end() != std::find_if(scheduleList.begin(), scheduleList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckSecurity] && !rc) {
- QValueList<MyMoneySecurity> securitiesList = MyMoneyFile::instance()->securityList();
+ TQValueList<MyMoneySecurity> securitiesList = MyMoneyFile::instance()->securityList();
rc = (securitiesList.end() != std::find_if(securitiesList.begin(), securitiesList.end(), isReferencedHelper(id)));
}
if(!skipCheck[RefCheckCurrency] && !rc) {
- QValueList<MyMoneySecurity> currencyList = m_sql->fetchCurrencies().values();
+ TQValueList<MyMoneySecurity> currencyList = m_sql->fetchCurrencies().values();
rc = (currencyList.end() != std::find_if(currencyList.begin(), currencyList.end(), isReferencedHelper(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] && !rc) {
@@ -1653,7 +1653,7 @@ bool MyMoneyDatabaseMgr::commitTransaction(void)
void MyMoneyDatabaseMgr::rollbackTransaction(void)
{ if (m_sql) m_sql->cancelCommitUnit ("databasetransaction"); }
-void MyMoneyDatabaseMgr::setCreationDate(const QDate& val)
+void MyMoneyDatabaseMgr::setCreationDate(const TQDate& val)
{ m_creationDate = val; }
KSharedPtr <MyMoneyStorageSql> MyMoneyDatabaseMgr::connectToDatabase(const KURL& url) {
@@ -1664,17 +1664,17 @@ KSharedPtr <MyMoneyStorageSql> MyMoneyDatabaseMgr::connectToDatabase(const KURL&
void MyMoneyDatabaseMgr::fillStorage()
{ m_sql->fillStorage(); }
-void MyMoneyDatabaseMgr::setLastModificationDate(const QDate& val)
+void MyMoneyDatabaseMgr::setLastModificationDate(const TQDate& val)
{ m_lastModificationDate = val; }
-bool MyMoneyDatabaseMgr::isDuplicateTransaction(const QString& /*id*/) const
+bool MyMoneyDatabaseMgr::isDuplicateTransaction(const TQString& /*id*/) const
{
//FIXME: figure out the real id from the key and check the DB.
-//return m_transactionKeys.contains(id);
+//return m_transactionKeys.tqcontains(id);
return false;
}
-void MyMoneyDatabaseMgr::loadAccounts(const QMap<QString, MyMoneyAccount>& /*map*/)
+void MyMoneyDatabaseMgr::loadAccounts(const TQMap<TQString, MyMoneyAccount>& /*map*/)
{
// m_accountList = map;
//FIXME: update the database.
@@ -1686,50 +1686,50 @@ void MyMoneyDatabaseMgr::loadAccounts(const QMap<QString, MyMoneyAccount>& /*map
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadTransactions(const QMap<QString, MyMoneyTransaction>& /*map*/)
+void MyMoneyDatabaseMgr::loadTransactions(const TQMap<TQString, MyMoneyTransaction>& /*map*/)
{
// m_transactionList = map;
//FIXME: update the database.
// // now fill the key map
-// QMap<QString, QString> keys;
-// QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+// 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();
// }
// m_transactionKeys = keys;
}
-void MyMoneyDatabaseMgr::loadInstitutions(const QMap<QString, MyMoneyInstitution>& /*map*/)
+void MyMoneyDatabaseMgr::loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& /*map*/)
{
// m_institutionList = map;
//FIXME: update the database.
// // now fill the key map
-// QMap<QString, QString> keys;
-// QMap<QString, MyMoneyTransaction>::ConstIterator it_t;
+// 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();
// }
// m_transactionKeys = keys;
}
-void MyMoneyDatabaseMgr::loadPayees(const QMap<QString, MyMoneyPayee>& /*map*/)
+void MyMoneyDatabaseMgr::loadPayees(const TQMap<TQString, MyMoneyPayee>& /*map*/)
{
// m_payeeList = map;
}
-void MyMoneyDatabaseMgr::loadSchedules(const QMap<QString, MyMoneySchedule>& /*map*/)
+void MyMoneyDatabaseMgr::loadSchedules(const TQMap<TQString, MyMoneySchedule>& /*map*/)
{
// m_scheduleList = map;
}
-void MyMoneyDatabaseMgr::loadSecurities(const QMap<QString, MyMoneySecurity>& /*map*/)
+void MyMoneyDatabaseMgr::loadSecurities(const TQMap<TQString, MyMoneySecurity>& /*map*/)
{
// m_securitiesList = map;
}
-void MyMoneyDatabaseMgr::loadCurrencies(const QMap<QString, MyMoneySecurity>& /*map*/)
+void MyMoneyDatabaseMgr::loadCurrencies(const TQMap<TQString, MyMoneySecurity>& /*map*/)
{
// m_currencyList = map;
//FIXME: update the database.
@@ -1741,7 +1741,7 @@ void MyMoneyDatabaseMgr::loadCurrencies(const QMap<QString, MyMoneySecurity>& /*
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadReports( const QMap<QString, MyMoneyReport>& /*reports*/ )
+void MyMoneyDatabaseMgr::loadReports( const TQMap<TQString, MyMoneyReport>& /*reports*/ )
{
// m_reportList = reports;
//FIXME: update the database.
@@ -1753,7 +1753,7 @@ void MyMoneyDatabaseMgr::loadReports( const QMap<QString, MyMoneyReport>& /*repo
// on error, rollbackTransaction
}
-void MyMoneyDatabaseMgr::loadBudgets( const QMap<QString, MyMoneyBudget>& /*budgets*/ )
+void MyMoneyDatabaseMgr::loadBudgets( const TQMap<TQString, MyMoneyBudget>& /*budgets*/ )
{
// m_budgetList = budgets;
//FIXME: update the database.
@@ -1837,29 +1837,29 @@ void MyMoneyDatabaseMgr::loadBudgetId(const unsigned long id)
void MyMoneyDatabaseMgr::rebuildAccountBalances(void)
{
startTransaction();
- QMap<QString, MyMoneyAccount> accountMap = m_sql->fetchAccounts(QStringList(), true);
+ TQMap<TQString, MyMoneyAccount> accountMap = m_sql->fetchAccounts(TQStringList(), true);
- QMap<QString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accountMap.keys(), QDate());
+ TQMap<TQString, MyMoneyMoney> balanceMap = m_sql->fetchBalance(accountMap.keys(), TQDate());
- for (QMap<QString, MyMoneyMoney>::const_iterator it_b = balanceMap.begin();
+ for (TQMap<TQString, MyMoneyMoney>::const_iterator it_b = balanceMap.begin();
it_b != balanceMap.end(); ++it_b) {
accountMap[it_b.key()].setBalance(it_b.data());
}
- for (QMap<QString, MyMoneyAccount>::const_iterator it_a = accountMap.begin();
+ for (TQMap<TQString, MyMoneyAccount>::const_iterator it_a = accountMap.begin();
it_a != accountMap.end(); ++it_a) {
m_sql->modifyAccount(it_a.data());
}
commitTransaction();
}
-void MyMoneyDatabaseMgr::removeReferences(const QString& id)
+void MyMoneyDatabaseMgr::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
- QMap<QString, MyMoneyReport> reportList = m_sql->fetchReports();
+ TQMap<TQString, MyMoneyReport> reportList = m_sql->fetchReports();
for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) {
MyMoneyReport r = *it_r;
r.removeReference(id);
@@ -1867,7 +1867,7 @@ void MyMoneyDatabaseMgr::removeReferences(const QString& id)
}
// remove from budgets
- QMap<QString, MyMoneyBudget> budgetList = m_sql->fetchBudgets();
+ TQMap<TQString, MyMoneyBudget> budgetList = m_sql->fetchBudgets();
for(it_b = budgetList.begin(); it_b != budgetList.end(); ++it_b) {
MyMoneyBudget b = *it_b;
b.removeReference(id);