diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /kmymoney2/mymoney | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip |
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmymoney2/mymoney')
88 files changed, 5156 insertions, 5162 deletions
diff --git a/kmymoney2/mymoney/mymoneyaccount.cpp b/kmymoney2/mymoney/mymoneyaccount.cpp index 8c304cd..d0d98d1 100644 --- a/kmymoney2/mymoney/mymoneyaccount.cpp +++ b/kmymoney2/mymoney/mymoneyaccount.cpp @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qregexp.h> +#include <tqregexp.h> #include <kstandarddirs.h> #include <kiconloader.h> @@ -45,14 +45,14 @@ MyMoneyAccount::~MyMoneyAccount() { } -MyMoneyAccount::MyMoneyAccount(const QString& id, const MyMoneyAccount& right) : +MyMoneyAccount::MyMoneyAccount(const TQString& id, const MyMoneyAccount& right) : MyMoneyObject(id) { *this = right; setId(id); } -MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : +MyMoneyAccount::MyMoneyAccount(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()), m_fraction(-1) @@ -64,9 +64,9 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : // qDebug("Reading information for account %s", acc.name().data()); - setParentAccountId(QStringEmpty(node.attribute("parentaccount"))); - setLastModified(stringToDate(QStringEmpty(node.attribute("lastmodified")))); - setLastReconciliationDate(stringToDate(QStringEmpty(node.attribute("lastreconciled")))); + setParentAccountId(TQStringEmpty(node.attribute("tqparentaccount"))); + setLastModified(stringToDate(TQStringEmpty(node.attribute("lastmodified")))); + setLastReconciliationDate(stringToDate(TQStringEmpty(node.attribute("lastreconciled")))); if(!m_lastReconciliationDate.isValid()) { // for some reason, I was unable to access our own kvp at this point through @@ -76,18 +76,18 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : // // Since we want to get rid of the lastStatementDate record anyway, this seems // to be ok for now. (ipwizard - 2008-08-14) - QString txt = MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()).value("lastStatementDate"); + TQString txt = MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()).value("lastStatementDate"); if(!txt.isEmpty()) { - setLastReconciliationDate(QDate::fromString(txt, Qt::ISODate)); + setLastReconciliationDate(TQDate::fromString(txt, Qt::ISODate)); } } - setInstitutionId(QStringEmpty(node.attribute("institution"))); - setNumber(QStringEmpty(node.attribute("number"))); - setOpeningDate(stringToDate(QStringEmpty(node.attribute("opened")))); - setCurrencyId(QStringEmpty(node.attribute("currency"))); + setInstitutionId(TQStringEmpty(node.attribute("institution"))); + setNumber(TQStringEmpty(node.attribute("number"))); + setOpeningDate(stringToDate(TQStringEmpty(node.attribute("opened")))); + setCurrencyId(TQStringEmpty(node.attribute("currency"))); - QString tmp = QStringEmpty(node.attribute("type")); + TQString tmp = TQStringEmpty(node.attribute("type")); bool bOK = false; int type = tmp.toInt(&bOK); if(bOK) { @@ -98,67 +98,67 @@ MyMoneyAccount::MyMoneyAccount(const QDomElement& node) : if(node.hasAttribute("openingbalance")) { if(!MyMoneyMoney(node.attribute("openingbalance")).isZero()) { - QString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").arg(m_name); + TQString msg = i18n("Account %1 contains an opening balance. Please use a KMyMoney version >= 0.8 and < 0.9 to correct the problem.").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } } setDescription(node.attribute("description")); - m_id = QStringEmpty(node.attribute("id")); - // qDebug("Account %s has id of %s, type of %d, parent is %s.", acc.name().data(), id.data(), type, acc.parentAccountId().data()); + m_id = TQStringEmpty(node.attribute("id")); + // qDebug("Account %s has id of %s, type of %d, tqparent is %s.", acc.name().data(), id.data(), type, acc.tqparentAccountId().data()); // Process any Sub-Account information found inside the account entry. m_accountList.clear(); - QDomNodeList nodeList = node.elementsByTagName("SUBACCOUNTS"); + TQDomNodeList nodeList = node.elementsByTagName("SUBACCOUNTS"); if(nodeList.count() > 0) { nodeList = nodeList.item(0).toElement().elementsByTagName("SUBACCOUNT"); for(unsigned int i = 0; i < nodeList.count(); ++i) { - addAccountId(QString(nodeList.item(i).toElement().attribute("id"))); + addAccountId(TQString(nodeList.item(i).toElement().attribute("id"))); } } nodeList = node.elementsByTagName("ONLINEBANKING"); if(nodeList.count() > 0) { - QDomNamedNodeMap attributes = nodeList.item(0).toElement().attributes(); + TQDomNamedNodeMap attributes = nodeList.item(0).toElement().attributes(); for(unsigned int i = 0; i < attributes.count(); ++i) { - const QDomAttr& it_attr = attributes.item(i).toAttr(); + const TQDomAttr& it_attr = attributes.item(i).toAttr(); m_onlineBankingSettings.setValue(it_attr.name().utf8(), it_attr.value()); } } } -void MyMoneyAccount::setName(const QString& name) +void MyMoneyAccount::setName(const TQString& name) { m_name = name; } -void MyMoneyAccount::setNumber(const QString& number) +void MyMoneyAccount::setNumber(const TQString& number) { m_number = number; } -void MyMoneyAccount::setDescription(const QString& desc) +void MyMoneyAccount::setDescription(const TQString& desc) { m_description = desc; } -void MyMoneyAccount::setInstitutionId(const QString& id) +void MyMoneyAccount::setInstitutionId(const TQString& id) { m_institution = id; } -void MyMoneyAccount::setLastModified(const QDate& date) +void MyMoneyAccount::setLastModified(const TQDate& date) { m_lastModified = date; } -void MyMoneyAccount::setOpeningDate(const QDate& date) +void MyMoneyAccount::setOpeningDate(const TQDate& date) { m_openingDate = date; } -void MyMoneyAccount::setLastReconciliationDate(const QDate& date) +void MyMoneyAccount::setLastReconciliationDate(const TQDate& date) { // FIXME: for a limited time (maybe until we delivered 1.0) we // keep the last reconciliation date also in the KVP for backward @@ -168,9 +168,9 @@ void MyMoneyAccount::setLastReconciliationDate(const QDate& date) m_lastReconciliationDate = date; } -void MyMoneyAccount::setParentAccountId(const QString& parent) +void MyMoneyAccount::setParentAccountId(const TQString& tqparent) { - m_parentAccount = parent; + m_parentAccount = tqparent; } void MyMoneyAccount::setAccountType(const accountTypeE type) @@ -178,9 +178,9 @@ void MyMoneyAccount::setAccountType(const accountTypeE type) m_accountType = type; } -void MyMoneyAccount::addAccountId(const QString& account) +void MyMoneyAccount::addAccountId(const TQString& account) { - if(!m_accountList.contains(account)) + if(!m_accountList.tqcontains(account)) m_accountList += account; } @@ -189,11 +189,11 @@ void MyMoneyAccount::removeAccountIds(void) m_accountList.clear(); } -void MyMoneyAccount::removeAccountId(const QString& account) +void MyMoneyAccount::removeAccountId(const TQString& account) { - QStringList::Iterator it; + TQStringList::Iterator it; - it = m_accountList.find(account); + it = m_accountList.tqfind(account); if(it != m_accountList.end()) m_accountList.remove(it); } @@ -243,7 +243,7 @@ MyMoneyAccount::accountTypeE MyMoneyAccount::accountGroup(void) const return accountGroup(m_accountType); } -void MyMoneyAccount::setCurrencyId(const QString& id) +void MyMoneyAccount::setCurrencyId(const TQString& id) { m_currencyId = id; } @@ -284,20 +284,20 @@ void MyMoneyAccountLoan::setLoanAmount(const MyMoneyMoney& amount) setValue("loan-amount", amount.toString()); } -const MyMoneyMoney MyMoneyAccountLoan::interestRate(const QDate& date) const +const MyMoneyMoney MyMoneyAccountLoan::interestRate(const TQDate& date) const { MyMoneyMoney rate; - QString key; - QString val; + TQString key; + TQString val; if(!date.isValid()) return rate; key.sprintf("ir-%04d-%02d-%02d", date.year(), date.month(), date.day()); - QRegExp regExp("ir-(\\d{4})-(\\d{2})-(\\d{2})"); + TQRegExp regExp("ir-(\\d{4})-(\\d{2})-(\\d{2})"); - QMap<QString, QString>::ConstIterator it; + TQMap<TQString, TQString>::ConstIterator it; for(it = pairs().begin(); it != pairs().end(); ++it) { if(regExp.search(it.key()) > -1) { @@ -317,19 +317,19 @@ const MyMoneyMoney MyMoneyAccountLoan::interestRate(const QDate& date) const return rate; } -void MyMoneyAccountLoan::setInterestRate(const QDate& date, const MyMoneyMoney& value) +void MyMoneyAccountLoan::setInterestRate(const TQDate& date, const MyMoneyMoney& value) { if(!date.isValid()) return; - QString key; + TQString key; key.sprintf("ir-%04d-%02d-%02d", date.year(), date.month(), date.day()); setValue(key, value.toString()); } MyMoneyAccountLoan::interestDueE MyMoneyAccountLoan::interestCalculation(void) const { - QString payTime(value("interest-calculation")); + TQString payTime(value("interest-calculation")); if(payTime == "paymentDue") return paymentDue; return paymentReceived; @@ -343,18 +343,18 @@ void MyMoneyAccountLoan::setInterestCalculation(const MyMoneyAccountLoan::intere setValue("interest-calculation", "paymentReceived"); } -const QDate MyMoneyAccountLoan::nextInterestChange(void) const +const TQDate MyMoneyAccountLoan::nextInterestChange(void) const { - QDate rc; + TQDate rc; - QRegExp regExp("(\\d{4})-(\\d{2})-(\\d{2})"); + TQRegExp regExp("(\\d{4})-(\\d{2})-(\\d{2})"); if(regExp.search(value("interest-nextchange")) != -1) { rc.setYMD(regExp.cap(1).toInt(), regExp.cap(2).toInt(), regExp.cap(3).toInt()); } return rc; } -void MyMoneyAccountLoan::setNextInterestChange(const QDate& date) +void MyMoneyAccountLoan::setNextInterestChange(const TQDate& date) { setValue("interest-nextchange", date.toString(Qt::ISODate)); } @@ -366,7 +366,7 @@ int MyMoneyAccountLoan::interestChangeFrequency(int* unit) const if(unit) *unit = 1; - QRegExp regExp("(\\d+)/(\\d{1})"); + TQRegExp regExp("(\\d+)/(\\d{1})"); if(regExp.search(value("interest-changefrequency")) != -1) { rc = regExp.cap(1).toInt(); if(unit != 0) { @@ -378,17 +378,17 @@ int MyMoneyAccountLoan::interestChangeFrequency(int* unit) const void MyMoneyAccountLoan::setInterestChangeFrequency(const int amount, const int unit) { - QString val; + TQString val; val.sprintf("%d/%d", amount, unit); setValue("interest-changeFrequency", val); } -const QString MyMoneyAccountLoan::schedule(void) const +const TQString MyMoneyAccountLoan::schedule(void) const { - return QString(value("schedule").latin1()); + return TQString(value("schedule").latin1()); } -void MyMoneyAccountLoan::setSchedule(const QString& sched) +void MyMoneyAccountLoan::setSchedule(const TQString& sched) { setValue("schedule", sched); } @@ -425,7 +425,7 @@ unsigned int MyMoneyAccountLoan::term(void) const void MyMoneyAccountLoan::setTerm(const unsigned int payments) { - setValue("term", QString::number(payments)); + setValue("term", TQString::number(payments)); } const MyMoneyMoney MyMoneyAccountLoan::periodicPayment(void) const @@ -438,27 +438,27 @@ void MyMoneyAccountLoan::setPeriodicPayment(const MyMoneyMoney& payment) setValue("periodic-payment", payment.toString()); } -const QString MyMoneyAccountLoan::payee(void) const +const TQString MyMoneyAccountLoan::payee(void) const { return value("payee"); } -void MyMoneyAccountLoan::setPayee(const QString& payee) +void MyMoneyAccountLoan::setPayee(const TQString& payee) { setValue("payee", payee); } -const QString MyMoneyAccountLoan::interestAccountId(void) const +const TQString MyMoneyAccountLoan::interestAccountId(void) const { - return QString(); + return TQString(); } -void MyMoneyAccountLoan::setInterestAccountId(const QString& /* id */) +void MyMoneyAccountLoan::setInterestAccountId(const TQString& /* id */) { } -bool MyMoneyAccountLoan::hasReferenceTo(const QString& id) const +bool MyMoneyAccountLoan::hasReferenceTo(const TQString& id) const { return MyMoneyAccount::hasReferenceTo(id) || (id == payee()) @@ -467,7 +467,7 @@ bool MyMoneyAccountLoan::hasReferenceTo(const QString& id) const void MyMoneyAccountLoan::setInterestCompounding(int frequency) { - setValue("compoundingFrequency", QString("%1").arg(frequency)); + setValue("compoundingFrequency", TQString("%1").tqarg(frequency)); } int MyMoneyAccountLoan::interestCompounding(void) const @@ -475,13 +475,13 @@ int MyMoneyAccountLoan::interestCompounding(void) const return value("compoundingFrequency").toInt(); } -void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyAccount::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("ACCOUNT"); + TQDomElement el = document.createElement("ACCOUNT"); writeBaseXML(document, el); - el.setAttribute("parentaccount", parentAccountId()); + el.setAttribute("tqparentaccount", tqparentAccountId()); el.setAttribute("lastreconciled", dateToString(lastReconciliationDate())); el.setAttribute("lastmodified", dateToString(lastModified())); el.setAttribute("institution", institutionId()); @@ -497,11 +497,11 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const //Add in subaccount information, if this account has subaccounts. if(accountCount()) { - QDomElement subAccounts = document.createElement("SUBACCOUNTS"); - QStringList::ConstIterator it; + TQDomElement subAccounts = document.createElement("SUBACCOUNTS"); + TQStringList::ConstIterator it; for(it = accountList().begin(); it != accountList().end(); ++it) { - QDomElement temp = document.createElement("SUBACCOUNT"); + TQDomElement temp = document.createElement("SUBACCOUNT"); temp.setAttribute("id", (*it)); subAccounts.appendChild(temp); } @@ -511,8 +511,8 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const // Write online banking settings if(m_onlineBankingSettings.pairs().count()) { - QDomElement onlinesettings = document.createElement("ONLINEBANKING"); - QMap<QString,QString>::const_iterator it_key = m_onlineBankingSettings.pairs().begin(); + TQDomElement onlinesettings = document.createElement("ONLINEBANKING"); + TQMap<TQString,TQString>::const_iterator it_key = m_onlineBankingSettings.pairs().begin(); while ( it_key != m_onlineBankingSettings.pairs().end() ) { onlinesettings.setAttribute(it_key.key(), it_key.data()); ++it_key; @@ -529,10 +529,10 @@ void MyMoneyAccount::writeXML(QDomDocument& document, QDomElement& parent) const //Add in Key-Value Pairs for accounts. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyAccount::hasReferenceTo(const QString& id) const +bool MyMoneyAccount::hasReferenceTo(const TQString& id) const { return (id == m_institution) || (id == m_parentAccount) || (id == m_currencyId); } @@ -591,10 +591,10 @@ bool MyMoneyAccount::isCategory(void) const return m_accountType == Income || m_accountType == Expense; } -QString MyMoneyAccount::brokerageName(void) const +TQString MyMoneyAccount::brokerageName(void) const { if(m_accountType == Investment) - return QString("%1 (%2)").arg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage")); + return TQString("%1 (%2)").tqarg(m_name, i18n("Brokerage (suffix for account names)", "Brokerage")); return m_name; } @@ -614,9 +614,9 @@ void MyMoneyAccount::adjustBalance(const MyMoneySplit& s, bool reverse) } -QPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const +TQPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const { - QString icon; + TQString icon; switch(accountType()) { default: if(accountGroup() == MyMoneyAccount::Asset) @@ -669,23 +669,23 @@ QPixmap MyMoneyAccount::accountPixmap(bool reconcileFlag, int size) const break; } - QPixmap result = DesktopIcon(icon, size); + TQPixmap result = DesktopIcon(icon, size); if(isClosed()) { - QPixmap ovly = DesktopIcon("account-types_closed", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_closed", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } else if(reconcileFlag) { - QPixmap ovly = DesktopIcon("account-types_reconcile.png", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_reconcile.png", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } else if(!onlineBankingSettings().value("provider").isEmpty()) { - QPixmap ovly = DesktopIcon("account-types_online.png", size); - bitBlt(&result, 0, 0, &ovly, 0, 0, ovly.width(), ovly.height(), Qt::CopyROP, false); + TQPixmap ovly = DesktopIcon("account-types_online.png", size); + bitBlt(TQT_TQPAINTDEVICE(&result), 0, 0, TQT_TQPAINTDEVICE(&ovly), 0, 0, ovly.width(), ovly.height(), TQt::CopyROP, false); } return result; } -QString MyMoneyAccount::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) +TQString MyMoneyAccount::accountTypeToString(const MyMoneyAccount::accountTypeE accountType) { - QString returnString; + TQString returnString; switch (accountType) { case MyMoneyAccount::Checkings: diff --git a/kmymoney2/mymoney/mymoneyaccount.h b/kmymoney2/mymoney/mymoneyaccount.h index 333c500..30e1185 100644 --- a/kmymoney2/mymoney/mymoneyaccount.h +++ b/kmymoney2/mymoney/mymoneyaccount.h @@ -24,12 +24,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qdom.h> -#include <qpixmap.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqdom.h> +#include <tqpixmap.h> // ---------------------------------------------------------------------------- // Project Includes @@ -122,16 +122,16 @@ public: * @param id id assigned to the account * @param right account definition */ - MyMoneyAccount(const QString& id, const MyMoneyAccount& right); + MyMoneyAccount(const TQString& id, const MyMoneyAccount& right); /** * This is the constructor for an account that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyAccount(const QDomElement& el); + MyMoneyAccount(const TQDomElement& el); /** * This is the destructor for any MyMoneyAccount object @@ -182,66 +182,66 @@ public: /** * This method returns the id of the MyMoneyInstitution object this account * belongs to. - * @return id of MyMoneyInstitution object. QString() if it is + * @return id of MyMoneyInstitution object. TQString() if it is * an internal account * @see setInstitution */ - const QString& institutionId(void) const { return m_institution; } + const TQString& institutionId(void) const { return m_institution; } /** * This method returns the name of the account * @return name of account * @see setName() */ - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } /** * This method returns the number of the account at the institution * @return number of account at the institution * @see setNumber */ - const QString& number(void) const { return m_number; } + const TQString& number(void) const { return m_number; } /** * This method returns the descriptive text of the account. * @return description of account * @see setDescription */ - const QString& description(void) const { return m_description; } + const TQString& description(void) const { return m_description; } /** * This method returns the opening date of this account - * @return date of opening of this account as const QDate value + * @return date of opening of this account as const TQDate value * @see setOpeningDate() */ - const QDate& openingDate(void) const { return m_openingDate; } + const TQDate& openingDate(void) const { return m_openingDate; } /** * This method returns the date of the last reconciliation of this account - * @return date of last reconciliation as const QDate value + * @return date of last reconciliation as const TQDate value * @see setLastReconciliationDate */ - const QDate& lastReconciliationDate(void) const { return m_lastReconciliationDate; } + const TQDate& lastReconciliationDate(void) const { return m_lastReconciliationDate; } /** * This method returns the date the account was last modified - * @return date of last modification as const QDate value + * @return date of last modification as const TQDate value * @see setLastModified */ - const QDate& lastModified(void) const { return m_lastModified; } + const TQDate& lastModified(void) const { return m_lastModified; } /** - * This method is used to return the ID of the parent account - * @return QString with the ID of the parent of this account + * This method is used to return the ID of the tqparent account + * @return TQString with the ID of the tqparent of this account */ - const QString& parentAccountId(void) const { return m_parentAccount; }; + const TQString& tqparentAccountId(void) const { return m_parentAccount; }; /** * This method returns the list of the account id's of * subordinate accounts - * @return QStringList account ids + * @return TQStringList account ids */ - const QStringList& accountList(void) const { return m_accountList; }; + const TQStringList& accountList(void) const { return m_accountList; }; /** * This method returns the number of entries in the m_accountList @@ -251,16 +251,16 @@ public: /** * This method is used to add an account id as sub-ordinate account - * @param account const QString reference to account ID + * @param account const TQString reference to account ID */ - void addAccountId(const QString& account); + void addAccountId(const TQString& account); /** * This method is used to remove an account from the list of * sub-ordinate accounts. - * @param account const QString reference to account ID to be removed + * @param account const TQString reference to account ID to be removed */ - void removeAccountId(const QString& account); + void removeAccountId(const TQString& account); /** * This method is used to remove all accounts from the list of @@ -274,21 +274,21 @@ public: * @param date date of last modification * @see lastModified */ - void setLastModified(const QDate& date); + void setLastModified(const TQDate& date); /** * This method is used to set the name of the account * @param name name of the account * @see name */ - void setName(const QString& name); + void setName(const TQString& name); /** * This method is used to set the number of the account at the institution * @param number number of the account * @see number */ - void setNumber(const QString& number); + void setNumber(const TQString& number); /** * This method is used to set the descriptive text of the account @@ -296,7 +296,7 @@ public: * @param desc text that serves as description * @see setDescription */ - void setDescription(const QString& desc); + void setDescription(const TQString& desc); /** * This method is used to set the id of the institution this account @@ -305,24 +305,24 @@ public: * @param id id of the institution this account belongs to * @see institution */ - void setInstitutionId(const QString& id); + void setInstitutionId(const TQString& id); /** * This method is used to set the opening date information of an * account. * - * @param date QDate of opening date + * @param date TQDate of opening date * @see openingDate */ - void setOpeningDate(const QDate& date); + void setOpeningDate(const TQDate& date); /** * This method is used to set the date of the last reconciliation * of an account. - * @param date QDate of last reconciliation + * @param date TQDate of last reconciliation * @see lastReconciliationDate */ - void setLastReconciliationDate(const QDate& date); + void setLastReconciliationDate(const TQDate& date); /** * This method is used to change the account type @@ -332,15 +332,15 @@ public: void setAccountType(const accountTypeE type); /** - * This method is used to set a new parent account id - * @param parent QString reference to new parent account + * This method is used to set a new tqparent account id + * @param tqparent TQString reference to new tqparent account */ - void setParentAccountId(const QString& parent); + void setParentAccountId(const TQString& tqparent); /** * This method is used to update m_lastModified to the current date */ - void touch(void) { setLastModified(QDate::currentDate()); } + void touch(void) { setLastModified(TQDate::tqcurrentDate()); } /** * This method returns the type of the account. @@ -353,16 +353,16 @@ public: * * @return id of currency */ - const QString& currencyId(void) const { return m_currencyId; }; + const TQString& currencyId(void) const { return m_currencyId; }; /** * This method sets the id of the currency used with this account. * * @param id ID of currency to be associated with this account. */ - void setCurrencyId(const QString& id); + void setCurrencyId(const TQString& id); - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -373,7 +373,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * This member returns the balance of this account based on @@ -514,13 +514,13 @@ public: * the current name. It only works on investment accounts and * returns the name for all other cases. */ - QString brokerageName(void) const; + TQString brokerageName(void) const; /** * @param size is a hint for the size of the icon * @return a pixmap using DesktopIcon for the account type */ - QPixmap accountPixmap(bool reconcileFlag = false, int size = 0) const; + TQPixmap accountPixmap(bool reconcileFlag = false, int size = 0) const; /** * This method is used to convert the internal representation of @@ -528,12 +528,12 @@ public: * * @param accountType numerical representation of the account type. * For possible values, see MyMoneyAccount::accountTypeE - * @return QString representing the human readable form + * @return TQString representing the human readable form */ - static QString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); + static TQString accountTypeToString(const MyMoneyAccount::accountTypeE accountType); - KMYMONEY_EXPORT QDataStream &operator<<( const MyMoneyAccount & ); - KMYMONEY_EXPORT QDataStream &operator>>( MyMoneyAccount & ); + KMYMONEY_EXPORT TQDataStream &operator<<( const MyMoneyAccount & ); + KMYMONEY_EXPORT TQDataStream &operator>>( MyMoneyAccount & ); private: /** @@ -545,61 +545,61 @@ private: * This member variable keeps the ID of the MyMoneyInstitution object * that this object belongs to. */ - QString m_institution; + TQString m_institution; /** * This member variable keeps the name of the account * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_name; + TQString m_name; /** * This member variable keeps the account number at the institution * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_number; + TQString m_number; /** * This member variable is a description of the account. * It is solely for documentation purposes and it's contents is not * used otherwise by the mymoney-engine. */ - QString m_description; + TQString m_description; /** * This member variable keeps the date when the account * was last modified. */ - QDate m_lastModified; + TQDate m_lastModified; /** * This member variable keeps the date when the * account was created as an object in a MyMoneyFile */ - QDate m_openingDate; + TQDate m_openingDate; /** * This member variable keeps the date of the last * reconciliation of this account */ - QDate m_lastReconciliationDate; + TQDate m_lastReconciliationDate; /** * This member holds the ID's of all sub-ordinate accounts */ - QStringList m_accountList; + TQStringList m_accountList; /** - * This member contains the ID of the parent account + * This member contains the ID of the tqparent account */ - QString m_parentAccount; + TQString m_parentAccount; /** * This member contains the ID of the currency associated with this account */ - QString m_currencyId; + TQString m_currencyId; /** * This member holds the balance of all transactions stored in the journal @@ -649,14 +649,14 @@ public: const MyMoneyMoney loanAmount(void) const; void setLoanAmount(const MyMoneyMoney& amount); - const MyMoneyMoney interestRate(const QDate& date) const; - void setInterestRate(const QDate& date, const MyMoneyMoney& rate); + const MyMoneyMoney interestRate(const TQDate& date) const; + void setInterestRate(const TQDate& date, const MyMoneyMoney& rate); interestDueE interestCalculation(void) const; void setInterestCalculation(const interestDueE onReception); - const QDate nextInterestChange(void) const; - void setNextInterestChange(const QDate& date); - const QString schedule(void) const; - void setSchedule(const QString& sched); + const TQDate nextInterestChange(void) const; + void setNextInterestChange(const TQDate& date); + const TQString schedule(void) const; + void setSchedule(const TQString& sched); bool fixedInterestRate(void) const; void setFixedInterestRate(const bool fixed); const MyMoneyMoney finalPayment(void) const; @@ -669,10 +669,10 @@ public: void setPeriodicPayment(const MyMoneyMoney& payment); int interestCompounding(void) const; void setInterestCompounding(int frequency); - const QString payee(void) const; - void setPayee(const QString& payee); - const QString interestAccountId(void) const; - void setInterestAccountId(const QString& id); + const TQString payee(void) const; + void setPayee(const TQString& payee); + const TQString interestAccountId(void) const; + void setInterestAccountId(const TQString& id); /** * This method checks if a reference to the given object exists. It returns, @@ -683,7 +683,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; }; diff --git a/kmymoney2/mymoney/mymoneyaccounttest.cpp b/kmymoney2/mymoney/mymoneyaccounttest.cpp index 1384c5c..0e1fbbf 100644 --- a/kmymoney2/mymoney/mymoneyaccounttest.cpp +++ b/kmymoney2/mymoney/mymoneyaccounttest.cpp @@ -35,26 +35,26 @@ void MyMoneyAccountTest::testEmptyConstructor() { CPPUNIT_ASSERT(a.id().isEmpty()); CPPUNIT_ASSERT(a.name().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::UnknownAccountType); - CPPUNIT_ASSERT(a.openingDate() == QDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); - CPPUNIT_ASSERT(a.lastReconciliationDate() == QDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); + CPPUNIT_ASSERT(a.lastReconciliationDate() == TQDate()); CPPUNIT_ASSERT(a.accountList().count() == 0); CPPUNIT_ASSERT(a.balance().isZero()); } void MyMoneyAccountTest::testConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; MyMoneySplit s; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setNumber("465500"); - r.setParentAccountId(parent); - r.setValue(QString("key"), "value"); + r.setParentAccountId(tqparent); + r.setValue(TQString("key"), "value"); s.setShares(MyMoneyMoney(1,1)); r.adjustBalance(s); CPPUNIT_ASSERT(r.m_kvp.count() == 1); @@ -65,26 +65,26 @@ void MyMoneyAccountTest::testConstructor() { CPPUNIT_ASSERT(a.id() == id); CPPUNIT_ASSERT(a.institutionId().isEmpty()); CPPUNIT_ASSERT(a.accountType() == MyMoneyAccount::Asset); - CPPUNIT_ASSERT(a.openingDate() == QDate::currentDate()); - CPPUNIT_ASSERT(a.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(a.openingDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.number() == "465500"); CPPUNIT_ASSERT(a.description() == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 0); - CPPUNIT_ASSERT(a.parentAccountId() == "Parent"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "Parent"); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(1,1)); - QMap<QString, QString> copy; + TQMap<TQString, TQString> copy; copy = r.pairs(); CPPUNIT_ASSERT(copy.count() == 1); - CPPUNIT_ASSERT(copy[QString("key")] == "value"); + CPPUNIT_ASSERT(copy[TQString("key")] == "value"); } void MyMoneyAccountTest::testSetFunctions() { MyMoneyAccount a; - QDate today(QDate::currentDate()); + TQDate today(TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.name().isEmpty()); - CPPUNIT_ASSERT(a.lastModified() == QDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate()); CPPUNIT_ASSERT(a.description().isEmpty()); a.setName("Account"); @@ -103,18 +103,18 @@ void MyMoneyAccountTest::testSetFunctions() { } void MyMoneyAccountTest::testCopyConstructor() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "ParentAccount"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "ParentAccount"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Expense); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setName("Account"); r.setInstitutionId("Inst1"); r.setDescription("Desc1"); r.setNumber("Number"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setValue("Key", "Value"); MyMoneyAccount a(id, r); @@ -125,11 +125,11 @@ void MyMoneyAccountTest::testCopyConstructor() { CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == institutionid); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Expense); - CPPUNIT_ASSERT(b.lastModified() == QDate::currentDate()); - CPPUNIT_ASSERT(b.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(b.openingDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(b.description() == "Desc1"); CPPUNIT_ASSERT(b.number() == "Number"); - CPPUNIT_ASSERT(b.parentAccountId() == "ParentAccount"); + CPPUNIT_ASSERT(b.tqparentAccountId() == "ParentAccount"); CPPUNIT_ASSERT(b.value("Key") == "Value"); } @@ -146,14 +146,14 @@ void MyMoneyAccountTest::testAssignmentConstructor() { MyMoneyAccount b; - b.setLastModified(QDate::currentDate()); + b.setLastModified(TQDate::tqcurrentDate()); b = a; CPPUNIT_ASSERT(b.name() == "Account"); CPPUNIT_ASSERT(b.institutionId() == "Inst1"); CPPUNIT_ASSERT(b.accountType() == MyMoneyAccount::Checkings); - CPPUNIT_ASSERT(b.lastModified() == QDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate()); CPPUNIT_ASSERT(b.openingDate() == a.openingDate()); CPPUNIT_ASSERT(b.description() == "Bla"); CPPUNIT_ASSERT(b.number() == "assigned Number"); @@ -176,7 +176,7 @@ void MyMoneyAccountTest::testAdjustBalance() { a.adjustBalance(s); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-4,1)); s.setShares(MyMoneyMoney(4,1)); - s.setAction(QString()); + s.setAction(TQString()); a.adjustBalance(s); CPPUNIT_ASSERT(a.balance().isZero()); } @@ -199,13 +199,13 @@ void MyMoneyAccountTest::testEquality() { MyMoneyAccount a; - a.setLastModified(QDate::currentDate()); + a.setLastModified(TQDate::tqcurrentDate()); a.setName("Name"); a.setNumber("Number"); a.setDescription("Desc"); a.setInstitutionId("I-ID"); - a.setOpeningDate(QDate::currentDate()); - a.setLastReconciliationDate(QDate::currentDate()); + a.setOpeningDate(TQDate::tqcurrentDate()); + a.setLastReconciliationDate(TQDate::tqcurrentDate()); a.setAccountType(MyMoneyAccount::Asset); a.setParentAccountId("P-ID"); a.setId("A-ID"); @@ -221,7 +221,7 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastModified(QDate::currentDate().addDays(-1)); + a.setLastModified(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -237,11 +237,11 @@ void MyMoneyAccountTest::testEquality() CPPUNIT_ASSERT(!(b == a)); b = a; - a.setOpeningDate(QDate::currentDate().addDays(-1)); + a.setOpeningDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; - a.setLastReconciliationDate(QDate::currentDate().addDays(-1)); + a.setLastReconciliationDate(TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(!(b == a)); b = a; @@ -272,35 +272,35 @@ void MyMoneyAccountTest::testEquality() } void MyMoneyAccountTest::testWriteXML() { - QString id = "A000001"; - QString institutionid = "B000001"; - QString parent = "Parent"; + TQString id = "A000001"; + TQString institutionid = "B000001"; + TQString tqparent = "Parent"; MyMoneyAccount r; r.setAccountType(MyMoneyAccount::Asset); - r.setOpeningDate(QDate::currentDate()); - r.setLastModified(QDate::currentDate()); + r.setOpeningDate(TQDate::tqcurrentDate()); + r.setLastModified(TQDate::tqcurrentDate()); r.setDescription("Desc"); r.setName("AccountName"); r.setNumber("465500"); - r.setParentAccountId(parent); + r.setParentAccountId(tqparent); r.setInstitutionId(institutionid); - r.setValue(QString("key"), "value"); + r.setValue(TQString("key"), "value"); r.addAccountId("A000002"); // CPPUNIT_ASSERT(r.m_kvp.count() == 1); // CPPUNIT_ASSERT(r.value("key") == "value"); MyMoneyAccount a(id, r); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("ACCOUNT-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("ACCOUNT-CONTAINER"); doc.appendChild(el); a.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <ACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <ACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " </SUBACCOUNTS>\n" @@ -309,17 +309,17 @@ void MyMoneyAccountTest::testWriteXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } void MyMoneyAccountTest::testReadXML() { MyMoneyAccount a; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <ACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <ACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " <SUBACCOUNT id=\"A000003\" />\n" @@ -330,12 +330,12 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </ACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<ACCOUNT-CONTAINER>\n" - " <KACCOUNT parentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" + " <KACCOUNT tqparentaccount=\"Parent\" lastmodified=\"%1\" lastreconciled=\"\" institution=\"B000001\" number=\"465500\" opened=\"%2\" type=\"9\" id=\"A000001\" name=\"AccountName\" description=\"Desc\" >\n" " <SUBACCOUNTS>\n" " <SUBACCOUNT id=\"A000002\" />\n" " <SUBACCOUNT id=\"A000003\" />\n" @@ -346,10 +346,10 @@ void MyMoneyAccountTest::testReadXML() { " </KEYVALUEPAIRS>\n" " </KACCOUNT>\n" "</ACCOUNT-CONTAINER>\n"). - arg(QDate::currentDate().toString(Qt::ISODate)).arg(QDate::currentDate().toString(Qt::ISODate)); + arg(TQDate::tqcurrentDate().toString(Qt::ISODate)).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -371,11 +371,11 @@ void MyMoneyAccountTest::testReadXML() { CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.m_name == "AccountName"); CPPUNIT_ASSERT(a.m_parentAccount == "Parent"); - CPPUNIT_ASSERT(a.m_lastModified == QDate::currentDate()); - CPPUNIT_ASSERT(a.m_lastReconciliationDate == QDate()); + CPPUNIT_ASSERT(a.m_lastModified == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.m_lastReconciliationDate == TQDate()); CPPUNIT_ASSERT(a.m_institution == "B000001"); CPPUNIT_ASSERT(a.m_number == "465500"); - CPPUNIT_ASSERT(a.m_openingDate == QDate::currentDate()); + CPPUNIT_ASSERT(a.m_openingDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.m_accountType == MyMoneyAccount::Asset); CPPUNIT_ASSERT(a.m_description == "Desc"); CPPUNIT_ASSERT(a.accountList().count() == 2); diff --git a/kmymoney2/mymoney/mymoneybudget.cpp b/kmymoney2/mymoney/mymoneybudget.cpp index 46b8ca8..3cb7793 100644 --- a/kmymoney2/mymoney/mymoneybudget.cpp +++ b/kmymoney2/mymoney/mymoneybudget.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -33,7 +33,7 @@ #include "mymoneybudget.h" -const QStringList MyMoneyBudget::AccountGroup::kBudgetLevelText = QStringList::split(",","none,monthly,monthbymonth,yearly,invalid",true); +const TQStringList MyMoneyBudget::AccountGroup::kBudgetLevelText = TQStringList::split(",","none,monthly,monthbymonth,yearly,invalid",true); const int BUDGET_VERSION = 2; bool MyMoneyBudget::AccountGroup::isZero(void) const @@ -80,7 +80,7 @@ void MyMoneyBudget::AccountGroup::convertToYearly(void) void MyMoneyBudget::AccountGroup::convertToMonthByMonth(void) { MyMoneyBudget::PeriodGroup period; - QDate date; + TQDate date; switch(m_budgetlevel) { case eMonthByMonth: @@ -126,14 +126,14 @@ MyMoneyBudget::AccountGroup MyMoneyBudget::AccountGroup::operator += (const MyMo // now both budgets should be of the same type and we simply need // to iterate over the period list and add the values - QMap<QDate, MyMoneyBudget::PeriodGroup> periods = m_periods; - QMap<QDate, MyMoneyBudget::PeriodGroup> rPeriods = r.m_periods; - QMap<QDate, MyMoneyBudget::PeriodGroup>::const_iterator it_p; - QMap<QDate, MyMoneyBudget::PeriodGroup>::const_iterator it_pr; + TQMap<TQDate, MyMoneyBudget::PeriodGroup> periods = m_periods; + TQMap<TQDate, MyMoneyBudget::PeriodGroup> rPeriods = r.m_periods; + TQMap<TQDate, MyMoneyBudget::PeriodGroup>::const_iterator it_p; + TQMap<TQDate, MyMoneyBudget::PeriodGroup>::const_iterator it_pr; m_periods.clear(); it_p = periods.begin(); it_pr = rPeriods.begin(); - QDate date = (*it_p).startDate(); + TQDate date = (*it_p).startDate(); while(it_p != periods.end()) { MyMoneyBudget::PeriodGroup period = *it_p; if(it_pr != rPeriods.end()) { @@ -161,19 +161,19 @@ MyMoneyBudget::MyMoneyBudget(void) : { } -MyMoneyBudget::MyMoneyBudget(const QString& _name) : +MyMoneyBudget::MyMoneyBudget(const TQString& _name) : m_name(_name) { } -MyMoneyBudget::MyMoneyBudget(const QDomElement& node) : +MyMoneyBudget::MyMoneyBudget(const TQDomElement& node) : MyMoneyObject(node) { if(!read(node)) clearId(); } -MyMoneyBudget::MyMoneyBudget(const QString& id, const MyMoneyBudget& budget) +MyMoneyBudget::MyMoneyBudget(const TQString& id, const MyMoneyBudget& budget) { *this = budget; m_id = id; @@ -193,7 +193,7 @@ bool MyMoneyBudget::operator == (const MyMoneyBudget& right) const (m_start == right.m_start) ); } -void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const +void MyMoneyBudget::write(TQDomElement& e, TQDomDocument *doc) const { writeBaseXML(*doc, e); @@ -201,20 +201,20 @@ void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const e.setAttribute("start", m_start.toString(Qt::ISODate) ); e.setAttribute("version", BUDGET_VERSION); - QMap<QString, AccountGroup>::const_iterator it; + TQMap<TQString, AccountGroup>::const_iterator it; for(it = m_accounts.begin(); it != m_accounts.end(); ++it) { // only add the account if there is a budget entered if(!(*it).balance().isZero()) { - QDomElement domAccount = doc->createElement("ACCOUNT"); + TQDomElement domAccount = doc->createElement("ACCOUNT"); domAccount.setAttribute("id", it.key()); domAccount.setAttribute("budgetlevel", AccountGroup::kBudgetLevelText[it.data().budgetLevel()]); domAccount.setAttribute("budgetsubaccounts", it.data().budgetSubaccounts()); - const QMap<QDate, PeriodGroup> periods = it.data().getPeriods(); - QMap<QDate, PeriodGroup>::const_iterator it_per; + const TQMap<TQDate, PeriodGroup> periods = it.data().getPeriods(); + TQMap<TQDate, PeriodGroup>::const_iterator it_per; for(it_per = periods.begin(); it_per != periods.end(); ++it_per) { if(!(*it_per).amount().isZero()) { - QDomElement domPeriod = doc->createElement("PERIOD"); + TQDomElement domPeriod = doc->createElement("PERIOD"); domPeriod.setAttribute("amount", (*it_per).amount().toString()); domPeriod.setAttribute("start", (*it_per).startDate().toString(Qt::ISODate)); @@ -227,7 +227,7 @@ void MyMoneyBudget::write(QDomElement& e, QDomDocument *doc) const } } -bool MyMoneyBudget::read(const QDomElement& e) +bool MyMoneyBudget::read(const TQDomElement& e) { // The goal of this reading method is 100% backward AND 100% forward // compatability. Any Budget ever created with any version of KMyMoney @@ -240,13 +240,13 @@ bool MyMoneyBudget::read(const QDomElement& e) { result = true; m_name = e.attribute("name"); - m_start = QDate::fromString(e.attribute("start"), Qt::ISODate); + m_start = TQDate::fromString(e.attribute("start"), Qt::ISODate); m_id = e.attribute("id"); - QDomNode child = e.firstChild(); + TQDomNode child = e.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); AccountGroup account; @@ -255,7 +255,7 @@ bool MyMoneyBudget::read(const QDomElement& e) account.setId(c.attribute("id")); if(c.hasAttribute("budgetlevel")) { - int i = AccountGroup::kBudgetLevelText.findIndex(c.attribute("budgetlevel")); + int i = AccountGroup::kBudgetLevelText.tqfindIndex(c.attribute("budgetlevel")); if ( i != -1 ) account.setBudgetLevel(static_cast<AccountGroup::eBudgetLevel>(i)); } @@ -264,16 +264,16 @@ bool MyMoneyBudget::read(const QDomElement& e) account.setBudgetSubaccounts(c.attribute("budgetsubaccounts").toUInt()); } - QDomNode period = c.firstChild(); + TQDomNode period = c.firstChild(); while(!period.isNull() && period.isElement()) { - QDomElement per = period.toElement(); + TQDomElement per = period.toElement(); PeriodGroup pGroup; if("PERIOD" == per.tagName() && per.hasAttribute("amount") && per.hasAttribute("start")) { pGroup.setAmount( MyMoneyMoney(per.attribute("amount")) ); - pGroup.setStartDate( QDate::fromString(per.attribute("start"), Qt::ISODate) ); + pGroup.setStartDate( TQDate::fromString(per.attribute("start"), Qt::ISODate) ); account.addPeriod(pGroup.startDate(), pGroup); } @@ -289,27 +289,27 @@ bool MyMoneyBudget::read(const QDomElement& e) return result; } -void MyMoneyBudget::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyBudget::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("BUDGET"); + TQDomElement el = document.createElement("BUDGET"); write(el,&document); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyBudget::hasReferenceTo(const QString& id) const +bool MyMoneyBudget::hasReferenceTo(const TQString& id) const { // return true if we have an assignment for this id - return (m_accounts.contains(id)); + return (m_accounts.tqcontains(id)); } -void MyMoneyBudget::removeReference(const QString& id) +void MyMoneyBudget::removeReference(const TQString& id) { - if(m_accounts.contains(id)) { + if(m_accounts.tqcontains(id)) { m_accounts.remove(id); } } -void MyMoneyBudget::setAccount(const AccountGroup &_account, const QString _id) +void MyMoneyBudget::setAccount(const AccountGroup &_account, const TQString _id) { if(_account.isZero()) { m_accounts.remove(_id); @@ -322,25 +322,25 @@ void MyMoneyBudget::setAccount(const AccountGroup &_account, const QString _id) } } -const MyMoneyBudget::AccountGroup& MyMoneyBudget::account(const QString _id) const +const MyMoneyBudget::AccountGroup& MyMoneyBudget::account(const TQString _id) const { static AccountGroup empty; - if ( m_accounts.contains(_id) ) + if ( m_accounts.tqcontains(_id) ) return m_accounts[_id]; return empty; } -void MyMoneyBudget::setBudgetStart(const QDate& _start) +void MyMoneyBudget::setBudgetStart(const TQDate& _start) { - QDate oldDate = QDate(m_start.year(), m_start.month(), 1); - m_start = QDate(_start.year(), _start.month(), 1); + TQDate oldDate = TQDate(m_start.year(), m_start.month(), 1); + m_start = TQDate(_start.year(), _start.month(), 1); if(oldDate.isValid()) { int adjust = ((m_start.year() - oldDate.year())*12) + (m_start.month() - oldDate.month()); - QMap<QString, AccountGroup>::iterator it; + TQMap<TQString, AccountGroup>::iterator it; for(it = m_accounts.begin(); it != m_accounts.end(); ++it) { - const QMap<QDate, PeriodGroup> periods = (*it).getPeriods(); - QMap<QDate, PeriodGroup>::const_iterator it_per; + const TQMap<TQDate, PeriodGroup> periods = (*it).getPeriods(); + TQMap<TQDate, PeriodGroup>::const_iterator it_per; (*it).clearPeriods(); for(it_per = periods.begin(); it_per != periods.end(); ++it_per) { PeriodGroup pgroup = (*it_per); diff --git a/kmymoney2/mymoney/mymoneybudget.h b/kmymoney2/mymoney/mymoneybudget.h index a2eea02..e7e44b4 100644 --- a/kmymoney2/mymoney/mymoneybudget.h +++ b/kmymoney2/mymoney/mymoneybudget.h @@ -25,11 +25,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qmap.h> -#include <qvaluelist.h> -#include <qstring.h> -class QDomElement; -class QDomDocument; +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqstring.h> +class TQDomElement; +class TQDomDocument; // ---------------------------------------------------------------------------- // Project Includes @@ -55,19 +55,19 @@ class KMYMONEY_EXPORT MyMoneyBudget: public MyMoneyObject public: MyMoneyBudget(void); ~MyMoneyBudget(); - MyMoneyBudget(const QString& _name); + MyMoneyBudget(const TQString& _name); /** * This constructor creates an object based on the data found in the - * QDomElement referenced by @p node. If problems arise, the @p id of + * TQDomElement referenced by @p node. If problems arise, the @p id of * the object is cleared (see MyMoneyObject::clearId()). */ - MyMoneyBudget(const QDomElement& node); + MyMoneyBudget(const TQDomElement& node); /** * This constructor creates an object based on the data found in the * MyMoneyBudget budget object. */ - MyMoneyBudget(const QString& id, const MyMoneyBudget& budget); + MyMoneyBudget(const TQString& id, const MyMoneyBudget& budget); /** * Helper class for MyMoneyBudget @@ -80,17 +80,17 @@ public: { public: // get functions - const QDate& startDate ( void ) const { return m_start; } + const TQDate& startDate ( void ) const { return m_start; } const MyMoneyMoney& amount( void ) const { return m_amount; } // set functions - void setStartDate ( const QDate& _start ) { m_start = _start; } + void setStartDate ( const TQDate& _start ) { m_start = _start; } void setAmount( const MyMoneyMoney& _amount ) { m_amount = _amount;} bool operator == (const PeriodGroup &r) const { return (m_start == r.m_start && m_amount == r.m_amount); } private: - QDate m_start; + TQDate m_start; MyMoneyMoney m_amount; }; @@ -113,23 +113,23 @@ public: eMax } eBudgetLevel; - static const QStringList kBudgetLevelText; + static const TQStringList kBudgetLevelText; public: AccountGroup() : m_budgetlevel(eNone), m_budgetsubaccounts(false) {} // get functions - const QString& id( void ) const { return m_id; } + const TQString& id( void ) const { return m_id; } bool budgetSubaccounts( void ) const { return m_budgetsubaccounts; } eBudgetLevel budgetLevel( void ) const { return m_budgetlevel; } - const PeriodGroup& period( const QDate &_date ) const { return m_periods[_date]; } - const QMap<QDate, PeriodGroup>& getPeriods( void ) const { return m_periods; } + const PeriodGroup& period( const TQDate &_date ) const { return m_periods[_date]; } + const TQMap<TQDate, PeriodGroup>& getPeriods( void ) const { return m_periods; } void clearPeriods(void) { m_periods.clear(); } const MyMoneyMoney balance( void ) const { MyMoneyMoney balance; - QMap<QDate, PeriodGroup>::const_iterator it; + TQMap<TQDate, PeriodGroup>::const_iterator it; for(it = m_periods.begin(); it != m_periods.end(); ++it) { balance += (*it).amount(); @@ -151,10 +151,10 @@ public: } // set functions - void setId( QString _id ) { m_id = _id; } + void setId( TQString _id ) { m_id = _id; } void setBudgetLevel( eBudgetLevel _level ) { m_budgetlevel = _level; } void setBudgetSubaccounts( bool _b ) { m_budgetsubaccounts = _b; } - void addPeriod( const QDate& _date, PeriodGroup &period ) { m_periods[_date] = period; } + void addPeriod( const TQDate& _date, PeriodGroup &period ) { m_periods[_date] = period; } // This member adds the value of another account group // m_budgetlevel is adjusted to the larger one of both @@ -171,11 +171,11 @@ public: void convertToMonthByMonth(void); private: - QString m_id; + TQString m_id; eBudgetLevel m_budgetlevel; bool m_budgetsubaccounts; - QMap<QDate, PeriodGroup> m_periods; + TQMap<TQDate, PeriodGroup> m_periods; }; /** @@ -184,17 +184,17 @@ public: bool operator == (const MyMoneyBudget &) const; // Simple get operations - const QString& name(void) const { return m_name; } - const QDate& budgetStart(void) const { return m_start; } - QString id(void) const { return m_id; } - const AccountGroup & account(const QString _id) const; - bool contains(const QString _id) const { return m_accounts.contains(_id); } - QValueList<AccountGroup> getaccounts(void) const { return m_accounts.values(); } + const TQString& name(void) const { return m_name; } + const TQDate& budgetStart(void) const { return m_start; } + TQString id(void) const { return m_id; } + const AccountGroup & account(const TQString _id) const; + bool tqcontains(const TQString _id) const { return m_accounts.tqcontains(_id); } + TQValueList<AccountGroup> getaccounts(void) const { return m_accounts.values(); } // Simple set operations - void setName(const QString& _name) { m_name = _name; } - void setBudgetStart(const QDate& _start); - void setAccount(const AccountGroup &_account, const QString _id); + void setName(const TQString& _name) { m_name = _name; } + void setBudgetStart(const TQDate& _start); + void setAccount(const AccountGroup &_account, const TQString _id); /** * This method writes this Budget to the DOM element @p e, @@ -204,7 +204,7 @@ public: * @param doc The document which we can use to create new sub-elements * if needed */ - void write(QDomElement& e, QDomDocument *doc) const; + void write(TQDomElement& e, TQDomDocument *doc) const; /** * This method reads a Budget from the DOM element @p e, and @@ -216,17 +216,17 @@ public: * element @p e. If false is returned, the contents of this Budget * object are undefined. */ - bool read(const QDomElement& e); + bool read(const TQDomElement& e); /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. (This version overwrites the + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. (This version overwrites the * MMObject base class.) * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -238,31 +238,31 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * This member removes all references to object identified by @p id. Used * to remove objects which are about to be removed from the engine. */ - void removeReference(const QString& id); + void removeReference(const TQString& id); private: /** * The user-assigned name of the Budget */ - QString m_name; + TQString m_name; /** * The user-assigned year of the Budget */ - QDate m_start; + TQDate m_start; /** * Map the budgeted accounts * * Each account Id is stored against the AccountGroup information */ - QMap<QString, AccountGroup> m_accounts; + TQMap<TQString, AccountGroup> m_accounts; }; #endif // MYMONEYBudget_H diff --git a/kmymoney2/mymoney/mymoneycategory.cpp b/kmymoney2/mymoney/mymoneycategory.cpp index 5bf55ab..8717237 100644 --- a/kmymoney2/mymoney/mymoneycategory.cpp +++ b/kmymoney2/mymoney/mymoneycategory.cpp @@ -21,13 +21,13 @@ MyMoneyCategory::MyMoneyCategory() m_income = true; } -MyMoneyCategory::MyMoneyCategory(const bool income, const QString name) +MyMoneyCategory::MyMoneyCategory(const bool income, const TQString name) { m_income = income; m_name = name; } -MyMoneyCategory::MyMoneyCategory(const bool income, const QString name, QStringList minors) +MyMoneyCategory::MyMoneyCategory(const bool income, const TQString name, TQStringList minors) { m_income = income; m_name = name; @@ -39,12 +39,12 @@ MyMoneyCategory::~MyMoneyCategory() } // Functions use the find method to search the list -bool MyMoneyCategory::addMinorCategory(const QString val) +bool MyMoneyCategory::addMinorCategory(const TQString val) { if (val.isEmpty() || val.isNull()) return false; - if (m_minorCategories.find(val) == m_minorCategories.end()) { + if (m_minorCategories.tqfind(val) == m_minorCategories.end()) { m_minorCategories.append(val); return true; } @@ -52,12 +52,12 @@ bool MyMoneyCategory::addMinorCategory(const QString val) return false; } -bool MyMoneyCategory::removeMinorCategory(const QString val) +bool MyMoneyCategory::removeMinorCategory(const TQString val) { if (val.isEmpty() || val.isNull()) return false; - if (m_minorCategories.find(val) != m_minorCategories.end()) { + if (m_minorCategories.tqfind(val) != m_minorCategories.end()) { m_minorCategories.remove(val); return true; } @@ -65,13 +65,13 @@ bool MyMoneyCategory::removeMinorCategory(const QString val) return false; } -bool MyMoneyCategory::renameMinorCategory(const QString oldVal, const QString newVal) +bool MyMoneyCategory::renameMinorCategory(const TQString oldVal, const TQString newVal) { if (oldVal.isEmpty() || oldVal.isNull() || newVal.isEmpty() || newVal.isNull()) return false; - if (m_minorCategories.find(oldVal) != m_minorCategories.end() && - m_minorCategories.find(newVal) == m_minorCategories.end() ) { + if (m_minorCategories.tqfind(oldVal) != m_minorCategories.end() && + m_minorCategories.tqfind(newVal) == m_minorCategories.end() ) { m_minorCategories.remove(oldVal); return addMinorCategory(newVal); @@ -80,16 +80,16 @@ bool MyMoneyCategory::renameMinorCategory(const QString oldVal, const QString ne return false; } -bool MyMoneyCategory::addMinorCategory(QStringList values) +bool MyMoneyCategory::addMinorCategory(TQStringList values) { - for (QStringList::Iterator it = values.begin(); it!=values.end(); ++it) { + for (TQStringList::Iterator it = values.begin(); it!=values.end(); ++it) { addMinorCategory(*it); } return true; } -bool MyMoneyCategory::setMinorCategories(QStringList values) +bool MyMoneyCategory::setMinorCategories(TQStringList values) { m_minorCategories.clear(); return addMinorCategory(values); @@ -101,7 +101,7 @@ bool MyMoneyCategory::removeAllMinors(void) return true; } -QString MyMoneyCategory::firstMinor(void) +TQString MyMoneyCategory::firstMinor(void) { return m_minorCategories.first(); } @@ -123,26 +123,26 @@ MyMoneyCategory& MyMoneyCategory::operator = (const MyMoneyCategory& right) return *this; } -QDataStream &operator<<(QDataStream &s, MyMoneyCategory &category) +TQDataStream &operator<<(TQDataStream &s, MyMoneyCategory &category) { if (category.m_income) - s << (Q_INT32)1; + s << (TQ_INT32)1; else - s << (Q_INT32)0; + s << (TQ_INT32)0; s << category.m_name; - s << (Q_UINT32)category.m_minorCategories.count(); - for (QStringList::Iterator it = category.m_minorCategories.begin(); it!=category.m_minorCategories.end(); ++it) { + s << (TQ_UINT32)category.m_minorCategories.count(); + for (TQStringList::Iterator it = category.m_minorCategories.begin(); it!=category.m_minorCategories.end(); ++it) { s << (*it); } return s; } -QDataStream &operator>>(QDataStream &s, MyMoneyCategory &category) +TQDataStream &operator>>(TQDataStream &s, MyMoneyCategory &category) { - Q_INT32 inc; + TQ_INT32 inc; s >> inc; if (inc==0) category.m_income = false; @@ -151,8 +151,8 @@ QDataStream &operator>>(QDataStream &s, MyMoneyCategory &category) s >> category.m_name; - Q_UINT32 minorCount; - QString buffer; + TQ_UINT32 minorCount; + TQString buffer; s >> minorCount; category.m_minorCategories.clear(); diff --git a/kmymoney2/mymoney/mymoneycategory.h b/kmymoney2/mymoney/mymoneycategory.h index 3f4babc..b642c74 100644 --- a/kmymoney2/mymoney/mymoneycategory.h +++ b/kmymoney2/mymoney/mymoneycategory.h @@ -20,8 +20,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> /** * @deprecated This class represents an Income or Expense category. Please don't @@ -29,34 +29,34 @@ */ class MyMoneyCategory { bool m_income; // if false, m_income == expense - QString m_name; - QStringList m_minorCategories; + TQString m_name; + TQStringList m_minorCategories; - friend QDataStream &operator<<(QDataStream &, MyMoneyCategory &); - friend QDataStream &operator>>(QDataStream &, MyMoneyCategory &); + friend TQDataStream &operator<<(TQDataStream &, MyMoneyCategory &); + friend TQDataStream &operator>>(TQDataStream &, MyMoneyCategory &); public: MyMoneyCategory(); - MyMoneyCategory(const bool income, const QString name); - MyMoneyCategory(const bool income, const QString name, QStringList minors); + MyMoneyCategory(const bool income, const TQString name); + MyMoneyCategory(const bool income, const TQString name, TQStringList minors); ~MyMoneyCategory(); // Simple get operations - QString name(void) { return m_name; } - QStringList& minorCategories(void) { return m_minorCategories; } + TQString name(void) { return m_name; } + TQStringList& minorCategories(void) { return m_minorCategories; } // Simple set operations bool isIncome(void) { return m_income; } void setIncome(const bool val) { m_income = val; } - void setName(const QString val) { m_name = val; } + void setName(const TQString val) { m_name = val; } - bool setMinorCategories(QStringList values); - bool addMinorCategory(const QString val); - bool removeMinorCategory(const QString val); - bool renameMinorCategory(const QString oldVal, const QString newVal); - bool addMinorCategory(QStringList values); + bool setMinorCategories(TQStringList values); + bool addMinorCategory(const TQString val); + bool removeMinorCategory(const TQString val); + bool renameMinorCategory(const TQString oldVal, const TQString newVal); + bool addMinorCategory(TQStringList values); bool removeAllMinors(void); - QString firstMinor(void); + TQString firstMinor(void); void clear(void); diff --git a/kmymoney2/mymoney/mymoneyexception.cpp b/kmymoney2/mymoney/mymoneyexception.cpp index 6b61e67..4ee0970 100644 --- a/kmymoney2/mymoney/mymoneyexception.cpp +++ b/kmymoney2/mymoney/mymoneyexception.cpp @@ -22,7 +22,7 @@ #include "mymoneyexception.h" -MyMoneyException::MyMoneyException(const QString& msg, const QString& file, const unsigned long line) +MyMoneyException::MyMoneyException(const TQString& msg, const TQString& file, const unsigned long line) { // qDebug("MyMoneyException(%s,%s,%d)", msg.data(), file.data(), line); m_msg = msg; diff --git a/kmymoney2/mymoney/mymoneyexception.h b/kmymoney2/mymoney/mymoneyexception.h index 68cf2af..41020b3 100644 --- a/kmymoney2/mymoney/mymoneyexception.h +++ b/kmymoney2/mymoney/mymoneyexception.h @@ -30,7 +30,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> +#include <tqstring.h> #include <kmymoney/export.h> /** * @file @@ -57,8 +57,8 @@ public: /** * The constructor to create a new MyMoneyException object. * - * @param msg reference to QString containing the message - * @param file reference to QString containing the name of the sourcefile where + * @param msg reference to TQString containing the message + * @param file reference to TQString containing the name of the sourcefile where * the exception was thrown * @param line unsigned long containing the line number of the line where * the exception was thrown in the file. @@ -67,7 +67,7 @@ public: * MYMONEYEXCEPTION(text) instead. It automatically assigns the file * and line parameter to the correct values. */ - MyMoneyException(const QString& msg, const QString& file, const unsigned long line); + MyMoneyException(const TQString& msg, const TQString& file, const unsigned long line); ~MyMoneyException(); @@ -75,17 +75,17 @@ public: * This method is used to return the message that was passed * during the creation of the exception object. * - * @return reference to QString containing the message + * @return reference to TQString containing the message */ - const QString& what(void) const { return m_msg; }; + const TQString& what(void) const { return m_msg; }; /** * This method is used to return the filename that was passed * during the creation of the exception object. * - * @return reference to QString containing the filename + * @return reference to TQString containing the filename */ - const QString& file(void) const { return m_file; }; + const TQString& file(void) const { return m_file; }; /** * This method is used to return the linenumber that was passed @@ -99,12 +99,12 @@ private: /** * This member variable holds the message */ - QString m_msg; + TQString m_msg; /** * This member variable holds the filename */ - QString m_file; + TQString m_file; /** * This member variable holds the line number diff --git a/kmymoney2/mymoney/mymoneyfile.cpp b/kmymoney2/mymoney/mymoneyfile.cpp index 3245746..8707614 100644 --- a/kmymoney2/mymoney/mymoneyfile.cpp +++ b/kmymoney2/mymoney/mymoneyfile.cpp @@ -19,9 +19,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -44,8 +44,8 @@ #include "config.h" #endif -const QString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances"); -const QString MyMoneyFile::AccountSeperator = ":"; +const TQString MyMoneyFile::OpeningBalancesPrefix = I18N_NOOP("Opening Balances"); +const TQString MyMoneyFile::AccountSeperator = ":"; // include the following line to get a 'cout' for debug purposes // #include <iostream> @@ -71,7 +71,7 @@ public: * false - don't reload the object immediately * true - reload the object immediately */ - QMap<QString, bool> m_notificationList; + TQMap<TQString, bool> m_notificationList; }; @@ -146,7 +146,7 @@ void MyMoneyFile::checkTransaction(const char* txt) const { checkStorage(); if(!d->m_inTransaction) { - throw new MYMONEYEXCEPTION(QString("No transaction started for %1").arg(txt)); + throw new MYMONEYEXCEPTION(TQString("No transaction started for %1").tqarg(txt)); } } @@ -175,7 +175,7 @@ void MyMoneyFile::addInstitution(MyMoneyInstitution& institution) { // perform some checks to see that the institution stuff is OK. For // now we assume that the institution must have a name, the ID is not set - // and it does not have a parent (MyMoneyFile). + // and it does not have a tqparent (MyMoneyFile). if(institution.name().length() == 0 || institution.id().length() != 0) @@ -212,7 +212,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction) // now check the splits bool loanAccountAffected = false; - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist @@ -229,7 +229,7 @@ void MyMoneyFile::modifyTransaction(const MyMoneyTransaction& transaction) // into amortization splits if(loanAccountAffected) { tCopy = transaction; - QValueList<MyMoneySplit> list = transaction.splits(); + TQValueList<MyMoneySplit> list = transaction.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionTransfer) { MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId()); @@ -318,7 +318,7 @@ void MyMoneyFile::modifyAccount(const MyMoneyAccount& _account) addNotification(account.id()); } -void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) +void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) { checkTransaction(__PRETTY_FUNCTION__); @@ -326,47 +326,47 @@ void MyMoneyFile::reparentAccount(MyMoneyAccount &account, MyMoneyAccount& paren if(isStandardAccount(account.id())) throw new MYMONEYEXCEPTION("Unable to reparent the standard account groups"); - if(account.accountGroup() == parent.accountGroup() - || (account.accountType() == MyMoneyAccount::Income && parent.accountType() == MyMoneyAccount::Expense) - || (account.accountType() == MyMoneyAccount::Expense && parent.accountType() == MyMoneyAccount::Income)) { + if(account.accountGroup() == tqparent.accountGroup() + || (account.accountType() == MyMoneyAccount::Income && tqparent.accountType() == MyMoneyAccount::Expense) + || (account.accountType() == MyMoneyAccount::Expense && tqparent.accountType() == MyMoneyAccount::Income)) { - if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment) + if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment) throw new MYMONEYEXCEPTION("Unable to reparent Stock to non-investment account"); - if(parent.accountType() == MyMoneyAccount::Investment && !account.isInvest()) + if(tqparent.accountType() == MyMoneyAccount::Investment && !account.isInvest()) throw new MYMONEYEXCEPTION("Unable to reparent non-stock to investment account"); // clear all changed objects from cache MyMoneyNotifier notifier(this); - // keep a notification of the current parent - addNotification(account.parentAccountId()); + // keep a notification of the current tqparent + addNotification(account.tqparentAccountId()); - m_storage->reparentAccount(account, parent); + m_storage->reparentAccount(account, tqparent); - // and also keep one for the account itself and the new parent + // and also keep one for the account itself and the new tqparent addNotification(account.id()); - addNotification(parent.id()); + addNotification(tqparent.id()); } else throw new MYMONEYEXCEPTION("Unable to reparent to different account type"); } -const MyMoneyInstitution& MyMoneyFile::institution(const QString& id) const +const MyMoneyInstitution& MyMoneyFile::institution(const TQString& id) const { return d->m_cache.institution(id); } -const MyMoneyAccount& MyMoneyFile::account(const QString& id) const +const MyMoneyAccount& MyMoneyFile::account(const TQString& id) const { return d->m_cache.account(id); } -const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const QString& name) const +const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, const TQString& name) const { static MyMoneyAccount nullAccount; - QValueList<QString>::const_iterator it_a; + TQValueList<TQString>::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { const MyMoneyAccount& sacc = account(*it_a); if(sacc.name() == name) @@ -375,7 +375,7 @@ const MyMoneyAccount& MyMoneyFile::subAccountByName(const MyMoneyAccount& acc, c return nullAccount; } -const MyMoneyAccount& MyMoneyFile::accountByName(const QString& name) const +const MyMoneyAccount& MyMoneyFile::accountByName(const TQString& name) const { return d->m_cache.accountByName(name); } @@ -389,7 +389,7 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction) // get the engine's idea about this transaction MyMoneyTransaction tr = MyMoneyFile::transaction(transaction.id()); - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; // scan the splits again to update notification list for(it_s = tr.splits().begin(); it_s != tr.splits().end(); ++it_s) { @@ -404,21 +404,21 @@ void MyMoneyFile::removeTransaction(const MyMoneyTransaction& transaction) } -bool MyMoneyFile::hasActiveSplits(const QString& id) const +bool MyMoneyFile::hasActiveSplits(const TQString& id) const { checkStorage(); return m_storage->hasActiveSplits(id); } -bool MyMoneyFile::isStandardAccount(const QString& id) const +bool MyMoneyFile::isStandardAccount(const TQString& id) const { checkStorage(); return m_storage->isStandardAccount(id); } -void MyMoneyFile::setAccountName(const QString& id, const QString& name) const +void MyMoneyFile::setAccountName(const TQString& id, const TQString& name) const { checkTransaction(__PRETTY_FUNCTION__); @@ -429,14 +429,14 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account) { checkTransaction(__PRETTY_FUNCTION__); - MyMoneyAccount parent; + MyMoneyAccount tqparent; MyMoneyAccount acc; MyMoneyInstitution institution; - // check that the account and its parent exist + // check that the account and its tqparent exist // this will throw an exception if the id is unknown acc = MyMoneyFile::account(account.id()); - parent = MyMoneyFile::account(account.parentAccountId()); + tqparent = MyMoneyFile::account(account.tqparentAccountId()); if(!acc.institutionId().isEmpty()) institution = MyMoneyFile::institution(acc.institutionId()); @@ -452,25 +452,25 @@ void MyMoneyFile::removeAccount(const MyMoneyAccount& account) MyMoneyNotifier notifier(this); // collect all sub-ordinate accounts for notification - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it = acc.accountList().begin(); it != acc.accountList().end(); ++it) addNotification(*it); - // don't forget the parent and a possible institution - addNotification(parent.id()); + // don't forget the tqparent and a possible institution + addNotification(tqparent.id()); addNotification(account.institutionId()); if(!institution.id().isEmpty()) { institution.removeAccountId(account.id()); m_storage->modifyInstitution(institution); } - acc.setInstitutionId(QString()); + acc.setInstitutionId(TQString()); m_storage->removeAccount(acc); addNotification(acc.id(), false); d->m_cache.clear(acc.id()); } -void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned int level) { +void MyMoneyFile::removeAccountList(const TQStringList& account_list, unsigned int level) { if (level > 100) throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::removeAccountList]!"); @@ -486,7 +486,7 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in } // process all accounts in the list and test if they have transactions assigned - for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { + for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { MyMoneyAccount a = m_storage->account(*it); //kdDebug() << "Deleting account '"<< a.name() << "'" << endl; @@ -503,12 +503,12 @@ void MyMoneyFile::removeAccountList(const QStringList& account_list, unsigned in } } -bool MyMoneyFile::hasOnlyUnusedAccounts(const QStringList& account_list, unsigned int level) +bool MyMoneyFile::hasOnlyUnusedAccounts(const TQStringList& account_list, unsigned int level) { if (level > 100) throw new MYMONEYEXCEPTION("Too deep recursion in [MyMoneyFile::hasOnlyUnusedAccounts]!"); // process all accounts in the list and test if they have transactions assigned - for (QStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { + for (TQStringList::const_iterator it = account_list.begin(); it != account_list.end(); ++it) { if (transactionCount(*it) != 0) return false; // the current account has a transaction assigned if (!hasOnlyUnusedAccounts(account(*it).accountList(), level+1)) @@ -525,14 +525,14 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution) // clear all changed objects from cache MyMoneyNotifier notifier(this); - QValueList<QString>::ConstIterator it_a; + TQValueList<TQString>::ConstIterator it_a; MyMoneyInstitution inst = MyMoneyFile::institution(institution.id()); bool blocked = signalsBlocked(); blockSignals(true); for(it_a = inst.accountList().begin(); it_a != inst.accountList().end(); ++it_a) { MyMoneyAccount acc = account(*it_a); - acc.setInstitutionId(QString()); + acc.setInstitutionId(TQString()); modifyAccount(acc); } blockSignals(blocked); @@ -542,7 +542,7 @@ void MyMoneyFile::removeInstitution(const MyMoneyInstitution& institution) addNotification(institution.id(), false); } -void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) +void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& tqparent) { checkTransaction(__PRETTY_FUNCTION__); @@ -550,7 +550,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) // perform some checks to see that the account stuff is OK. For // now we assume that the account must have a name, has no - // transaction and sub-accounts and parent account + // transaction and sub-accounts and tqparent account // it's own ID is not set and it does not have a pointer to (MyMoneyFile) if(account.name().length() == 0) @@ -562,16 +562,16 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) if(account.accountList().count() != 0) throw new MYMONEYEXCEPTION("New account must have no sub-accounts"); - if(!account.parentAccountId().isEmpty()) - throw new MYMONEYEXCEPTION("New account must have no parent-id"); + if(!account.tqparentAccountId().isEmpty()) + throw new MYMONEYEXCEPTION("New account must have no tqparent-id"); if(account.accountType() == MyMoneyAccount::UnknownAccountType) throw new MYMONEYEXCEPTION("Account has invalid type"); - // make sure, that the parent account exists + // make sure, that the tqparent account exists // if not, an exception is thrown. If it exists, // get a copy of the current data - MyMoneyAccount acc = MyMoneyFile::account(parent.id()); + MyMoneyAccount acc = MyMoneyFile::account(tqparent.id()); #if 0 // TODO: remove the following code as we now can have multiple accounts @@ -579,7 +579,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) // // check if the selected name is currently not among the child accounts // if we find one, then return it as the new account - QStringList::const_iterator it_a; + TQStringList::const_iterator it_a; for(it_a = acc.accountList().begin(); it_a != acc.accountList().end(); ++it_a) { MyMoneyAccount a = MyMoneyFile::account(*it_a); if(account.name() == a.name()) { @@ -589,23 +589,23 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) } #endif - // FIXME: make sure, that the parent has the same type + // FIXME: make sure, that the tqparent has the same type // I left it out here because I don't know, if there is // a tight coupling between e.g. checking accounts and the // class asset. It certainly does not make sense to create an // expense account under an income account. Maybe it does, I don't know. - // We enforce, that a stock account can never be a parent and - // that the parent for a stock account must be an investment. Also, - // an investment cannot have another investment account as it's parent - if(parent.isInvest()) - throw new MYMONEYEXCEPTION("Stock account cannot be parent account"); + // We enforce, that a stock account can never be a tqparent and + // that the tqparent for a stock account must be an investment. Also, + // an investment cannot have another investment account as it's tqparent + if(tqparent.isInvest()) + throw new MYMONEYEXCEPTION("Stock account cannot be tqparent account"); - if(account.isInvest() && parent.accountType() != MyMoneyAccount::Investment) - throw new MYMONEYEXCEPTION("Stock account must have investment account as parent "); + if(account.isInvest() && tqparent.accountType() != MyMoneyAccount::Investment) + throw new MYMONEYEXCEPTION("Stock account must have investment account as tqparent "); - if(!account.isInvest() && parent.accountType() == MyMoneyAccount::Investment) - throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as children"); + if(!account.isInvest() && tqparent.accountType() == MyMoneyAccount::Investment) + throw new MYMONEYEXCEPTION("Investment account can only have stock accounts as tqchildren"); // clear all changed objects from cache MyMoneyNotifier notifier(this); @@ -619,13 +619,13 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) if(!account.openingDate().isValid()) { - account.setOpeningDate(QDate::currentDate()); + account.setOpeningDate(TQDate::tqcurrentDate()); } - account.setParentAccountId(parent.id()); + account.setParentAccountId(tqparent.id()); m_storage->addAccount(account); - m_storage->addAccount(parent, account); + m_storage->addAccount(tqparent, account); if(account.institutionId().length() != 0) { institution.addAccountId(account.id()); @@ -634,7 +634,7 @@ void MyMoneyFile::addAccount(MyMoneyAccount& account, MyMoneyAccount& parent) } d->m_cache.preloadAccount(account); - addNotification(parent.id()); + addNotification(tqparent.id()); } MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAccount& acc, const MyMoneyMoney& balance) @@ -674,9 +674,9 @@ MyMoneyTransaction MyMoneyFile::createOpeningBalanceTransaction(const MyMoneyAcc return t; } -QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const +TQString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const { - QString result; + TQString result; MyMoneySecurity currency = security(acc.currencyId()); MyMoneyAccount openAcc; @@ -694,8 +694,8 @@ QString MyMoneyFile::openingBalanceTransaction(const MyMoneyAccount& acc) const // Iterate over all the opening balance transactions for this currency MyMoneyTransactionFilter filter; filter.addAccount(openAcc.id()); - QValueList<MyMoneyTransaction> transactions = transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try @@ -757,10 +757,10 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe throw new MYMONEYEXCEPTION("Opening balance for non currencies not supported"); MyMoneyAccount acc; - QRegExp match(QString("^%1").arg(i18n(MyMoneyFile::OpeningBalancesPrefix))); + TQRegExp match(TQString("^%1").tqarg(i18n(MyMoneyFile::OpeningBalancesPrefix))); - QValueList<MyMoneyAccount> accounts; - QValueList<MyMoneyAccount>::Iterator it; + TQValueList<MyMoneyAccount> accounts; + TQValueList<MyMoneyAccount>::Iterator it; accountList(accounts, equity().accountList(), true); @@ -774,7 +774,7 @@ const MyMoneyAccount MyMoneyFile::openingBalanceAccount_internal(const MyMoneySe } if(acc.id().isEmpty()) { - throw new MYMONEYEXCEPTION(QString("No opening balance account for %1").arg(security.tradingSymbol())); + throw new MYMONEYEXCEPTION(TQString("No opening balance account for %1").tqarg(security.tradingSymbol())); } return acc; @@ -785,16 +785,16 @@ const MyMoneyAccount MyMoneyFile::createOpeningBalanceAccount(const MyMoneySecur checkTransaction(__PRETTY_FUNCTION__); MyMoneyAccount acc; - QString name(i18n(MyMoneyFile::OpeningBalancesPrefix)); + TQString name(i18n(MyMoneyFile::OpeningBalancesPrefix)); if(security.id() != baseCurrency().id()) { - name += QString(" (%1)").arg(security.id()); + name += TQString(" (%1)").tqarg(security.id()); } acc.setName(name); acc.setAccountType(MyMoneyAccount::Equity); acc.setCurrencyId(security.id()); - MyMoneyAccount parent = equity(); - this->addAccount(acc, parent); + MyMoneyAccount tqparent = equity(); + this->addAccount(acc, tqparent); return acc; } @@ -819,7 +819,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) // now check the splits bool loanAccountAffected = false; - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -835,7 +835,7 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) // change transfer splits between asset/liability and loan accounts // into amortization splits if(loanAccountAffected) { - QValueList<MyMoneySplit> list = transaction.splits(); + TQValueList<MyMoneySplit> list = transaction.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionTransfer) { MyMoneyAccount acc = MyMoneyFile::account((*it_s).accountId()); @@ -864,14 +864,14 @@ void MyMoneyFile::addTransaction(MyMoneyTransaction& transaction) } } -const MyMoneyTransaction MyMoneyFile::transaction(const QString& id) const +const MyMoneyTransaction MyMoneyFile::transaction(const TQString& id) const { checkStorage(); return m_storage->transaction(id); } -const MyMoneyTransaction MyMoneyFile::transaction(const QString& account, const int idx) const +const MyMoneyTransaction MyMoneyFile::transaction(const TQString& account, const int idx) const { checkStorage(); @@ -890,12 +890,12 @@ void MyMoneyFile::addPayee(MyMoneyPayee& payee) d->m_cache.preloadPayee(payee); } -const MyMoneyPayee& MyMoneyFile::payee(const QString& id) const +const MyMoneyPayee& MyMoneyFile::payee(const TQString& id) const { return d->m_cache.payee(id); } -const MyMoneyPayee& MyMoneyFile::payeeByName(const QString& name) const +const MyMoneyPayee& MyMoneyFile::payeeByName(const TQString& name) const { checkStorage(); @@ -926,7 +926,7 @@ void MyMoneyFile::removePayee(const MyMoneyPayee& payee) addNotification(payee.id(), false); } -void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringList& idlist, const bool recursive) const +void MyMoneyFile::accountList(TQValueList<MyMoneyAccount>& list, const TQStringList& idlist, const bool recursive) const { if(idlist.isEmpty()) { d->m_cache.account(list); @@ -940,8 +940,8 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis } #endif - QValueList<MyMoneyAccount>::Iterator it; - QValueList<MyMoneyAccount>::Iterator next; + TQValueList<MyMoneyAccount>::Iterator it; + TQValueList<MyMoneyAccount>::Iterator next; for(it = list.begin(); it != list.end(); ) { if(isStandardAccount( (*it).id() )) { it = list.erase(it); @@ -950,13 +950,13 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis } } } else { - QValueList<MyMoneyAccount>::ConstIterator it; - QValueList<MyMoneyAccount> list_a; + TQValueList<MyMoneyAccount>::ConstIterator it; + TQValueList<MyMoneyAccount> list_a; d->m_cache.account(list_a); for(it = list_a.begin(); it != list_a.end(); ++it) { if(!isStandardAccount((*it).id())) { - if(idlist.findIndex((*it).id()) != -1) { + if(idlist.tqfindIndex((*it).id()) != -1) { list.append(*it); if(recursive == true) { accountList(list, (*it).accountList(), true); @@ -967,14 +967,14 @@ void MyMoneyFile::accountList(QValueList<MyMoneyAccount>& list, const QStringLis } } -void MyMoneyFile::institutionList(QValueList<MyMoneyInstitution>& list) const +void MyMoneyFile::institutionList(TQValueList<MyMoneyInstitution>& list) const { d->m_cache.institution(list); } -const QValueList<MyMoneyInstitution> MyMoneyFile::institutionList(void) const +const TQValueList<MyMoneyInstitution> MyMoneyFile::institutionList(void) const { - QValueList<MyMoneyInstitution> list; + TQValueList<MyMoneyInstitution> list; institutionList(list); return list; } @@ -1055,17 +1055,17 @@ const MyMoneyAccount& MyMoneyFile::equity(void) const { checkStorage(); - return d->m_cache.account (STD_ACC_EQUITY); + return d->m_cache.account (STD_ACC_ETQUITY); } -unsigned int MyMoneyFile::transactionCount(const QString& account) const +unsigned int MyMoneyFile::transactionCount(const TQString& account) const { checkStorage(); return m_storage->transactionCount(account); } -const QMap<QString, unsigned long> MyMoneyFile::transactionCountMap(void) const +const TQMap<TQString, unsigned long> MyMoneyFile::transactionCountMap(void) const { checkStorage(); @@ -1079,21 +1079,21 @@ unsigned int MyMoneyFile::institutionCount(void) const return m_storage->institutionCount(); } -const MyMoneyMoney MyMoneyFile::balance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyFile::balance(const TQString& id, const TQDate& date) const { checkStorage(); return m_storage->balance(id, date); } -const MyMoneyMoney MyMoneyFile::totalBalance(const QString& id, const QDate& date) const +const MyMoneyMoney MyMoneyFile::totalBalance(const TQString& id, const TQDate& date) const { checkStorage(); return m_storage->totalBalance(id, date); } -void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId) const +void MyMoneyFile::warningMissingRate(const TQString& fromId, const TQString& toId) const { MyMoneySecurity from, to; try { @@ -1109,7 +1109,7 @@ void MyMoneyFile::warningMissingRate(const QString& fromId, const QString& toId) void MyMoneyFile::notify(void) { - QMap<QString, bool>::ConstIterator it; + TQMap<TQString, bool>::ConstIterator it; for(it = d->m_notificationList.begin(); it != d->m_notificationList.end(); ++it) { if(*it) d->m_cache.refresh(it.key()); @@ -1119,7 +1119,7 @@ void MyMoneyFile::notify(void) clearNotification(); } -void MyMoneyFile::addNotification(const QString& id, bool reload) +void MyMoneyFile::addNotification(const TQString& id, bool reload) { if(!id.isEmpty()) d->m_notificationList[id] = reload; @@ -1131,36 +1131,36 @@ void MyMoneyFile::clearNotification() d->m_notificationList.clear(); } -void MyMoneyFile::transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const +void MyMoneyFile::transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const { checkStorage(); m_storage->transactionList(list, filter); } -void MyMoneyFile::transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const +void MyMoneyFile::transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const { checkStorage(); m_storage->transactionList(list, filter); } -const QValueList<MyMoneyTransaction> MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const +const TQValueList<MyMoneyTransaction> MyMoneyFile::transactionList(MyMoneyTransactionFilter& filter) const { - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; transactionList(list, filter); return list; } -const QValueList<MyMoneyPayee> MyMoneyFile::payeeList(void) const +const TQValueList<MyMoneyPayee> MyMoneyFile::payeeList(void) const { - QValueList<MyMoneyPayee> list; + TQValueList<MyMoneyPayee> list; d->m_cache.payee(list); return list; } -QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeStandardAccounts) const +TQString MyMoneyFile::accountToCategory(const TQString& accountId, bool includeStandardAccounts) const { MyMoneyAccount acc; - QString rc; + TQString rc; if(!accountId.isEmpty()) { acc = account(accountId); @@ -1168,15 +1168,15 @@ QString MyMoneyFile::accountToCategory(const QString& accountId, bool includeSta if(!rc.isEmpty()) rc = AccountSeperator + rc; rc = acc.name() + rc; - acc = account(acc.parentAccountId()); + acc = account(acc.tqparentAccountId()); } while(!acc.id().isEmpty() && (includeStandardAccounts || !isStandardAccount(acc.id()))); } return rc; } -QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount::accountTypeE type) const +TQString MyMoneyFile::categoryToAccount(const TQString& category, MyMoneyAccount::accountTypeE type) const { - QString id; + TQString id; // search the category in the expense accounts and if it is not found, try // to locate it in the income accounts @@ -1193,9 +1193,9 @@ QString MyMoneyFile::categoryToAccount(const QString& category, MyMoneyAccount:: return id; } -QString MyMoneyFile::nameToAccount(const QString& name) const +TQString MyMoneyFile::nameToAccount(const TQString& name) const { - QString id; + TQString id; // search the category in the asset accounts and if it is not found, try // to locate it in the liability accounts @@ -1206,20 +1206,20 @@ QString MyMoneyFile::nameToAccount(const QString& name) const return id; } -QString MyMoneyFile::parentName(const QString& name) const +TQString MyMoneyFile::tqparentName(const TQString& name) const { return name.section(AccountSeperator, 0, -2); } -QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString& category) const +TQString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const TQString& category) const { MyMoneyAccount nextBase; - QString level, remainder; + TQString level, remainder; level = category.section(AccountSeperator, 0, 0); remainder = category.section(AccountSeperator, 1); - QStringList list = base.accountList(); - QStringList::ConstIterator it_a; + TQStringList list = base.accountList(); + TQStringList::ConstIterator it_a; for(it_a = list.begin(); it_a != list.end(); ++it_a) { nextBase = account(*it_a); @@ -1230,17 +1230,17 @@ QString MyMoneyFile::locateSubAccount(const MyMoneyAccount& base, const QString& return locateSubAccount(nextBase, remainder); } } - return QString(); + return TQString(); } -QString MyMoneyFile::value(const QString& key) const +TQString MyMoneyFile::value(const TQString& key) const { checkStorage(); return m_storage->value(key); } -void MyMoneyFile::setValue(const QString& key, const QString& val) +void MyMoneyFile::setValue(const TQString& key, const TQString& val) { checkTransaction(__PRETTY_FUNCTION__); @@ -1250,7 +1250,7 @@ void MyMoneyFile::setValue(const QString& key, const QString& val) m_storage->setValue(key, val); } -void MyMoneyFile::deletePair(const QString& key) +void MyMoneyFile::deletePair(const TQString& key) { checkTransaction(__PRETTY_FUNCTION__); @@ -1265,7 +1265,7 @@ void MyMoneyFile::addSchedule(MyMoneySchedule& sched) checkTransaction(__PRETTY_FUNCTION__); MyMoneyTransaction transaction = sched.transaction(); - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -1287,7 +1287,7 @@ void MyMoneyFile::modifySchedule(const MyMoneySchedule& sched) checkTransaction(__PRETTY_FUNCTION__); MyMoneyTransaction transaction = sched.transaction(); - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = transaction.splits().begin(); it_s != transaction.splits().end(); ++it_s) { // the following line will throw an exception if the // account does not exist or is one of the standard accounts @@ -1318,18 +1318,18 @@ void MyMoneyFile::removeSchedule(const MyMoneySchedule& sched) addNotification(sched.id(), false); } -const MyMoneySchedule MyMoneyFile::schedule(const QString& id) const +const MyMoneySchedule MyMoneyFile::schedule(const TQString& id) const { return d->m_cache.schedule(id); } -const QValueList<MyMoneySchedule> MyMoneyFile::scheduleList( - const QString& accountId, +const TQValueList<MyMoneySchedule> MyMoneyFile::scheduleList( + const TQString& accountId, const MyMoneySchedule::typeE type, const MyMoneySchedule::occurenceE occurence, const MyMoneySchedule::paymentTypeE paymentType, - const QDate& startDate, - const QDate& endDate, + const TQDate& startDate, + const TQDate& endDate, const bool overdue) const { checkStorage(); @@ -1338,29 +1338,29 @@ const QValueList<MyMoneySchedule> MyMoneyFile::scheduleList( } -const QStringList MyMoneyFile::consistencyCheck(void) +const TQStringList MyMoneyFile::consistencyCheck(void) { - QValueList<MyMoneyAccount> list; - QValueList<MyMoneyAccount>::Iterator it_a; - QValueList<MyMoneySchedule>::Iterator it_sch; - QValueList<MyMoneyPayee>::Iterator it_p; - QValueList<MyMoneyTransaction>::Iterator it_t; - QValueList<MyMoneyReport>::Iterator it_r; - QStringList accountRebuild; - QStringList::ConstIterator it_c; + TQValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount>::Iterator it_a; + TQValueList<MyMoneySchedule>::Iterator it_sch; + TQValueList<MyMoneyPayee>::Iterator it_p; + TQValueList<MyMoneyTransaction>::Iterator it_t; + TQValueList<MyMoneyReport>::Iterator it_r; + TQStringList accountRebuild; + TQStringList::ConstIterator it_c; - QMap<QString, bool> interestAccounts; + TQMap<TQString, bool> interestAccounts; - MyMoneyAccount parent; + MyMoneyAccount tqparent; MyMoneyAccount child; MyMoneyAccount toplevel; - QString parentId; - QStringList rc; + TQString tqparentId; + TQStringList rc; int problemCount = 0; int unfixedCount = 0; - QString problemAccount; + TQString problemAccount; // check that we have a storage object checkTransaction(__PRETTY_FUNCTION__); @@ -1404,27 +1404,27 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // check for loops in the hierarchy - parentId = (*it_a).parentAccountId(); + tqparentId = (*it_a).tqparentAccountId(); try { bool dropOut = false; - while(!isStandardAccount(parentId) && !dropOut) { - parent = account(parentId); - if(parent.id() == (*it_a).id()) { - // parent loops, so we need to re-parent to toplevel account - // find parent account in our list + while(!isStandardAccount(tqparentId) && !dropOut) { + tqparent = account(tqparentId); + if(tqparent.id() == (*it_a).id()) { + // tqparent loops, so we need to re-tqparent to toplevel account + // find tqparent account in our list problemCount++; - QValueList<MyMoneyAccount>::Iterator it_b; + TQValueList<MyMoneyAccount>::Iterator it_b; for(it_b = list.begin(); it_b != list.end(); ++it_b) { - if((*it_b).id() == parent.id()) { + if((*it_b).id() == tqparent.id()) { if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); - rc << i18n(" * Loop detected between this account and account '%2'.").arg((*it_b).name()); - rc << i18n(" Reparenting account '%2' to top level account '%1'.").arg(toplevel.name(), (*it_a).name()); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); + rc << i18n(" * Loop detected between this account and account '%2'.").tqarg((*it_b).name()); + rc << i18n(" Retqparenting account '%2' to top level account '%1'.").tqarg(toplevel.name(), (*it_a).name()); (*it_a).setParentAccountId(toplevel.id()); - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); - if(accountRebuild.contains((*it_a).id()) == 0) + if(accountRebuild.tqcontains((*it_a).id()) == 0) accountRebuild << (*it_a).id(); dropOut = true; break; @@ -1432,70 +1432,70 @@ const QStringList MyMoneyFile::consistencyCheck(void) } } } - parentId = parent.parentAccountId(); + tqparentId = tqparent.tqparentAccountId(); } } catch(MyMoneyException *e) { - // if we don't know about a parent, we catch it later + // if we don't know about a tqparent, we catch it later delete e; } - // check that the parent exists - parentId = (*it_a).parentAccountId(); + // check that the tqparent exists + tqparentId = (*it_a).tqparentAccountId(); try { - parent = account(parentId); - if((*it_a).accountGroup() != parent.accountGroup()) { + tqparent = account(tqparentId); + if((*it_a).accountGroup() != tqparent.accountGroup()) { problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - // the parent belongs to a different group, so we reconnect to the + // the tqparent belongs to a different group, so we reconnect to the // master group account (asset, liability, etc) to which this account // should belong and update it in the engine. - rc << i18n(" * Parent account '%1' belongs to a different group.").arg(parent.name()); - rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name()); + rc << i18n(" * Parent account '%1' belongs to a different group.").tqarg(tqparent.name()); + rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name()); (*it_a).setParentAccountId(toplevel.id()); // make sure to rebuild the sub-accounts of the top account // and the one we removed this account from - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); - if(accountRebuild.contains(parent.id()) == 0) - accountRebuild << parent.id(); - } else if(!parent.accountList().contains((*it_a).id())) { + if(accountRebuild.tqcontains(tqparent.id()) == 0) + accountRebuild << tqparent.id(); + } else if(!tqparent.accountList().tqcontains((*it_a).id())) { problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - // parent exists, but does not have a reference to the account - rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").arg(parent.name(), problemAccount); - if(accountRebuild.contains(parent.id()) == 0) - accountRebuild << parent.id(); + // tqparent exists, but does not have a reference to the account + rc << i18n(" * Parent account '%1' does not contain '%2' as sub-account.").tqarg(tqparent.name(), problemAccount); + if(accountRebuild.tqcontains(tqparent.id()) == 0) + accountRebuild << tqparent.id(); } } catch(MyMoneyException *e) { delete e; - // apparently, the parent does not exist anymore. we reconnect to the + // aptqparently, the tqparent does not exist anymore. we reconnect to the // master group account (asset, liability, etc) to which this account // should belong and update it in the engine. problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - rc << i18n(" * The parent with id %1 does not exist anymore.").arg(parentId); - rc << i18n(" New parent account is the top level account '%1'.").arg(toplevel.name()); + rc << i18n(" * The tqparent with id %1 does not exist anymore.").tqarg(tqparentId); + rc << i18n(" New tqparent account is the top level account '%1'.").tqarg(toplevel.name()); (*it_a).setParentAccountId(toplevel.id()); addNotification((*it_a).id()); // make sure to rebuild the sub-accounts of the top account - if(accountRebuild.contains(toplevel.id()) == 0) + if(accountRebuild.tqcontains(toplevel.id()) == 0) accountRebuild << toplevel.id(); } - // now check that all the children exist and have the correct type + // now check that all the tqchildren exist and have the correct type for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end(); ++it_c) { // check that the child exists try { @@ -1504,11 +1504,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) problemCount++; if(problemAccount != (*it_a).name()) { problemAccount = (*it_a).name(); - rc << i18n("* Problem with account '%1'").arg(problemAccount); + rc << i18n("* Problem with account '%1'").tqarg(problemAccount); } - rc << i18n(" * Child account with id %1 does not exist anymore.").arg(*it_c); + rc << i18n(" * Child account with id %1 does not exist anymore.").tqarg(*it_c); rc << i18n(" The child account list will be reconstructed."); - if(accountRebuild.contains((*it_a).id()) == 0) + if(accountRebuild.tqcontains((*it_a).id()) == 0) accountRebuild << (*it_a).id(); } } @@ -1539,8 +1539,8 @@ const QStringList MyMoneyFile::consistencyCheck(void) // clear the affected lists for(it_a = list.begin(); it_a != list.end(); ++it_a) { - if(accountRebuild.contains((*it_a).id())) { - rc << QString(" %1").arg((*it_a).name()); + if(accountRebuild.tqcontains((*it_a).id())) { + rc << TQString(" %1").tqarg((*it_a).name()); // clear the account list for(it_c = (*it_a).accountList().begin(); it_c != (*it_a).accountList().end();) { (*it_a).removeAccountId(*it_c); @@ -1551,11 +1551,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) // reconstruct the lists for(it_a = list.begin(); it_a != list.end(); ++it_a) { - QValueList<MyMoneyAccount>::Iterator it; - parentId = (*it_a).parentAccountId(); - if(accountRebuild.contains(parentId)) { + TQValueList<MyMoneyAccount>::Iterator it; + tqparentId = (*it_a).tqparentAccountId(); + if(accountRebuild.tqcontains(tqparentId)) { for(it = list.begin(); it != list.end(); ++it) { - if((*it).id() == parentId) { + if((*it).id() == tqparentId) { (*it).addAccountId((*it_a).id()); break; } @@ -1565,21 +1565,21 @@ const QStringList MyMoneyFile::consistencyCheck(void) // update the engine objects for(it_a = list.begin(); it_a != list.end(); ++it_a) { - if(accountRebuild.contains((*it_a).id())) { + if(accountRebuild.tqcontains((*it_a).id())) { try { m_storage->modifyAccount(*it_a, true); addNotification((*it_a).id()); } catch (MyMoneyException *e) { delete e; - rc << i18n(" * Unable to update account data for account %1 in engine").arg((*it_a).name()); + rc << i18n(" * Unable to update account data for account %1 in engine").tqarg((*it_a).name()); } } } // For some reason, files exist with invalid ids. This has been found in the payee id // so we fix them here - QValueList<MyMoneyPayee> pList = payeeList(); - QMap<QString, QString>payeeConversionMap; + TQValueList<MyMoneyPayee> pList = payeeList(); + TQMap<TQString, TQString>payeeConversionMap; for(it_p = pList.begin(); it_p != pList.end(); ++it_p) { if((*it_p).id().length() > 7) { @@ -1589,20 +1589,20 @@ const QStringList MyMoneyFile::consistencyCheck(void) payee.clearId(); m_storage->addPayee(payee); payeeConversionMap[(*it_p).id()] = payee.id(); - rc << i18n(" * Payee %1 recreated with fixed id").arg(payee.name()); + rc << i18n(" * Payee %1 recreated with fixed id").tqarg(payee.name()); ++problemCount; } } // Fix the transactions - QValueList<MyMoneyTransaction> tList; + TQValueList<MyMoneyTransaction> tList; MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); m_storage->transactionList(tList, filter); // Generate the list of interest accounts for(it_t = tList.begin(); it_t != tList.end(); ++it_t) { const MyMoneyTransaction& t = (*it_t); - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { if((*it_s).action() == MyMoneySplit::ActionInterest) interestAccounts[(*it_s).accountId()] = true; @@ -1610,15 +1610,15 @@ const QStringList MyMoneyFile::consistencyCheck(void) } for(it_t = tList.begin(); it_t != tList.end(); ++it_t) { MyMoneyTransaction t = (*it_t); - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; bool tChanged = false; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { bool sChanged = false; MyMoneySplit s = (*it_s); - if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) { + if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) { s.setPayeeId(payeeConversionMap[s.payeeId()]); sChanged = true; - rc << i18n(" * Payee id updated in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * Payee id updated in split of transaction '%1'.").tqarg(t.id()); ++problemCount; } @@ -1631,27 +1631,27 @@ const QStringList MyMoneyFile::consistencyCheck(void) // use the value as master if the transaction is balanced if(t.splitSum().isZero()) { s.setShares(s.value()); - rc << i18n(" * shares set to value in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * shares set to value in split of transaction '%1'.").tqarg(t.id()); } else { s.setValue(s.shares()); - rc << i18n(" * value set to shares in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * value set to shares in split of transaction '%1'.").tqarg(t.id()); } sChanged = true; ++problemCount; } } catch(MyMoneyException *e) { - rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").arg(t.id(), (*it_s).id(), (*it_s).accountId()); + rc << i18n(" * Split %2 in transaction '%1' contains a reference to invalid account %3. Please fix manually.").tqarg(t.id(), (*it_s).id(), (*it_s).accountId()); ++problemCount; ++unfixedCount; delete e; } // make sure the interest splits are marked correct as such - if(interestAccounts.find(s.accountId()) != interestAccounts.end() + if(interestAccounts.tqfind(s.accountId()) != interestAccounts.end() && s.action() != MyMoneySplit::ActionInterest) { s.setAction(MyMoneySplit::ActionInterest); sChanged = true; - rc << i18n(" * action marked as interest in split of transaction '%1'.").arg(t.id()); + rc << i18n(" * action marked as interest in split of transaction '%1'.").tqarg(t.id()); ++problemCount; } @@ -1666,34 +1666,34 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // Fix the schedules - QValueList<MyMoneySchedule> schList = scheduleList(); + TQValueList<MyMoneySchedule> schList = scheduleList(); for(it_sch = schList.begin(); it_sch != schList.end(); ++it_sch) { MyMoneySchedule sch = (*it_sch); MyMoneyTransaction t = sch.transaction(); bool tChanged = false; - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); bool sChanged = false; - if(payeeConversionMap.find((*it_s).payeeId()) != payeeConversionMap.end()) { + if(payeeConversionMap.tqfind((*it_s).payeeId()) != payeeConversionMap.end()) { s.setPayeeId(payeeConversionMap[s.payeeId()]); sChanged = true; - rc << i18n(" * Payee id updated in split of schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * Payee id updated in split of schedule '%1'.").tqarg((*it_sch).name()); ++problemCount; } if(!(*it_s).value().isZero() && (*it_s).shares().isZero()) { s.setShares(s.value()); sChanged = true; - rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").arg((*it_sch).name()); + rc << i18n(" * Split in scheduled transaction '%1' contained value != 0 and shares == 0.").tqarg((*it_sch).name()); rc << i18n(" Shares set to value."); ++problemCount; } // make sure, we don't have a bankid stored with a split in a schedule if(!(*it_s).bankID().isEmpty()) { - s.setBankID(QString()); + s.setBankID(TQString()); sChanged = true; - rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").arg((*it_sch).name()); + rc << i18n(" * Removed bankid from split in scheduled transaction '%1'.").tqarg((*it_sch).name()); ++problemCount; } @@ -1706,16 +1706,16 @@ const QStringList MyMoneyFile::consistencyCheck(void) // use the value as master if the transaction is balanced if(t.splitSum().isZero()) { s.setShares(s.value()); - rc << i18n(" * shares set to value in split in schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * shares set to value in split in schedule '%1'.").tqarg((*it_sch).name()); } else { s.setValue(s.shares()); - rc << i18n(" * value set to shares in split in schedule '%1'.").arg((*it_sch).name()); + rc << i18n(" * value set to shares in split in schedule '%1'.").tqarg((*it_sch).name()); } sChanged = true; ++problemCount; } } catch(MyMoneyException *e) { - rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").arg((*it_sch).name(), (*it_s).id(), (*it_s).accountId()); + rc << i18n(" * Split %2 in schedule '%1' contains a reference to invalid account %3. Please fix manually.").tqarg((*it_sch).name(), (*it_s).id(), (*it_s).accountId()); ++problemCount; ++unfixedCount; delete e; @@ -1732,16 +1732,16 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // Fix the reports - QValueList<MyMoneyReport> rList = reportList(); + TQValueList<MyMoneyReport> rList = reportList(); for(it_r = rList.begin(); it_r != rList.end(); ++it_r) { MyMoneyReport r = *it_r; - QStringList pList; - QStringList::Iterator it_p; + TQStringList pList; + TQStringList::Iterator it_p; (*it_r).payees(pList); bool rChanged = false; for(it_p = pList.begin(); it_p != pList.end(); ++it_p) { - if(payeeConversionMap.find(*it_p) != payeeConversionMap.end()) { - rc << i18n(" * Payee id updated in report '%1'.").arg((*it_r).name()); + if(payeeConversionMap.tqfind(*it_p) != payeeConversionMap.end()) { + rc << i18n(" * Payee id updated in report '%1'.").tqarg((*it_r).name()); ++problemCount; r.removeReference(*it_p); r.addPayee(payeeConversionMap[*it_p]); @@ -1754,11 +1754,11 @@ const QStringList MyMoneyFile::consistencyCheck(void) } // erase old payee ids - QMap<QString, QString>::Iterator it_m; + TQMap<TQString, TQString>::Iterator it_m; for(it_m = payeeConversionMap.begin(); it_m != payeeConversionMap.end(); ++it_m) { MyMoneyPayee payee = this->payee(it_m.key()); removePayee(payee); - rc << i18n(" * Payee '%1' removed.").arg(payee.id()); + rc << i18n(" * Payee '%1' removed.").tqarg(payee.id()); ++problemCount; } @@ -1768,23 +1768,23 @@ const QStringList MyMoneyFile::consistencyCheck(void) rc << i18n("Finish! Data is consistent."); else rc << i18n("Finish! %1 problem(s) corrected. %2 problem(s) still present.") - .arg(problemCount).arg(unfixedCount); + .tqarg(problemCount).tqarg(unfixedCount); return rc; } -QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& name) +TQString MyMoneyFile::createCategory(const MyMoneyAccount& base, const TQString& name) { checkTransaction(__PRETTY_FUNCTION__); - MyMoneyAccount parent = base; - QString categoryText; + MyMoneyAccount tqparent = base; + TQString categoryText; if(base.id() != expense().id() && base.id() != income().id()) throw new MYMONEYEXCEPTION("Invalid base category"); - QStringList subAccounts = QStringList::split(AccountSeperator, name); - QStringList::Iterator it; + TQStringList subAccounts = TQStringList::split(AccountSeperator, name); + TQStringList::Iterator it; for (it = subAccounts.begin(); it != subAccounts.end(); ++it) { MyMoneyAccount categoryAccount; @@ -1800,9 +1800,9 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n // Only create the account if it doesn't exist try { - QString categoryId = categoryToAccount(categoryText); + TQString categoryId = categoryToAccount(categoryText); if (categoryId.isEmpty()) - addAccount(categoryAccount, parent); + addAccount(categoryAccount, tqparent); else { categoryAccount = account(categoryId); @@ -1812,23 +1812,23 @@ QString MyMoneyFile::createCategory(const MyMoneyAccount& base, const QString& n { qDebug("Unable to add account %s, %s, %s: %s", categoryAccount.name().latin1(), - parent.name().latin1(), + tqparent.name().latin1(), categoryText.latin1(), e->what().latin1()); delete e; } - parent = categoryAccount; + tqparent = categoryAccount; } return categoryToAccount(name); } -const QValueList<MyMoneySchedule> MyMoneyFile::scheduleListEx( int scheduleTypes, +const TQValueList<MyMoneySchedule> MyMoneyFile::scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts) const + TQDate startDate, + const TQStringList& accounts) const { checkStorage(); @@ -1871,7 +1871,7 @@ void MyMoneyFile::removeSecurity(const MyMoneySecurity& security) addNotification(security.id(), false); } -const MyMoneySecurity& MyMoneyFile::security(const QString& id) const +const MyMoneySecurity& MyMoneyFile::security(const TQString& id) const { if(id.isEmpty()) return baseCurrency(); @@ -1879,7 +1879,7 @@ const MyMoneySecurity& MyMoneyFile::security(const QString& id) const return d->m_cache.security(id); } -const QValueList<MyMoneySecurity> MyMoneyFile::securityList(void) const +const TQValueList<MyMoneySecurity> MyMoneyFile::securityList(void) const { checkStorage(); @@ -1933,7 +1933,7 @@ void MyMoneyFile::removeCurrency(const MyMoneySecurity& currency) addNotification(currency.id(), false); } -const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const +const MyMoneySecurity& MyMoneyFile::currency(const TQString& id) const { if(id.isEmpty()) return baseCurrency(); @@ -1944,14 +1944,14 @@ const MyMoneySecurity& MyMoneyFile::currency(const QString& id) const return curr; } -const QValueList<MyMoneySecurity> MyMoneyFile::currencyList(void) const +const TQValueList<MyMoneySecurity> MyMoneyFile::currencyList(void) const { checkStorage(); return m_storage->currencyList(); } -const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString& second) const +const TQString& MyMoneyFile::foreignCurrency(const TQString& first, const TQString& second) const { if(baseCurrency().id() == second) return first; @@ -1961,7 +1961,7 @@ const QString& MyMoneyFile::foreignCurrency(const QString& first, const QString& const MyMoneySecurity& MyMoneyFile::baseCurrency(void) const { if(d->m_baseCurrency.id().isEmpty()) { - QString id = QString(value("kmm-baseCurrency")); + TQString id = TQString(value("kmm-baseCurrency")); if(!id.isEmpty()) d->m_baseCurrency = currency(id); } @@ -1986,7 +1986,7 @@ void MyMoneyFile::setBaseCurrency(const MyMoneySecurity& curr) void MyMoneyFile::addPrice(const MyMoneyPrice& price) { - if(price.rate(QString()).isZero()) + if(price.rate(TQString()).isZero()) return; checkTransaction(__PRETTY_FUNCTION__); @@ -2007,11 +2007,11 @@ void MyMoneyFile::removePrice(const MyMoneyPrice& price) m_storage->removePrice(price); } -const MyMoneyPrice MyMoneyFile::price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const +const MyMoneyPrice MyMoneyFile::price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const { checkStorage(); - QString to(toId); + TQString to(toId); if(to.isEmpty()) to = value("kmm-baseCurrency"); // if some id is missing, we can return an empty price object @@ -2039,11 +2039,11 @@ const MyMoneyPriceList MyMoneyFile::priceList(void) const return m_storage->priceList(); } -bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const +bool MyMoneyFile::hasAccount(const TQString& id, const TQString& name) const { MyMoneyAccount acc = d->m_cache.account(id); - QStringList list = acc.accountList(); - QStringList::ConstIterator it; + TQStringList list = acc.accountList(); + TQStringList::ConstIterator it; bool rc = false; for(it = list.begin(); rc == false && it != list.end(); ++it) { MyMoneyAccount a = d->m_cache.account(*it); @@ -2053,7 +2053,7 @@ bool MyMoneyFile::hasAccount(const QString& id, const QString& name) const return rc; } -const QValueList<MyMoneyReport> MyMoneyFile::reportList( void ) const +const TQValueList<MyMoneyReport> MyMoneyFile::reportList( void ) const { checkStorage(); @@ -2089,7 +2089,7 @@ unsigned MyMoneyFile::countReports(void) const return m_storage->countReports(); } -const MyMoneyReport MyMoneyFile::report( const QString& id ) const +const MyMoneyReport MyMoneyFile::report( const TQString& id ) const { checkStorage(); @@ -2107,7 +2107,7 @@ void MyMoneyFile::removeReport(const MyMoneyReport& report) } -const QValueList<MyMoneyBudget> MyMoneyFile::budgetList( void ) const +const TQValueList<MyMoneyBudget> MyMoneyFile::budgetList( void ) const { checkStorage(); @@ -2124,7 +2124,7 @@ void MyMoneyFile::addBudget( MyMoneyBudget& budget ) m_storage->addBudget( budget ); } -const MyMoneyBudget MyMoneyFile::budgetByName(const QString& name) const +const MyMoneyBudget MyMoneyFile::budgetByName(const TQString& name) const { checkStorage(); @@ -2150,7 +2150,7 @@ unsigned MyMoneyFile::countBudgets(void) const return m_storage->countBudgets(); } -const MyMoneyBudget MyMoneyFile::budget( const QString& id ) const +const MyMoneyBudget MyMoneyFile::budget( const TQString& id ) const { checkStorage(); @@ -2175,17 +2175,17 @@ bool MyMoneyFile::isReferenced(const MyMoneyObject& obj, const MyMoneyFileBitArr return m_storage->isReferenced(obj, skipChecks); } -bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const +bool MyMoneyFile::checkNoUsed(const TQString& accId, const TQString& no) const { // by definition, an empty string or a non-numeric string is not used - QRegExp exp(QString("(.*\\D)?(\\d+)(\\D.*)?")); + TQRegExp exp(TQString("(.*\\D)?(\\d+)(\\D.*)?")); if(no.isEmpty() || exp.search(no) == -1) return false; MyMoneyTransactionFilter filter; filter.addAccount(accId); - QValueList<MyMoneyTransaction> transactions = transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try { MyMoneySplit split; @@ -2202,14 +2202,14 @@ bool MyMoneyFile::checkNoUsed(const QString& accId, const QString& no) const return false; } -QString MyMoneyFile::highestCheckNo(const QString& accId) const +TQString MyMoneyFile::highestCheckNo(const TQString& accId) const { unsigned64 lno = 0, cno; - QString no; + TQString no; MyMoneyTransactionFilter filter; filter.addAccount(accId); - QValueList<MyMoneyTransaction> transactions = transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); while ( it_t != transactions.end() ) { try { // Test whether the transaction also includes a split into @@ -2243,7 +2243,7 @@ void MyMoneyFile::preloadCache(void) checkStorage(); d->m_cache.clear(); - QValueList<MyMoneyAccount> a_list; + TQValueList<MyMoneyAccount> a_list; m_storage->accountList(a_list); d->m_cache.preloadAccount(a_list); d->m_cache.preloadPayee(m_storage->payeeList()); @@ -2256,7 +2256,7 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const { bool rc = false; if(t.splitCount() == 2) { - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { MyMoneyAccount acc = account((*it_s).accountId()); if(acc.isIncomeExpense()) @@ -2270,8 +2270,8 @@ bool MyMoneyFile::isTransfer(const MyMoneyTransaction& t) const bool MyMoneyFile::referencesClosedAccount(const MyMoneyTransaction& t) const { - QValueList<MyMoneySplit>::const_iterator it_s; - const QValueList<MyMoneySplit>& list = t.splits(); + TQValueList<MyMoneySplit>::const_iterator it_s; + const TQValueList<MyMoneySplit>& list = t.splits(); for(it_s = list.begin(); it_s != list.end(); ++it_s) { if(referencesClosedAccount(*it_s)) break; diff --git a/kmymoney2/mymoney/mymoneyfile.h b/kmymoney2/mymoney/mymoneyfile.h index 39552c9..c59f9da 100644 --- a/kmymoney2/mymoney/mymoneyfile.h +++ b/kmymoney2/mymoney/mymoneyfile.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qobject.h> -#include <qstring.h> -#include <qmap.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqvaluelist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -90,22 +90,22 @@ class MyMoneyTransactionFilter; * general account maintenance functions. The method reparentAccount() is * available to move an account from one superordinate account to another. * account() and accountList() are used to retrieve a single instance or a - * QValueList of MyMoneyAccount objects. + * TQValueList of MyMoneyAccount objects. * * The methods addInstitution(), modifyInstitution() and removeInstitution() * implement the general institution maintenance functions. institution() and * institutionList() are used to retrieve a single instance or a - * QValueList of MyMoneyInstitution objects. + * TQValueList of MyMoneyInstitution objects. * * The methods addPayee(), modifyPayee() and removePayee() * implement the general institution maintenance functions. * payee() and payeeList() are used to retrieve a single instance or a - * QValueList of MyMoneyPayee objects. + * TQValueList of MyMoneyPayee objects. * * The methods addTransaction(), modifyTransaction() and removeTransaction() * implement the general transaction maintenance functions. * transaction() and transactionList() are used to retrieve - * a single instance or a QValueList of MyMoneyTransaction objects. + * a single instance or a TQValueList of MyMoneyTransaction objects. * * The methods addSecurity(), modifySecurity() and removeSecurity() * implement the general access to equities held in the engine. @@ -134,9 +134,10 @@ class MyMoneyTransactionFilter; * while the engine code is running. The MyMoneyException:: object * describes the problem. */ -class KMYMONEY_EXPORT MyMoneyFile : public QObject +class KMYMONEY_EXPORT MyMoneyFile : public TQObject { Q_OBJECT + TQ_OBJECT public: class MyMoneyNotifier @@ -329,13 +330,13 @@ public: /** * Retrieve the opening balance transaction for the account @p acc. - * If there is no opening balance transaction, QString() will be returned. + * If there is no opening balance transaction, TQString() will be returned. * * @param acc reference to account for which the opening balance transaction * should be retrieved - * @return QString id for the transaction, or QString() if no transaction exists + * @return TQString id for the transaction, or TQString() if no transaction exists */ - QString openingBalanceTransaction(const MyMoneyAccount& acc) const; + TQString openingBalanceTransaction(const MyMoneyAccount& acc) const; /** * This method returns an indicator if the MyMoneyFile object has been @@ -356,7 +357,7 @@ public: /** * Adds an institution to the file-global institution pool. A * respective institution-ID will be generated for this object. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -401,15 +402,15 @@ public: * b) the account must not have an id assigned * c) the transaction list must be empty * d) the account must not have any sub-ordinate accounts - * e) the account must have no parent account + * e) the account must have no tqparent account * f) the account must not have any reference to a MyMoneyFile object * * An exception will be thrown upon error conditions. * * @param account The complete account information in a MyMoneyAccount object - * @param parent The complete account information of the parent account + * @param tqparent The complete account information of the tqparent account */ - void addAccount(MyMoneyAccount& account, MyMoneyAccount& parent); + void addAccount(MyMoneyAccount& account, MyMoneyAccount& tqparent); /** * Modifies an already existing account in the file global account pool. @@ -421,14 +422,14 @@ public: void modifyAccount(const MyMoneyAccount& account); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * moves splits from one account to another @@ -438,7 +439,7 @@ public: * * @return the number of modified splits */ - unsigned int moveSplits(const QString& oldAccount, const QString& newAccount); + unsigned int moveSplits(const TQString& oldAccount, const TQString& newAccount); /** * This method is used to determince, if the account with the @@ -447,7 +448,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - bool hasActiveSplits(const QString& id) const; + bool hasActiveSplits(const TQString& id) const; /** * This method is used to check whether a given @@ -458,7 +459,7 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - bool isStandardAccount(const QString& id) const; + bool isStandardAccount(const TQString& id) const; /** * Returns @a true, if transaction @p t is a transfer transaction. @@ -472,11 +473,11 @@ public: * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - void setAccountName(const QString& id, const QString& name) const; + void setAccountName(const TQString& id, const TQString& name) const; /** * Deletes an existing account from the file global account pool @@ -503,7 +504,7 @@ public: * @param account_list Reference to a list of account IDs to be deleted. * @param level Parameter to keep track of recursion level (do not pass a value here). */ - void removeAccountList(const QStringList& account_list, unsigned int level = 0); + void removeAccountList(const TQStringList& account_list, unsigned int level = 0); /** * This member function checks all accounts identified by account_list @@ -515,17 +516,17 @@ public: * If the recursion level exceeds 100 (some arbitrary number which seems a good * maximum), an exception is thrown. * - * @param account_list A QStringList with account IDs that need to be checked. + * @param account_list A TQStringList with account IDs that need to be checked. * @param level (optional) Optional parameter to indicate recursion level. * @return Returns 'false' if at least one account has been found that * is still referenced by a transaction. */ - bool hasOnlyUnusedAccounts(const QStringList& account_list, unsigned int level = 0); + bool hasOnlyUnusedAccounts(const TQStringList& account_list, unsigned int level = 0); /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated for this object. The ID is stored - * as QString in the object passed as argument. + * as TQString in the object passed as argument. * Splits must reference valid accounts and valid payees. The payee * id can be empty. * @@ -552,20 +553,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - const MyMoneyTransaction transaction(const QString& id) const; + const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - const MyMoneyTransaction transaction(const QString& account, const int idx) const; + const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method is used to pull a list of transactions from the file @@ -578,13 +579,13 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList<MyMoneyTransaction> + * @return set of transactions in form of a TQValueList<MyMoneyTransaction> */ - const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; + const TQValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; - void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; - void transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; /** * This method is used to remove a transaction from the transaction @@ -602,10 +603,10 @@ public: * transactions are included in the balance. * * @param id id of the account in question - * @param date return balance for specific date (default = QDate()) + * @param date return balance for specific date (default = TQDate()) * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney balance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney balance(const TQString& id, const TQDate& date = TQDate()) const; /** * This method is used to return the actual balance of an account @@ -615,34 +616,34 @@ public: * transactions are included in the balance. * * @param id id of the account in question - * @param date return balance for specific date (default = QDate()) + * @param date return balance for specific date (default = TQDate()) * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney totalBalance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date = TQDate()) const; /** * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - unsigned int transactionCount(const QString& account = QString()) const; + unsigned int transactionCount(const TQString& account = TQString()) const; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - const QMap<QString, unsigned long> transactionCountMap(void) const; + const TQMap<TQString, unsigned long> transactionCountMap(void) const; /** * This method returns the number of institutions currently known to file @@ -667,7 +668,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - const MyMoneyInstitution& institution(const QString& id) const; + const MyMoneyInstitution& institution(const TQString& id) const; /** * This method returns a list of the institutions @@ -675,16 +676,16 @@ public: * * @param list reference to the list. It will be cleared by this method first */ - void institutionList(QValueList<MyMoneyInstitution>& list) const; + void institutionList(TQValueList<MyMoneyInstitution>& list) const; /** * This method returns a list of the institutions * inside a MyMoneyFile object. This is a convenience method * to the one above * - * @return QValueList containing the institution objects + * @return TQValueList containing the institution objects */ - const QValueList<MyMoneyInstitution> institutionList(void) const; + const TQValueList<MyMoneyInstitution> institutionList(void) const; /** * Returns the account addressed by its id. @@ -693,7 +694,7 @@ public: * @return MyMoneyAccount object carrying the @p id. An exception is thrown * if the id is unknown */ - const MyMoneyAccount& account(const QString& id) const; + const MyMoneyAccount& account(const TQString& id) const; /** * Returns the account addressed by its name. @@ -702,7 +703,7 @@ public: * @return First MyMoneyAccount object found carrying the @p name. * An empty MyMoneyAccount object will be returned if the name is not found. */ - const MyMoneyAccount& accountByName(const QString& name) const; + const MyMoneyAccount& accountByName(const TQString& name) const; /** * Returns the sub-account addressed by its name. @@ -712,7 +713,7 @@ public: * @return First MyMoneyAccount object found carrying the @p name. * An empty MyMoneyAccount object will be returned if the name is not found. */ - const MyMoneyAccount& subAccountByName(const MyMoneyAccount& acc, const QString& name) const; + const MyMoneyAccount& subAccountByName(const MyMoneyAccount& acc, const TQString& name) const; /** * This method returns a list of accounts inside a MyMoneyFile object. @@ -720,14 +721,14 @@ public: * the returned list contains all accounts, otherwise only those referenced * in the id-list. * - * @param list reference to QValueList receiving the account objects - * @param idlist QStringList of account ids of those accounts that + * @param list reference to TQValueList receiving the account objects + * @param idlist TQStringList of account ids of those accounts that * should be returned. If this list is empty, all accounts * currently known will be returned. * * @param recursive if @p true, then recurse in all found accounts. The default is @p false */ - void accountList(QValueList<MyMoneyAccount>& list, const QStringList& idlist = QStringList(), const bool recursive = false) const; + void accountList(TQValueList<MyMoneyAccount>& list, const TQStringList& idlist = TQStringList(), const bool recursive = false) const; /** * This method is used to convert an account id to a string representation @@ -735,13 +736,13 @@ public: * is part of a hierarchy, the category name will be the concatenation of * the single account names seperated by MyMoneyAccount::AccountSeperator. * - * @param accountId QString reference of the account's id + * @param accountId TQString reference of the account's id * @param includeStandardAccounts if true, the standard top account will be part * of the name, otherwise it will not be included (default is @c false) * - * @return QString of the constructed name. + * @return TQString of the constructed name. */ - QString accountToCategory(const QString& accountId, bool includeStandardAccounts = false) const; + TQString accountToCategory(const TQString& accountId, bool includeStandardAccounts = false) const; /** * This method is used to convert a string representing a category to @@ -749,13 +750,13 @@ public: * representing a hierarchy of accounts. They have to be seperated by * MyMoneyAccount::AccountSeperator. * - * @param category const reference to QString containing the category + * @param category const reference to TQString containing the category * @param type account type if a specific type is required (defaults to UnknownAccountType) * - * @return QString of the corresponding account. If account was not found + * @return TQString of the corresponding account. If account was not found * the return value will be an empty string. */ - QString categoryToAccount(const QString& category, MyMoneyAccount::accountTypeE type = MyMoneyAccount::UnknownAccountType) const; + TQString categoryToAccount(const TQString& category, MyMoneyAccount::accountTypeE type = MyMoneyAccount::UnknownAccountType) const; /** * This method is used to convert a string representing an asset or @@ -763,21 +764,21 @@ public: * concatenation of multiple accounts representing a hierarchy of * accounts. They have to be seperated by MyMoneyAccount::AccountSeperator. * - * @param name const reference to QString containing the account name + * @param name const reference to TQString containing the account name * - * @return QString of the corresponding account. If account was not found + * @return TQString of the corresponding account. If account was not found * the return value will be an empty string. */ - QString nameToAccount(const QString& name) const; + TQString nameToAccount(const TQString& name) const; /** - * This method is used to extract the parent part of an account hierarchy + * This method is used to extract the tqparent part of an account hierarchy * name who's parts are seperated by MyMoneyAccount::AccountSeperator. * * @param name full account name - * @return parent name (full account name excluding the last part) + * @return tqparent name (full account name excluding the last part) */ - QString parentName(const QString& name) const; + TQString tqparentName(const TQString& name) const; /** * This method is used to create a new payee @@ -792,22 +793,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - const MyMoneyPayee& payee(const QString& id) const; + const MyMoneyPayee& payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - const MyMoneyPayee& payeeByName(const QString& payee) const; + const MyMoneyPayee& payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -833,39 +834,39 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyPayee> containing the payee information + * @return TQValueList<MyMoneyPayee> containing the payee information */ - const QValueList<MyMoneyPayee> payeeList(void) const; + const TQValueList<MyMoneyPayee> payeeList(void) const; /** * This method is used to extract a value from the storage's * KeyValueContainer. For details see MyMoneyKeyValueContainer::value(). * - * @param key const reference to QString containing the key - * @return QString containing the value + * @param key const reference to TQString containing the key + * @return TQString containing the value */ - QString value(const QString& key) const; + TQString value(const TQString& key) const; /** * This method is used to set a value in the storage's * KeyValueContainer. For details see MyMoneyKeyValueContainer::setValue(). * - * @param key const reference to QString containing the key - * @param val const reference to QString containing the value + * @param key const reference to TQString containing the key + * @param val const reference to TQString containing the value * * @note Keys starting with the leadin @p kmm- are reserved for internal use * by the MyMoneyFile object. */ - void setValue(const QString& key, const QString& val); + void setValue(const TQString& key, const TQString& val); /** * This method is used to delete a key-value-pair from the * storage's KeyValueContainer identified by the parameter * @p key. For details see MyMoneyKeyValueContainer::deletePair(). * - * @param key const reference to QString containing the key + * @param key const reference to TQString containing the key */ - void deletePair(const QString& key); + void deletePair(const TQString& key); /** * This method is used to add a scheduled transaction to the engine. @@ -905,10 +906,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySchedule schedule(const QString& id) const; + const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to extract a list of scheduled transactions @@ -916,7 +917,7 @@ public: * * @param accountId only search for scheduled transactions that reference * account @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -928,36 +929,36 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList<MyMoneySchedule> list of schedule objects. + * @return const TQValueList<MyMoneySchedule> list of schedule objects. */ - const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(), + const TQValueList<MyMoneySchedule> scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - const QStringList consistencyCheck(void); + const TQStringList consistencyCheck(void); /** * MyMoneyFile::OpeningBalancesPrefix is a special string used * to generate the name for opening balances accounts. See openingBalanceAccount() * for details. */ - static const QString OpeningBalancesPrefix; + static const TQString OpeningBalancesPrefix; /** * MyMoneyFile::AccountSeperator is used as the seperator * between account names to form a hierarchy. */ - static const QString AccountSeperator; + static const TQString AccountSeperator; /** * createCategory creates a category from a text name. @@ -966,7 +967,7 @@ public: * already exist. e.g if name = Bills:Credit Card and * base = expense(), Bills will first be checked to see if * it exists and created if not. Credit Card will then - * be created with Bills as it's parent. The Credit Card account + * be created with Bills as it's tqparent. The Credit Card account * will have it's id returned. * * @param base The base account (expense or income) @@ -977,13 +978,13 @@ public: * @exception An exception will be thrown, if @p base is not equal * expense() or income(). **/ - QString createCategory(const MyMoneyAccount& base, const QString& name); + TQString createCategory(const MyMoneyAccount& base, const TQString& name); - const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, + const TQValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to add a new security object to the engine. @@ -1024,15 +1025,15 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - const MyMoneySecurity& security(const QString& id) const; + const MyMoneySecurity& security(const TQString& id) const; /** * This method is used to retrieve a list of all MyMoneySecurity objects. */ - const QValueList<MyMoneySecurity> securityList(void) const; + const TQValueList<MyMoneySecurity> securityList(void) const; /** * This method is used to add a new currency object to the engine. @@ -1072,10 +1073,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity& currency(const QString& id) const; + const MyMoneySecurity& currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -1083,9 +1084,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects. + * @return TQValueList of all MyMoneySecurity objects. */ - const QValueList<MyMoneySecurity> currencyList(void) const; + const TQValueList<MyMoneySecurity> currencyList(void) const; /** * This method retrieves a MyMoneySecurity object representing @@ -1105,7 +1106,7 @@ public: * currency ids. If second is the base currency id then @a first * is returned otherwise @a second is returned. */ - const QString& foreignCurrency(const QString& first, const QString& second) const; + const TQString& foreignCurrency(const TQString& first, const TQString& second) const; /** * This method allows to select the base currency. It does @@ -1144,7 +1145,7 @@ public: * @return price found as MyMoneyPrice object * @note This throws an exception when the base currency is not set and toId is empty */ - const MyMoneyPrice price(const QString& fromId, const QString& toId = QString(), const QDate& date = QDate::currentDate(), const bool exactDate = false) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId = TQString(), const TQDate& date = TQDate::tqcurrentDate(), const bool exactDate = false) const; /** * This method returns a list of all prices. @@ -1162,7 +1163,7 @@ public: * @retval true account with name @p name found as subaccounts * @retval false no subaccount present with that name */ - bool hasAccount(const QString& id, const QString& name) const; + bool hasAccount(const TQString& id, const TQString& name) const; /** * This method is used to retrieve the list of all reports @@ -1170,14 +1171,14 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - const QValueList<MyMoneyReport> reportList( void ) const; + const TQValueList<MyMoneyReport> reportList( void ) const; /** * Adds a report to the file-global institution pool. A * respective report-ID will be generated for this object. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -1210,10 +1211,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - const MyMoneyReport report( const QString& id ) const; + const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -1231,14 +1232,14 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - const QValueList<MyMoneyBudget> budgetList( void ) const; + const TQValueList<MyMoneyBudget> budgetList( void ) const; /** * Adds a budget to the file-global institution pool. A * respective budget-ID will be generated for this object. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -1253,11 +1254,11 @@ public: * name of a budget. * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget refernce to object of budget */ - const MyMoneyBudget budgetByName(const QString& budget) const; + const MyMoneyBudget budgetByName(const TQString& budget) const; /** @@ -1284,10 +1285,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - const MyMoneyBudget budget( const QString& id ) const; + const MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -1334,7 +1335,7 @@ public: * @retval false @p no is not in use * @retval true @p no is already assigned */ - bool checkNoUsed(const QString& accId, const QString& no) const; + bool checkNoUsed(const TQString& accId, const TQString& no) const; /** * This method returns the highest assigned check no for @@ -1343,7 +1344,7 @@ public: * @param accId id of account to be scanned * @return highest check no. used */ - QString highestCheckNo(const QString& accId) const; + TQString highestCheckNo(const TQString& accId) const; /** * Clear all internal caches (used internally for performance measurements) @@ -1373,11 +1374,11 @@ private: MyMoneyFile& operator=(MyMoneyFile&); // not allowed for singleton MyMoneyFile(const MyMoneyFile&); // not allowed for singleton - QString locateSubAccount(const MyMoneyAccount& base, const QString& category) const; + TQString locateSubAccount(const MyMoneyAccount& base, const TQString& category) const; void ensureDefaultCurrency(MyMoneyAccount& acc) const; - void warningMissingRate(const QString& fromId, const QString& toId) const; + void warningMissingRate(const TQString& fromId, const TQString& toId) const; /** * This method creates an opening balances account. The name is constructed @@ -1400,7 +1401,7 @@ private: * @param reload reload the object (@c true) or not (@c false). The default is @c true * @see attach, detach */ - void addNotification(const QString& id, bool reload = true); + void addNotification(const TQString& id, bool reload = true); /** * This method is used to clear the notification list diff --git a/kmymoney2/mymoney/mymoneyfiletest.cpp b/kmymoney2/mymoney/mymoneyfiletest.cpp index e081fa0..72dd006 100644 --- a/kmymoney2/mymoney/mymoneyfiletest.cpp +++ b/kmymoney2/mymoney/mymoneyfiletest.cpp @@ -19,8 +19,8 @@ #include <memory> #include <unistd.h> -#include <qfile.h> -#include <qdatastream.h> +#include <tqfile.h> +#include <tqdatastream.h> MyMoneyFileTest:: MyMoneyFileTest () {} @@ -66,9 +66,9 @@ void MyMoneyFileTest::testAddOneInstitution() { // MyMoneyInstitution institution_file("", institution); MyMoneyInstitution institution_id("I000002", institution); MyMoneyInstitution institution_noname(institution); - institution_noname.setName(QString()); + institution_noname.setName(TQString()); - QString id; + TQString id; CPPUNIT_ASSERT(m->institutionCount() == 0); storage->m_dirty = false; @@ -117,7 +117,7 @@ void MyMoneyFileTest::testAddTwoInstitutions() { institution.setManager("manager"); institution.setSortcode("sortcode"); - QString id; + TQString id; storage->m_dirty = false; MyMoneyFileTransaction ft; @@ -228,7 +228,7 @@ void MyMoneyFileTest::testInstitutionRetrieval () { } void MyMoneyFileTest::testInstitutionListRetrieval () { - QValueList<MyMoneyInstitution> list; + TQValueList<MyMoneyInstitution> list; storage->m_dirty = false; list = m->institutionList(); @@ -242,7 +242,7 @@ void MyMoneyFileTest::testInstitutionListRetrieval () { CPPUNIT_ASSERT(m->dirty() == false); CPPUNIT_ASSERT(list.count() == 2); - QValueList<MyMoneyInstitution>::ConstIterator it; + TQValueList<MyMoneyInstitution>::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).name() == "institution1"); @@ -380,11 +380,11 @@ void MyMoneyFileTest::testAddAccounts() { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->asset(); - m->addAccount(a, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(a, tqparent); ft.commit(); CPPUNIT_ASSERT(m->accountCount() == 6); - CPPUNIT_ASSERT(a.parentAccountId() == "AStd::Asset"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "AStd::Asset"); CPPUNIT_ASSERT(a.id() == "A000001"); CPPUNIT_ASSERT(a.institutionId() == "I000001"); CPPUNIT_ASSERT(m->dirty() == true); @@ -403,8 +403,8 @@ void MyMoneyFileTest::testAddAccounts() { // try to add this account again, should not work ft.restart(); try { - MyMoneyAccount parent = m->asset(); - m->addAccount(a, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(a, tqparent); CPPUNIT_FAIL("Expecting exception!"); } catch(MyMoneyException *e) { ft.commit(); @@ -434,12 +434,12 @@ void MyMoneyFileTest::testAddAccounts() { b.setInstitutionId(institution.id()); ft.restart(); try { - MyMoneyAccount parent = m->asset(); - m->addAccount(b, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(b, tqparent); ft.commit(); CPPUNIT_ASSERT(m->dirty() == true); CPPUNIT_ASSERT(b.id() == "A000002"); - CPPUNIT_ASSERT(b.parentAccountId() == "AStd::Asset"); + CPPUNIT_ASSERT(b.tqparentAccountId() == "AStd::Asset"); CPPUNIT_ASSERT(m->accountCount() == 7); institution = m->institution("I000001"); @@ -534,24 +534,24 @@ void MyMoneyFileTest::testModifyAccount() { } } -void MyMoneyFileTest::testReparentAccount() { +void MyMoneyFileTest::testRetqparentAccount() { testAddAccounts(); storage->m_dirty = false; MyMoneyAccount p = m->account("A000001"); MyMoneyAccount q = m->account("A000002"); - MyMoneyAccount o = m->account(p.parentAccountId()); + MyMoneyAccount o = m->account(p.tqparentAccountId()); // make A000001 a child of A000002 MyMoneyFileTransaction ft; try { - CPPUNIT_ASSERT(p.parentAccountId() != q.id()); + CPPUNIT_ASSERT(p.tqparentAccountId() != q.id()); CPPUNIT_ASSERT(o.accountCount() == 2); CPPUNIT_ASSERT(q.accountCount() == 0); m->reparentAccount(p, q); ft.commit(); CPPUNIT_ASSERT(m->dirty() == true); - CPPUNIT_ASSERT(p.parentAccountId() == q.id()); + CPPUNIT_ASSERT(p.tqparentAccountId() == q.id()); CPPUNIT_ASSERT(q.accountCount() == 1); CPPUNIT_ASSERT(q.id() == "A000002"); CPPUNIT_ASSERT(p.id() == "A000001"); @@ -566,7 +566,7 @@ void MyMoneyFileTest::testReparentAccount() { } void MyMoneyFileTest::testRemoveStdAccount(const MyMoneyAccount& acc) { - QString txt("Exception expected while removing account "); + TQString txt("Exception expected while removing account "); txt += acc.id(); MyMoneyFileTransaction ft; try { @@ -585,7 +585,7 @@ void MyMoneyFileTest::testRemoveAccount() { CPPUNIT_ASSERT(m->accountCount() == 7); storage->m_dirty = false; - QString id; + TQString id; MyMoneyAccount p = m->account("A000001"); MyMoneyFileTransaction ft; @@ -624,7 +624,7 @@ void MyMoneyFileTest::testRemoveAccount() { } void MyMoneyFileTest::testRemoveAccountTree() { - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount a = m->account("A000002"); MyMoneyFileTransaction ft; @@ -646,10 +646,10 @@ void MyMoneyFileTest::testRemoveAccountTree() { delete e; } - // make sure that children are re-parented to parent account + // make sure that tqchildren are re-tqparented to tqparent account try { a = m->account("A000001"); - CPPUNIT_ASSERT(a.parentAccountId() == m->asset().id()); + CPPUNIT_ASSERT(a.tqparentAccountId() == m->asset().id()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception!"); @@ -658,7 +658,7 @@ void MyMoneyFileTest::testRemoveAccountTree() { } void MyMoneyFileTest::testAccountListRetrieval () { - QValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount> list; storage->m_dirty = false; m->accountList(list); @@ -690,9 +690,9 @@ void MyMoneyFileTest::testAddTransaction () { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->expense(); - m->addAccount(exp1, parent); - m->addAccount(exp2, parent); + MyMoneyAccount tqparent = m->expense(); + m->addAccount(exp1, tqparent); + m->addAccount(exp2, tqparent); ft.commit(); } catch(MyMoneyException *e) { delete e; @@ -702,7 +702,7 @@ void MyMoneyFileTest::testAddTransaction () { // fake the last modified flag to check that the // date is updated when we add the transaction MyMoneyAccount a = m->account("A000001"); - a.setLastModified(QDate(1,2,3)); + a.setLastModified(TQDate(1,2,3)); ft.restart(); try { m->modifyAccount(a); @@ -715,10 +715,10 @@ void MyMoneyFileTest::testAddTransaction () { CPPUNIT_ASSERT(m->accountCount() == 9); a = m->account("A000001"); - CPPUNIT_ASSERT(a.lastModified() == QDate(1,2,3)); + CPPUNIT_ASSERT(a.lastModified() == TQDate(1,2,3)); // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -760,17 +760,17 @@ void MyMoneyFileTest::testAddTransaction () { ft.restart(); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2002,2,1)); - CPPUNIT_ASSERT(t.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1)); + CPPUNIT_ASSERT(t.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->dirty() == true); // check the balance of the accounts a = m->account("A000001"); - CPPUNIT_ASSERT(a.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(a.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.balance() == MyMoneyMoney(-1000)); MyMoneyAccount b = m->account("A000003"); - CPPUNIT_ASSERT(b.lastModified() == QDate::currentDate()); + CPPUNIT_ASSERT(b.lastModified() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(b.balance() == MyMoneyMoney(1000)); storage->m_dirty = false; @@ -859,7 +859,7 @@ void MyMoneyFileTest::testModifyTransactionNewPostDate() { testAddTransaction(); MyMoneyTransaction t = m->transaction("T000000000000000001"); - t.setPostDate(QDate(2004,2,1)); + t.setPostDate(TQDate(2004,2,1)); storage->m_dirty = false; MyMoneyFileTransaction ft; @@ -867,7 +867,7 @@ void MyMoneyFileTest::testModifyTransactionNewPostDate() { m->modifyTransaction(t); ft.commit(); t = m->transaction("T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2004,2,1)); + CPPUNIT_ASSERT(t.postDate() == TQDate(2004,2,1)); t = m->transaction("A000001", 0); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); CPPUNIT_ASSERT(m->dirty() == true); @@ -907,7 +907,7 @@ void MyMoneyFileTest::testModifyTransactionNewAccount() { m->modifyTransaction(t); ft.commit(); t = m->transaction("T000000000000000001"); - CPPUNIT_ASSERT(t.postDate() == QDate(2002,2,1)); + CPPUNIT_ASSERT(t.postDate() == TQDate(2002,2,1)); t = m->transaction("A000002", 0); CPPUNIT_ASSERT(m->dirty() == true); /* removed with MyMoneyAccount::Transaction @@ -986,7 +986,7 @@ void MyMoneyFileTest::testBalanceTotal() { MyMoneyTransaction t; // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -1135,7 +1135,7 @@ void MyMoneyFileTest::testAddTransactionStd() { a = m->account("A000001"); // construct a transaction and add it to the pool - t.setPostDate(QDate(2002,2,1)); + t.setPostDate(TQDate(2002,2,1)); t.setMemo("Memotext"); MyMoneySplit split1; @@ -1219,7 +1219,7 @@ void MyMoneyFileTest::testAttachStorage() { void MyMoneyFileTest::testAccount2Category() { - testReparentAccount(); + testRetqparentAccount(); CPPUNIT_ASSERT(m->accountToCategory("A000001") == "Account2:Account1"); CPPUNIT_ASSERT(m->accountToCategory("A000002") == "Account2"); } @@ -1265,7 +1265,7 @@ void MyMoneyFileTest::testHasAccount() { m->addAccount(a, b); ft.commit(); CPPUNIT_ASSERT(m->accountCount() == 8); - CPPUNIT_ASSERT(a.parentAccountId() == "A000001"); + CPPUNIT_ASSERT(a.tqparentAccountId() == "A000001"); CPPUNIT_ASSERT(m->hasAccount("A000001", "Account3") == true); CPPUNIT_ASSERT(m->hasAccount("A000001", "Account2") == false); CPPUNIT_ASSERT(m->hasAccount("A000002", "Account3") == false); @@ -1281,8 +1281,8 @@ void MyMoneyFileTest::testAddEquityAccount() { MyMoneyFileTransaction ft; try { - MyMoneyAccount parent = m->asset(); - m->addAccount(i, parent); + MyMoneyAccount tqparent = m->asset(); + m->addAccount(i, tqparent); ft.commit(); } catch(MyMoneyException *e) { unexpectedException(e); @@ -1290,10 +1290,10 @@ void MyMoneyFileTest::testAddEquityAccount() { // keep a copy for later use m_inv = i; - // make sure, that only equity accounts can be children to it + // make sure, that only equity accounts can be tqchildren to it MyMoneyAccount a; a.setName("Testaccount"); - QValueList<MyMoneyAccount::accountTypeE> list; + TQValueList<MyMoneyAccount::accountTypeE> list; list << MyMoneyAccount::Checkings; list << MyMoneyAccount::Savings; list << MyMoneyAccount::Cash; @@ -1309,7 +1309,7 @@ void MyMoneyFileTest::testAddEquityAccount() { list << MyMoneyAccount::Expense; list << MyMoneyAccount::AssetLoan; - QValueList<MyMoneyAccount::accountTypeE>::Iterator it; + TQValueList<MyMoneyAccount::accountTypeE>::Iterator it; for(it = list.begin(); it != list.end(); ++it) { a.setAccountType(*it); ft.restart(); @@ -1334,13 +1334,13 @@ void MyMoneyFileTest::testAddEquityAccount() { } } -void MyMoneyFileTest::testReparentEquity() { +void MyMoneyFileTest::testRetqparentEquity() { testAddEquityAccount(); testAddEquityAccount(); - MyMoneyAccount parent; + MyMoneyAccount tqparent; // check the bad cases - QValueList<MyMoneyAccount::accountTypeE> list; + TQValueList<MyMoneyAccount::accountTypeE> list; list << MyMoneyAccount::Checkings; list << MyMoneyAccount::Savings; list << MyMoneyAccount::Cash; @@ -1349,25 +1349,25 @@ void MyMoneyFileTest::testReparentEquity() { list << MyMoneyAccount::Asset; list << MyMoneyAccount::AssetLoan; list << MyMoneyAccount::Currency; - parent = m->asset(); - testReparentEquity(list, parent); + tqparent = m->asset(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::CreditCard; list << MyMoneyAccount::Loan; list << MyMoneyAccount::Liability; - parent = m->liability(); - testReparentEquity(list, parent); + tqparent = m->liability(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::Income; - parent = m->income(); - testReparentEquity(list, parent); + tqparent = m->income(); + testRetqparentEquity(list, tqparent); list.clear(); list << MyMoneyAccount::Expense; - parent = m->expense(); - testReparentEquity(list, parent); + tqparent = m->expense(); + testRetqparentEquity(list, tqparent); // now check the good case MyMoneyAccount stock = m->account("A000002"); @@ -1381,18 +1381,18 @@ void MyMoneyFileTest::testReparentEquity() { } } -void MyMoneyFileTest::testReparentEquity(QValueList<MyMoneyAccount::accountTypeE>& list, MyMoneyAccount& parent) +void MyMoneyFileTest::testRetqparentEquity(TQValueList<MyMoneyAccount::accountTypeE>& list, MyMoneyAccount& tqparent) { MyMoneyAccount a; MyMoneyAccount stock = m->account("A000002"); - QValueList<MyMoneyAccount::accountTypeE>::Iterator it; + TQValueList<MyMoneyAccount::accountTypeE>::Iterator it; MyMoneyFileTransaction ft; for(it = list.begin(); it != list.end(); ++it) { - a.setName(QString("Testaccount %1").arg(*it)); + a.setName(TQString("Testaccount %1").tqarg(*it)); a.setAccountType(*it); try { - m->addAccount(a, parent); + m->addAccount(a, tqparent); char msg[100]; m->reparentAccount(stock, a); sprintf(msg, "Can reparent stock to non-investment type %d account", *it); @@ -1407,7 +1407,7 @@ void MyMoneyFileTest::testReparentEquity(QValueList<MyMoneyAccount::accountTypeE void MyMoneyFileTest::testBaseCurrency(void) { - MyMoneySecurity base("EUR", "Euro", QChar(0x20ac)); + MyMoneySecurity base("EUR", "Euro", TQChar(0x20ac)); MyMoneySecurity ref; // make sure, no base currency is set @@ -1442,7 +1442,7 @@ void MyMoneyFileTest::testBaseCurrency(void) ref = m->baseCurrency(); CPPUNIT_ASSERT(ref.id() == "EUR"); CPPUNIT_ASSERT(ref.name() == "Euro"); - CPPUNIT_ASSERT(ref.tradingSymbol() == QChar(0x20ac)); + CPPUNIT_ASSERT(ref.tradingSymbol() == TQChar(0x20ac)); } catch(MyMoneyException *e) { unexpectedException(e); } @@ -1463,7 +1463,7 @@ void MyMoneyFileTest::testBaseCurrency(void) ref = m->baseCurrency(); CPPUNIT_ASSERT(ref.id() == "EUR"); CPPUNIT_ASSERT(ref.name() == "Euro"); - CPPUNIT_ASSERT(ref.tradingSymbol() == QChar(0x20ac)); + CPPUNIT_ASSERT(ref.tradingSymbol() == TQChar(0x20ac)); } void MyMoneyFileTest::testOpeningBalanceNoBase(void) @@ -1488,9 +1488,9 @@ void MyMoneyFileTest::testOpeningBalance(void) try { openingAcc = m->openingBalanceAccount(m->baseCurrency()); - CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); + CPPUNIT_ASSERT(openingAcc.tqparentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == MyMoneyFile::OpeningBalancesPrefix); - CPPUNIT_ASSERT(openingAcc.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } @@ -1504,12 +1504,12 @@ void MyMoneyFileTest::testOpeningBalance(void) unexpectedException(e); } - QString refName = QString("%1 (%2)").arg(MyMoneyFile::OpeningBalancesPrefix).arg("USD"); + TQString refName = TQString("%1 (%2)").tqarg(MyMoneyFile::OpeningBalancesPrefix).tqarg("USD"); try { openingAcc = m->openingBalanceAccount(second); - CPPUNIT_ASSERT(openingAcc.parentAccountId() == m->equity().id()); + CPPUNIT_ASSERT(openingAcc.tqparentAccountId() == m->equity().id()); CPPUNIT_ASSERT(openingAcc.name() == refName); - CPPUNIT_ASSERT(openingAcc.openingDate() == QDate::currentDate()); + CPPUNIT_ASSERT(openingAcc.openingDate() == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { unexpectedException(e); } diff --git a/kmymoney2/mymoney/mymoneyfiletest.h b/kmymoney2/mymoney/mymoneyfiletest.h index b54af25..133f047 100644 --- a/kmymoney2/mymoney/mymoneyfiletest.h +++ b/kmymoney2/mymoney/mymoneyfiletest.h @@ -40,7 +40,7 @@ class MyMoneyFileTest : public CppUnit::TestFixture { CPPUNIT_TEST(testAddAccounts); CPPUNIT_TEST(testModifyAccount); CPPUNIT_TEST(testModifyStdAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testRemoveAccount); CPPUNIT_TEST(testRemoveAccountTree); CPPUNIT_TEST(testAccountListRetrieval); @@ -63,7 +63,7 @@ class MyMoneyFileTest : public CppUnit::TestFixture { CPPUNIT_TEST(testAttachedStorage); CPPUNIT_TEST(testHasAccount); CPPUNIT_TEST(testAddEquityAccount); - CPPUNIT_TEST(testReparentEquity); + CPPUNIT_TEST(testRetqparentEquity); CPPUNIT_TEST(testBaseCurrency); CPPUNIT_TEST(testOpeningBalanceNoBase); CPPUNIT_TEST(testOpeningBalance); @@ -92,7 +92,7 @@ public: void testAddAccounts(); void testModifyAccount(); void testModifyStdAccount(); - void testReparentAccount(); + void testRetqparentAccount(); void testRemoveAccount(); void testRemoveAccountTree(); void testAccountListRetrieval (); @@ -115,8 +115,8 @@ public: void testAttachedStorage(); void testHasAccount(); void testAddEquityAccount(); - void testReparentEquity(); - void testReparentEquity(QValueList<MyMoneyAccount::accountTypeE>& list, MyMoneyAccount& parent); + void testRetqparentEquity(); + void testRetqparentEquity(TQValueList<MyMoneyAccount::accountTypeE>& list, MyMoneyAccount& tqparent); void testBaseCurrency(); void testOpeningBalanceNoBase(); void testOpeningBalance(); diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp index d6686a6..33d5855 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp +++ b/kmymoney2/mymoney/mymoneyfinancialcalculator.cpp @@ -86,8 +86,8 @@ MyMoneyFinancialCalculator::MyMoneyFinancialCalculator() setPmt(0.0); setFv(0.0); - // clear the mask - m_mask = 0; + // clear the tqmask + m_tqmask = 0; } MyMoneyFinancialCalculator::~MyMoneyFinancialCalculator() @@ -122,38 +122,38 @@ void MyMoneyFinancialCalculator::setDisc(const bool disc) void MyMoneyFinancialCalculator::setIr(const FCALC_DOUBLE ir) { m_ir = ir; - m_mask |= IR_SET; + m_tqmask |= IR_SET; } void MyMoneyFinancialCalculator::setPv(const FCALC_DOUBLE pv) { m_pv = pv; - m_mask |= PV_SET; + m_tqmask |= PV_SET; } void MyMoneyFinancialCalculator::setPmt(const FCALC_DOUBLE pmt) { m_pmt = pmt; - m_mask |= PMT_SET; + m_tqmask |= PMT_SET; } void MyMoneyFinancialCalculator::setNpp(const FCALC_DOUBLE npp) { m_npp = npp; - m_mask |= NPP_SET; + m_tqmask |= NPP_SET; } void MyMoneyFinancialCalculator::setFv(const FCALC_DOUBLE fv) { m_fv = fv; - m_mask |= FV_SET; + m_tqmask |= FV_SET; } FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void) { - const unsigned short mask = PV_SET | IR_SET | PMT_SET | FV_SET; + const unsigned short tqmask = PV_SET | IR_SET | PMT_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of numPayments"); FCALC_DOUBLE eint = eff_int(); @@ -162,15 +162,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::numPayments(void) CC = (CC - m_fv) / (CC + m_pv); m_npp = (CC > 0.0) ? logl (CC) / logl (eint +1.0) : 0.0; - m_mask |= NPP_SET; + m_tqmask |= NPP_SET; return m_npp; } FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void) { - const unsigned short mask = PV_SET | IR_SET | NPP_SET | FV_SET; + const unsigned short tqmask = PV_SET | IR_SET | NPP_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -180,15 +180,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::payment(void) m_pmt = -rnd((m_fv + m_pv * (AA + 1.0)) / (AA * BB)); //m_pmt = -floorl((m_fv + m_pv * (AA + 1.0)) / (AA * BB)); - m_mask |= PMT_SET; + m_tqmask |= PMT_SET; return m_pmt; } FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void) { - const unsigned short mask = PMT_SET | IR_SET | NPP_SET | FV_SET; + const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | FV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -197,15 +197,15 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::presentValue(void) m_pv = rnd(-(m_fv + (AA * CC)) / (AA + 1.0)); - m_mask |= PV_SET; + m_tqmask |= PV_SET; return m_pv; } FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void) { - const unsigned short mask = PMT_SET | IR_SET | NPP_SET | PV_SET; + const unsigned short tqmask = PMT_SET | IR_SET | NPP_SET | PV_SET; - if((m_mask & mask) != mask) + if((m_tqmask & tqmask) != tqmask) throw new MYMONEYEXCEPTION("Not all parameters set for calculation of payment"); FCALC_DOUBLE eint = eff_int(); @@ -213,7 +213,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::futureValue(void) FCALC_DOUBLE CC = _Cx(eint); m_fv = rnd(-(m_pv + AA * (m_pv + CC))); - m_mask |= FV_SET; + m_tqmask |= FV_SET; return m_fv; } @@ -260,7 +260,7 @@ FCALC_DOUBLE MyMoneyFinancialCalculator::interestRate(void) } while (ri); } - m_mask |= IR_SET; + m_tqmask |= IR_SET; m_ir = rnd(nom_int(eint) * 100.0); return m_ir; } diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculator.h b/kmymoney2/mymoney/mymoneyfinancialcalculator.h index c603d12..8bc7033 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculator.h +++ b/kmymoney2/mymoney/mymoneyfinancialcalculator.h @@ -306,7 +306,7 @@ private: bool m_bep; // beginning/end of period payment flag bool m_disc; // discrete/continous compounding flag - unsigned short m_mask; // available value mask + unsigned short m_tqmask; // available value tqmask #define PV_SET 0x0001 #define IR_SET 0x0002 #define PMT_SET 0x0004 diff --git a/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp b/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp index fa5b1a3..aae78ab 100644 --- a/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp +++ b/kmymoney2/mymoney/mymoneyfinancialcalculatortest.cpp @@ -41,7 +41,7 @@ void MyMoneyFinancialCalculatorTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->m_prec == 2); CPPUNIT_ASSERT(m->m_bep == false); CPPUNIT_ASSERT(m->m_disc == true); - CPPUNIT_ASSERT(m->m_mask == 0); + CPPUNIT_ASSERT(m->m_tqmask == 0); } void MyMoneyFinancialCalculatorTest::testSetPrec() { @@ -52,7 +52,7 @@ void MyMoneyFinancialCalculatorTest::testSetPrec() { void MyMoneyFinancialCalculatorTest::testSetNpp() { m->setNpp(20); CPPUNIT_ASSERT(m->m_npp == 20); - CPPUNIT_ASSERT(m->m_mask == NPP_SET); + CPPUNIT_ASSERT(m->m_tqmask == NPP_SET); } void MyMoneyFinancialCalculatorTest::testSetPF() { @@ -86,25 +86,25 @@ void MyMoneyFinancialCalculatorTest::testSetDisc() { void MyMoneyFinancialCalculatorTest::testSetIr() { m->setIr(12.3); CPPUNIT_ASSERT(m->m_ir == 12.3); - CPPUNIT_ASSERT(m->m_mask == IR_SET); + CPPUNIT_ASSERT(m->m_tqmask == IR_SET); } void MyMoneyFinancialCalculatorTest::testSetPv() { m->setPv(23.4); CPPUNIT_ASSERT(m->m_pv == 23.4); - CPPUNIT_ASSERT(m->m_mask == PV_SET); + CPPUNIT_ASSERT(m->m_tqmask == PV_SET); } void MyMoneyFinancialCalculatorTest::testSetPmt() { m->setPmt(34.5); CPPUNIT_ASSERT(m->m_pmt == 34.5); - CPPUNIT_ASSERT(m->m_mask == PMT_SET); + CPPUNIT_ASSERT(m->m_tqmask == PMT_SET); } void MyMoneyFinancialCalculatorTest::testSetFv() { m->setFv(45.6); CPPUNIT_ASSERT(m->m_fv == 45.6); - CPPUNIT_ASSERT(m->m_mask == FV_SET); + CPPUNIT_ASSERT(m->m_tqmask == FV_SET); } void MyMoneyFinancialCalculatorTest::testCombinedSet() { @@ -114,7 +114,7 @@ void MyMoneyFinancialCalculatorTest::testCombinedSet() { m->setPmt(34.5); m->setFv(45.6); - CPPUNIT_ASSERT(m->m_mask == (NPP_SET | PV_SET | IR_SET | PMT_SET | FV_SET)); + CPPUNIT_ASSERT(m->m_tqmask == (NPP_SET | PV_SET | IR_SET | PMT_SET | FV_SET)); } void MyMoneyFinancialCalculatorTest::testNumPayments() { diff --git a/kmymoney2/mymoney/mymoneyforecast.cpp b/kmymoney2/mymoney/mymoneyforecast.cpp index 56125ea..59a565d 100644 --- a/kmymoney2/mymoney/mymoneyforecast.cpp +++ b/kmymoney2/mymoney/mymoneyforecast.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -47,8 +47,8 @@ MyMoneyForecast::MyMoneyForecast() : { setForecastCycles(KMyMoneyGlobalSettings::forecastCycles()); setAccountsCycle(KMyMoneyGlobalSettings::forecastAccountCycle()); - setHistoryStartDate(QDate::currentDate().addDays(-forecastCycles()*accountsCycle())); - setHistoryEndDate(QDate::currentDate().addDays(-1)); + setHistoryStartDate(TQDate::tqcurrentDate().addDays(-forecastCycles()*accountsCycle())); + setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); setForecastDays(KMyMoneyGlobalSettings::forecastDays()); setBeginForecastDay(KMyMoneyGlobalSettings::beginForecastDay()); setForecastMethod(KMyMoneyGlobalSettings::forecastMethod()); @@ -75,12 +75,12 @@ void MyMoneyForecast::doForecast() //initialize global variables setForecastDays(fDays); - setForecastStartDate(QDate::currentDate().addDays(1)); - setForecastEndDate(QDate::currentDate().addDays(fDays)); + setForecastStartDate(TQDate::tqcurrentDate().addDays(1)); + setForecastEndDate(TQDate::tqcurrentDate().addDays(fDays)); setAccountsCycle(fAccCycle); setForecastCycles(fCycles); setHistoryStartDate(forecastCycles() * accountsCycle()); - setHistoryEndDate(QDate::currentDate().addDays(-1)); //yesterday + setHistoryEndDate(TQDate::tqcurrentDate().addDays(-1)); //yesterday //clear all data before calculating m_accountListPast.clear(); @@ -120,22 +120,22 @@ void MyMoneyForecast::pastTransactions() filter.setDateFilter(historyStartDate(), historyEndDate()); filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> transactions = file->transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); //Check past transactions for(; it_t != transactions.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()) { MyMoneyAccount acc = file->account((*it_s).accountId()); //workaround for stock accounts which have faulty opening dates - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -163,11 +163,11 @@ void MyMoneyForecast::pastTransactions() purgeForecastAccountsList(m_accountListPast); //calculate running sum - QMap<QString, QString>::Iterator it_n; + TQMap<TQString, TQString>::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); m_accountListPast[acc.id()][historyStartDate().addDays(-1)] = file->balance(acc.id(), historyStartDate().addDays(-1)); - for(QDate it_date = historyStartDate(); it_date <= historyEndDate(); ) { + for(TQDate it_date = historyStartDate(); it_date <= historyEndDate(); ) { m_accountListPast[acc.id()][it_date] += m_accountListPast[acc.id()][it_date.addDays(-1)]; //Running sum it_date = it_date.addDays(1); } @@ -185,7 +185,7 @@ void MyMoneyForecast::pastTransactions() MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); //set the default value MyMoneyPrice price; - for ( QDate it_date = historyStartDate().addDays(-1) ; it_date <= historyEndDate();) { + for ( TQDate it_date = historyStartDate().addDays(-1) ; it_date <= historyEndDate();) { //get the price for the tradingCurrency that day price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_date ); if ( price.isValid() ) @@ -207,7 +207,7 @@ bool MyMoneyForecast::isForecastAccount(const MyMoneyAccount& acc) { setForecastAccountList(); } - QMap<QString, QString>::Iterator it_n; + TQMap<TQString, TQString>::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { if(*it_n == acc.id()) { @@ -224,7 +224,7 @@ void MyMoneyForecast::calculateAccountTrendList() int totalWeight = 0; //Calculate account trends - QMap<QString, QString>::Iterator it_n; + TQMap<TQString, TQString>::Iterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); m_accountTrendList[acc.id()][0] = MyMoneyMoney(0,1); // for today, the trend is 0 @@ -232,10 +232,10 @@ void MyMoneyForecast::calculateAccountTrendList() auxForecastTerms = forecastCycles(); if(skipOpeningDate()) { - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -284,14 +284,14 @@ void MyMoneyForecast::calculateAccountTrendList() } } -QValueList<MyMoneyAccount> MyMoneyForecast::forecastAccountList(void) +TQValueList<MyMoneyAccount> MyMoneyForecast::forecastAccountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; //Get all accounts from the file and check if they are of the right type to calculate forecast file->accountList(accList); - QValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); + TQValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(acc.isClosed() //check the account is not closed @@ -306,15 +306,15 @@ QValueList<MyMoneyAccount> MyMoneyForecast::forecastAccountList(void) return accList; } -QValueList<MyMoneyAccount> MyMoneyForecast::accountList(void) +TQValueList<MyMoneyAccount> MyMoneyForecast::accountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList<MyMoneyAccount> accList; - QStringList emptyStringList; + TQValueList<MyMoneyAccount> accList; + TQStringList emptyStringList; //Get all accounts from the file and check if they are present file->accountList(accList, emptyStringList, false); - QValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); + TQValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(!isForecastAccount( acc ) ) { @@ -332,8 +332,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyTransactionFilter filter; MyMoneyMoney netIncome; - QDate startDate; - QDate openingDate = acc.openingDate(); + TQDate startDate; + TQDate openingDate = acc.openingDate(); //validate arguments if(trendDays < 1) @@ -343,14 +343,14 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i //If it is a new account, we don't take into account the first day //because it is usually a weird one and it would mess up the trend - if(openingDate.daysTo(QDate::currentDate())<trendDays){ + if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays){ startDate = (acc.openingDate()).addDays(1); } else { - startDate = QDate::currentDate().addDays(-trendDays); + startDate = TQDate::tqcurrentDate().addDays(-trendDays); } //get all transactions for the period - filter.setDateFilter(startDate, QDate::currentDate()); + filter.setDateFilter(startDate, TQDate::tqcurrentDate()); if(acc.accountGroup() == MyMoneyAccount::Income || acc.accountGroup() == MyMoneyAccount::Expense) { filter.addCategory(acc.id()); @@ -359,13 +359,13 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i } filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> transactions = file->transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); //add all transactions for that account for(; it_t != transactions.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()) { if(acc.id()==(*it_s).accountId()) netIncome += (*it_s).value(); @@ -377,8 +377,8 @@ MyMoneyMoney MyMoneyForecast::calculateAccountTrend(const MyMoneyAccount& acc, i MyMoneyMoney accTrend; //don't take into account the first day of the account - if(openingDate.daysTo(QDate::currentDate())<trendDays) { - accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(QDate::currentDate())-1,1); + if(openingDate.daysTo(TQDate::tqcurrentDate())<trendDays) { + accTrend = netIncome/MyMoneyMoney(openingDate.daysTo(TQDate::tqcurrentDate())-1,1); } else { accTrend = netIncome/MyMoneyMoney(trendDays,1); } @@ -463,7 +463,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() calculateAccountTrendList(); //Calculate account daily balances - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); @@ -474,7 +474,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() case 0: case 1: { - for(QDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { + for(TQDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { for(int t_day = 1; t_day <= accountsCycle(); ++t_day) { MyMoneyMoney balanceDayBefore = m_accountList[acc.id()][(f_day.addDays(-1))];//balance of the day before MyMoneyMoney accountDailyTrend = m_accountTrendList[acc.id()][t_day]; //trend for that day @@ -490,10 +490,10 @@ void MyMoneyForecast::calculateHistoricDailyBalances() break; case 2: { - QDate baseDate = QDate::currentDate().addDays(-accountsCycle()); + TQDate baseDate = TQDate::tqcurrentDate().addDays(-accountsCycle()); for(int t_day = 1; t_day <= accountsCycle(); ++t_day) { int f_day = 1; - QDate fDate = baseDate.addDays(accountsCycle()+1); + TQDate fDate = baseDate.addDays(accountsCycle()+1); while (fDate <= forecastEndDate()) { //the calculation is based on the balance for the last month, that is then multiplied by the trend @@ -509,7 +509,7 @@ void MyMoneyForecast::calculateHistoricDailyBalances() } } -MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate forecastDate) +MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, TQDate forecastDate) { dailyBalances balance; @@ -522,7 +522,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate f } balance = m_accountList[acc.id() ]; - if ( balance.contains ( forecastDate ) ) + if ( balance.tqcontains ( forecastDate ) ) { //if the date is not in the forecast, it returns 0 MM_amount = m_accountList[acc.id() ][forecastDate]; } @@ -536,7 +536,7 @@ MyMoneyMoney MyMoneyForecast::forecastBalance(const MyMoneyAccount& acc, QDate f */ MyMoneyMoney MyMoneyForecast::forecastBalance (const MyMoneyAccount& acc, int offset ) { - QDate forecastDate = QDate::currentDate().addDays(offset); + TQDate forecastDate = TQDate::tqcurrentDate().addDays(offset); return forecastBalance(acc, forecastDate); } @@ -555,7 +555,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void) purgeForecastAccountsList(m_accountList); //adjust value of investments to deep currency - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, TQString>::ConstIterator it_n; for ( it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n ) { MyMoneyAccount acc = file->account ( *it_n ); @@ -570,7 +570,7 @@ void MyMoneyForecast::doFutureScheduledForecast(void) MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); MyMoneyPrice price; - for (QDate it_day = QDate::currentDate(); it_day <= forecastEndDate(); ) { + for (TQDate it_day = TQDate::tqcurrentDate(); it_day <= forecastEndDate(); ) { //get the price for the tradingCurrency that day price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), it_day ); if ( price.isValid() ) @@ -596,12 +596,12 @@ void MyMoneyForecast::addFutureTransactions(void) filter.setDateFilter(forecastStartDate(), forecastEndDate()); filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> transactions = file->transactionList(filter); - QValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); + TQValueList<MyMoneyTransaction> transactions = file->transactionList(filter); + TQValueList<MyMoneyTransaction>::const_iterator it_t = transactions.begin(); for(; it_t != transactions.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()) { MyMoneyAccount acc = file->account((*it_s).accountId()); @@ -621,17 +621,17 @@ void MyMoneyForecast::addFutureTransactions(void) } #if 0 - QFile trcFile("forecast.csv"); + TQFile trcFile("forecast.csv"); trcFile.open(IO_WriteOnly); - QTextStream s(&trcFile); + TQTextStream s(&trcFile); { s << "Already present transactions\n"; - QMap<QString, dailyBalances>::Iterator it_a; - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, dailyBalances>::Iterator it_a; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - it_a = m_accountList.find(*it_n); + it_a = m_accountList.tqfind(*it_n); s << "\"" << acc.name() << "\","; for(int i = 0; i < 90; ++i) { s << "\"" << (*it_a)[i].formatMoney("") << "\","; @@ -648,12 +648,12 @@ void MyMoneyForecast::addScheduledTransactions (void) MyMoneyFile* file = MyMoneyFile::instance(); // now process all the schedules that may have an impact - QValueList<MyMoneySchedule> schedule; + TQValueList<MyMoneySchedule> schedule; schedule = file->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate::currentDate(), forecastEndDate()); + TQDate::tqcurrentDate(), forecastEndDate()); if(schedule.count() > 0) { - QValueList<MyMoneySchedule>::Iterator it; + TQValueList<MyMoneySchedule>::Iterator it; do { qBubbleSort(schedule); it = schedule.begin(); @@ -665,13 +665,13 @@ void MyMoneyForecast::addScheduledTransactions (void) continue; } - QDate date = (*it).nextPayment((*it).lastPayment()); + TQDate date = (*it).nextPayment((*it).lastPayment()); if(!date.isValid()) { schedule.remove(it); continue; } - QDate nextDate = (*it).adjustedNextPayment((*it).lastPayment()); + TQDate nextDate = (*it).adjustedNextPayment((*it).lastPayment()); if (nextDate > forecastEndDate()) { // We're done with this schedule, let's move on to the next schedule.remove(it); @@ -688,22 +688,22 @@ void MyMoneyForecast::addScheduledTransactions (void) MyMoneyTransaction t = (*it).transaction(); // only process the entry, if it is still active - if(!(*it).isFinished() && nextDate != QDate()) { + if(!(*it).isFinished() && nextDate != TQDate()) { // make sure we have all 'starting balances' so that the autocalc works - QValueList<MyMoneySplit>::const_iterator it_s; - QMap<QString, MyMoneyMoney> balanceMap; + TQValueList<MyMoneySplit>::const_iterator it_s; + TQMap<TQString, MyMoneyMoney> balanceMap; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s ) { MyMoneyAccount acc = file->account((*it_s).accountId()); if(isForecastAccount(acc)) { // collect all overdues on the first day - QDate forecastDate = nextDate; - if(QDate::currentDate() >= nextDate) - forecastDate = QDate::currentDate().addDays(1); + TQDate forecastDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + forecastDate = TQDate::tqcurrentDate().addDays(1); dailyBalances balance; balance = m_accountList[acc.id()]; - for(QDate f_day = QDate::currentDate(); f_day < forecastDate; ) { + for(TQDate f_day = TQDate::tqcurrentDate(); f_day < forecastDate; ) { balanceMap[acc.id()] += m_accountList[acc.id()][f_day]; f_day = f_day.addDays(1); } @@ -719,14 +719,14 @@ void MyMoneyForecast::addScheduledTransactions (void) if(isForecastAccount(acc)) { dailyBalances balance; balance = m_accountList[acc.id()]; - //int offset = QDate::currentDate().daysTo(nextDate); + //int offset = TQDate::tqcurrentDate().daysTo(nextDate); //if(offset <= 0) { // collect all overdues on the first day // offset = 1; //} // collect all overdues on the first day - QDate forecastDate = nextDate; - if(QDate::currentDate() >= nextDate) - forecastDate = QDate::currentDate().addDays(1); + TQDate forecastDate = nextDate; + if(TQDate::tqcurrentDate() >= nextDate) + forecastDate = TQDate::tqcurrentDate().addDays(1); if(acc.accountType() == MyMoneyAccount::Income) { balance[forecastDate] += ((*it_s).shares() * MyMoneyMoney(-1, 1)); @@ -757,11 +757,11 @@ void MyMoneyForecast::addScheduledTransactions (void) #if 0 { s << "\n\nAdded scheduled transactions\n"; - QMap<QString, dailyBalances>::Iterator it_a; - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, dailyBalances>::Iterator it_a; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - it_a = m_accountList.find(*it_n); + it_a = m_accountList.tqfind(*it_n); s << "\"" << acc.name() << "\","; for(int i = 0; i < 90; ++i) { s << "\"" << (*it_a)[i].formatMoney("") << "\","; @@ -777,14 +777,14 @@ void MyMoneyForecast::calculateScheduledDailyBalances (void) MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account daily balances - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); //set the starting balance of the account setStartingBalance(acc); - for(QDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { + for(TQDate f_day = forecastStartDate(); f_day <= forecastEndDate(); ) { MyMoneyMoney balanceDayBefore = m_accountList[acc.id()][(f_day.addDays(-1))];//balance of the day before m_accountList[acc.id()][f_day] += balanceDayBefore; //running sum f_day = f_day.addDays(1); @@ -796,7 +796,7 @@ void MyMoneyForecast::calculateScheduledDailyBalances (void) int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc) { - QString minimumBalance = acc.value("minBalanceAbsolute"); + TQString minimumBalance = acc.value("minBalanceAbsolute"); MyMoneyMoney minBalance = MyMoneyMoney(minimumBalance); dailyBalances balance; @@ -807,9 +807,9 @@ int MyMoneyForecast::daysToMinimumBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; - for(QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) { + for(TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if(minBalance > balance[it_day]) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -828,20 +828,20 @@ int MyMoneyForecast::daysToZeroBalance(const MyMoneyAccount& acc) balance = m_accountList[acc.id()]; if (acc.accountGroup() == MyMoneyAccount::Asset) { - for (QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] < MyMoneyMoney ( 0, 1 ) ) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } } else if (acc.accountGroup() == MyMoneyAccount::Liability) { - for (QDate it_day = QDate::currentDate() ; it_day <= forecastEndDate(); ) + for (TQDate it_day = TQDate::tqcurrentDate() ; it_day <= forecastEndDate(); ) { if ( balance[it_day] > MyMoneyMoney ( 0, 1 ) ) { - return QDate::currentDate().daysTo(it_day); + return TQDate::tqcurrentDate().daysTo(it_day); } it_day = it_day.addDays(1); } @@ -853,10 +853,10 @@ void MyMoneyForecast::setForecastAccountList(void) { //get forecast accounts - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; accList = forecastAccountList(); - QValueList<MyMoneyAccount>::const_iterator accList_t = accList.begin(); + TQValueList<MyMoneyAccount>::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; // check if this is a new account for us @@ -882,24 +882,24 @@ MyMoneyMoney MyMoneyForecast::accountTotalVariation(const MyMoneyAccount& acc) { MyMoneyMoney totalVariation; - totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, QDate::currentDate()); + totalVariation = forecastBalance(acc, forecastEndDate()) - forecastBalance(acc, TQDate::tqcurrentDate()); return totalVariation; } -QValueList<QDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAccount& acc) +TQValueList<TQDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAccount& acc) { - QValueList<QDate> minBalanceList; + TQValueList<TQDate> minBalanceList; int daysToBeginDay; - daysToBeginDay = QDate::currentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney minBalance = forecastBalance(acc, (t_cycle * accountsCycle() + daysToBeginDay)); - QDate minDate = QDate::currentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); + TQDate minDate = TQDate::tqcurrentDate().addDays(t_cycle * accountsCycle() + daysToBeginDay); for(int t_day = 1; t_day <= accountsCycle() ; ++t_day) { if( minBalance > forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { minBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - minDate = QDate::currentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); + minDate = TQDate::tqcurrentDate().addDays( (t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } minBalanceList.append(minDate); @@ -907,21 +907,21 @@ QValueList<QDate> MyMoneyForecast::accountMinimumBalanceDateList(const MyMoneyAc return minBalanceList; } -QValueList<QDate> MyMoneyForecast::accountMaximumBalanceDateList(const MyMoneyAccount& acc) +TQValueList<TQDate> MyMoneyForecast::accountMaximumBalanceDateList(const MyMoneyAccount& acc) { - QValueList<QDate> maxBalanceList; + TQValueList<TQDate> maxBalanceList; int daysToBeginDay; - daysToBeginDay = QDate::currentDate().daysTo(beginForecastDate()); + daysToBeginDay = TQDate::tqcurrentDate().daysTo(beginForecastDate()); for(int t_cycle = 0; ((t_cycle * accountsCycle()) + daysToBeginDay) < forecastDays() ; ++t_cycle) { MyMoneyMoney maxBalance = forecastBalance(acc, ((t_cycle * accountsCycle()) + daysToBeginDay)); - QDate maxDate = QDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); + TQDate maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay); for(int t_day = 0; t_day < accountsCycle() ; ++t_day) { if( maxBalance < forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day) ) { maxBalance = forecastBalance(acc, (t_cycle * accountsCycle()) + daysToBeginDay + t_day ); - maxDate = QDate::currentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); + maxDate = TQDate::tqcurrentDate().addDays((t_cycle * accountsCycle()) + daysToBeginDay + t_day); } } maxBalanceList.append(maxDate); @@ -943,53 +943,53 @@ int MyMoneyForecast::calculateBeginForecastDay() int fDays = forecastDays(); int beginDay = beginForecastDay(); int accCycle = accountsCycle(); - QDate beginDate; + TQDate beginDate; //if 0, beginDate is current date and forecastDays remains unchanged if(beginDay == 0) { - setBeginForecastDate(QDate::currentDate()); + setBeginForecastDate(TQDate::tqcurrentDate()); return fDays; } //adjust if beginDay more than days of current month - if(QDate::currentDate().daysInMonth() < beginDay) - beginDay = QDate::currentDate().daysInMonth(); + if(TQDate::tqcurrentDate().daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().daysInMonth(); //if beginDay still to come, calculate and return - if(QDate::currentDate().day() <= beginDay) { - beginDate = QDate( QDate::currentDate().year(), QDate::currentDate().month(), beginDay); - fDays += QDate::currentDate().daysTo(beginDate); + if(TQDate::tqcurrentDate().day() <= beginDay) { + beginDate = TQDate( TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); setBeginForecastDate(beginDate); return fDays; } //adjust beginDay for next month - if(QDate::currentDate().addMonths(1).daysInMonth() < beginDay) - beginDay = QDate::currentDate().addMonths(1).daysInMonth(); + if(TQDate::tqcurrentDate().addMonths(1).daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().addMonths(1).daysInMonth(); //if beginDay of next month comes before 1 interval, use beginDay next month - if(QDate::currentDate().addDays(accCycle) >= - (QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) + if(TQDate::tqcurrentDate().addDays(accCycle) >= + (TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1) ) ) { - beginDate = QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1).addDays(beginDay-1); - fDays += QDate::currentDate().daysTo(beginDate); + beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1).addDays(beginDay-1); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); } else //add intervals to current beginDay and take the first after current date { - beginDay = ((((QDate::currentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; - beginDate = QDate::currentDate().addDays(beginDay - QDate::currentDate().day()); - fDays += QDate::currentDate().daysTo(beginDate); + beginDay = ((((TQDate::tqcurrentDate().day()-beginDay)/accCycle) + 1) * accCycle) + beginDay; + beginDate = TQDate::tqcurrentDate().addDays(beginDay - TQDate::tqcurrentDate().day()); + fDays += TQDate::tqcurrentDate().daysTo(beginDate); } setBeginForecastDate(beginDate); return fDays; } -void MyMoneyForecast::purgeForecastAccountsList(QMap<QString, dailyBalances>& accountList) +void MyMoneyForecast::purgeForecastAccountsList(TQMap<TQString, dailyBalances>& accountList) { - QMap<QString, QString>::Iterator it_n; + TQMap<TQString, TQString>::Iterator it_n; for ( it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ) { - if(!accountList.contains(*it_n)) { + if(!accountList.tqcontains(*it_n)) { m_nameIdx.remove(it_n); it_n = m_nameIdx.begin(); } else @@ -997,10 +997,10 @@ void MyMoneyForecast::purgeForecastAccountsList(QMap<QString, dailyBalances>& ac } } -void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget ) +void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, TQDate historyStart, TQDate historyEnd, TQDate budgetStart, TQDate budgetEnd, const bool returnBudget ) { // clear all data except the id and name - QString name = budget.name(); + TQString name = budget.name(); budget = MyMoneyBudget(budget.id(), MyMoneyBudget()); budget.setName(name); @@ -1016,10 +1016,10 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, int fMethod = forecastMethod(); //set start date to 1st of month and end dates to last day of month, since we deal with full months in budget - historyStart = QDate ( historyStart.year(), historyStart.month(), 1 ); - historyEnd = QDate ( historyEnd.year(), historyEnd.month(), historyEnd.daysInMonth() ); - budgetStart = QDate ( budgetStart.year(), budgetStart.month(), 1 ); - budgetEnd = QDate ( budgetEnd.year(), budgetEnd.month(), budgetEnd.daysInMonth() ); + historyStart = TQDate ( historyStart.year(), historyStart.month(), 1 ); + historyEnd = TQDate ( historyEnd.year(), historyEnd.month(), historyEnd.daysInMonth() ); + budgetStart = TQDate ( budgetStart.year(), budgetStart.month(), 1 ); + budgetEnd = TQDate ( budgetEnd.year(), budgetEnd.month(), budgetEnd.daysInMonth() ); //set forecast parameters setHistoryStartDate ( historyStart ); @@ -1069,7 +1069,7 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, budget.setBudgetStart ( budgetStart ); //go through all the accounts and add them to budget - QMap<QString, QString>::ConstIterator it_nc; + TQMap<TQString, TQString>::ConstIterator it_nc; for ( it_nc = m_nameIdx.begin(); it_nc != m_nameIdx.end(); ++it_nc ) { MyMoneyAccount acc = file->account ( *it_nc ); @@ -1077,7 +1077,7 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, budgetAcc.setId ( acc.id() ); budgetAcc.setBudgetLevel ( MyMoneyBudget::AccountGroup::eMonthByMonth ); - for ( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { + for ( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { MyMoneyBudget::PeriodGroup period; //add period to budget account @@ -1097,10 +1097,10 @@ void MyMoneyForecast::createBudget ( MyMoneyBudget& budget, QDate historyStart, void MyMoneyForecast::setBudgetAccountList(void) { //get budget accounts - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; accList = budgetAccountList(); - QValueList<MyMoneyAccount>::const_iterator accList_t = accList.begin(); + TQValueList<MyMoneyAccount>::const_iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ++accList_t ) { MyMoneyAccount acc = *accList_t; // check if this is a new account for us @@ -1110,15 +1110,15 @@ void MyMoneyForecast::setBudgetAccountList(void) } } -QValueList<MyMoneyAccount> MyMoneyForecast::budgetAccountList(void) +TQValueList<MyMoneyAccount> MyMoneyForecast::budgetAccountList(void) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList<MyMoneyAccount> accList; - QStringList emptyStringList; + TQValueList<MyMoneyAccount> accList; + TQStringList emptyStringList; //Get all accounts from the file and check if they are of the right type to calculate forecast file->accountList(accList, emptyStringList, false); - QValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); + TQValueList<MyMoneyAccount>::iterator accList_t = accList.begin(); for(; accList_t != accList.end(); ) { MyMoneyAccount acc = *accList_t; if(acc.isClosed() //check the account is not closed @@ -1137,17 +1137,17 @@ void MyMoneyForecast::calculateHistoricMonthlyBalances() MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account monthly balances - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - for( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { + for( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); ) { for(int f_day = 1; f_day <= accountsCycle() && f_date <= forecastEndDate(); ++f_day) { MyMoneyMoney accountDailyTrend = m_accountTrendList[acc.id()][f_day]; //trend for that day //check for leap year if(f_date.month() == 2 && f_date.day() == 29) f_date = f_date.addDays(1); //skip 1 day - m_accountList[acc.id()][QDate(f_date.year(), f_date.month(), 1)] += accountDailyTrend; //movement trend for that particular day + m_accountList[acc.id()][TQDate(f_date.year(), f_date.month(), 1)] += accountDailyTrend; //movement trend for that particular day f_date = f_date.addDays(1); } } @@ -1159,18 +1159,18 @@ void MyMoneyForecast::calculateScheduledMonthlyBalances() MyMoneyFile* file = MyMoneyFile::instance(); //Calculate account monthly balances - QMap<QString, QString>::ConstIterator it_n; + TQMap<TQString, TQString>::ConstIterator it_n; for(it_n = m_nameIdx.begin(); it_n != m_nameIdx.end(); ++it_n) { MyMoneyAccount acc = file->account(*it_n); - for( QDate f_date = forecastStartDate(); f_date <= forecastEndDate(); f_date = f_date.addDays(1) ) { + for( TQDate f_date = forecastStartDate(); f_date <= forecastEndDate(); f_date = f_date.addDays(1) ) { //get the trend for the day MyMoneyMoney accountDailyBalance = m_accountList[acc.id()][f_date]; //do not add if it is the beginning of the month //otherwise we end up with duplicated values as reported by Marko Käning - if(f_date != QDate(f_date.year(), f_date.month(), 1) ) - m_accountList[acc.id()][QDate(f_date.year(), f_date.month(), 1)] += accountDailyBalance; + if(f_date != TQDate(f_date.year(), f_date.month(), 1) ) + m_accountList[acc.id()][TQDate(f_date.year(), f_date.month(), 1)] += accountDailyBalance; } } } @@ -1190,24 +1190,24 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) //set the default value MyMoneyMoney rate = MyMoneyMoney ( 1, 1 ); //get te - MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), QDate::currentDate() ); + MyMoneyPrice price = file->price ( undersecurity.id(), undersecurity.tradingCurrency(), TQDate::tqcurrentDate() ); if ( price.isValid() ) { rate = price.rate ( undersecurity.tradingCurrency() ); } - m_accountList[acc.id()][QDate::currentDate()] = file->balance(acc.id(), QDate::currentDate()) * rate; + m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()) * rate; } } else { - m_accountList[acc.id()][QDate::currentDate()] = file->balance(acc.id(), QDate::currentDate()); + m_accountList[acc.id()][TQDate::tqcurrentDate()] = file->balance(acc.id(), TQDate::tqcurrentDate()); } //if the method is linear regression, we have to add the opening balance to m_accountListPast if(forecastMethod() == eHistoric && historyMethod() == 2) { //FIXME workaround for stock opening dates - QDate openingDate; + TQDate openingDate; if(acc.accountType() == MyMoneyAccount::Stock) { - MyMoneyAccount parentAccount = file->account(acc.parentAccountId()); - openingDate = parentAccount.openingDate(); + MyMoneyAccount tqparentAccount = file->account(acc.tqparentAccountId()); + openingDate = tqparentAccount.openingDate(); } else { openingDate = acc.openingDate(); } @@ -1220,7 +1220,7 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) openingBalance = file->balance(acc.id(), openingDate); //calculate running sum - for(QDate it_date = openingDate; it_date <= historyEndDate(); it_date = it_date.addDays(1) ) { + for(TQDate it_date = openingDate; it_date <= historyEndDate(); it_date = it_date.addDays(1) ) { //investments require special treatment if ( acc.isInvest() ) { //get the security id of that account @@ -1248,7 +1248,7 @@ void MyMoneyForecast::setStartingBalance(const MyMoneyAccount &acc) } } -void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap<QString, MyMoneyMoney>& balances) +void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap<TQString, MyMoneyMoney>& balances) { if (schedule.type() == MyMoneySchedule::TYPE_LOANPAYMENT) { @@ -1259,7 +1259,7 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney if(!amortizationSplit.id().isEmpty() && !interestSplit.id().isEmpty()) { MyMoneyAccountLoan acc(MyMoneyFile::instance()->account(amortizationSplit.accountId())); MyMoneyFinancialCalculator calc; - QDate dueDate; + TQDate dueDate; // FIXME: setup dueDate according to when the interest should be calculated // current implementation: take the date of the next payment according to @@ -1267,8 +1267,8 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney // the payment is overdue then take the current date dueDate = schedule.nextDueDate(); if(acc.interestCalculation() == MyMoneyAccountLoan::paymentReceived) { - if(dueDate < QDate::currentDate()) - dueDate = QDate::currentDate(); + if(dueDate < TQDate::tqcurrentDate()) + dueDate = TQDate::tqcurrentDate(); } // we need to calculate the balance at the time the payment is due @@ -1280,12 +1280,12 @@ void MyMoneyForecast::calculateAutoLoan(const MyMoneySchedule& schedule, MyMoney balance = balances[acc.id()]; /* - QValueList<MyMoneyTransaction> list; - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction>::ConstIterator it; MyMoneySplit split; MyMoneyTransactionFilter filter(acc.id()); - filter.setDateFilter(QDate(), dueDate.addDays(-1)); + filter.setDateFilter(TQDate(), dueDate.addDays(-1)); list = MyMoneyFile::instance()->transactionList(filter); for(it = list.begin(); it != list.end(); ++it) { diff --git a/kmymoney2/mymoney/mymoneyforecast.h b/kmymoney2/mymoney/mymoneyforecast.h index f69e596..7291b2b 100644 --- a/kmymoney2/mymoney/mymoneyforecast.h +++ b/kmymoney2/mymoney/mymoneyforecast.h @@ -25,9 +25,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qmap.h> -#include <qvaluelist.h> -#include <qstring.h> +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqstring.h> // ---------------------------------------------------------------------------- // Project Includes @@ -59,7 +59,7 @@ public: /** * Returns the list of accounts to be forecast. */ - QValueList<MyMoneyAccount> accountList(void); + TQValueList<MyMoneyAccount> accountList(void); /** * Returns the balance trend for account @a acc based on a number of days @p forecastDays @@ -69,9 +69,9 @@ public: static MyMoneyMoney calculateAccountTrend(const MyMoneyAccount& acc, int forecastDays); /** - * Returns the forecast balance trend for account @a acc for day @p QDate + * Returns the forecast balance trend for account @a acc for day @p TQDate */ - MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, QDate forecastDate); + MyMoneyMoney forecastBalance(const MyMoneyAccount& acc, TQDate forecastDate); /** * Returns the forecast balance trend for account @a acc for offset @p int @@ -111,12 +111,12 @@ public: /** * returns a list of the dates where the account was on its lowest balance in each cycle */ - QValueList<QDate> accountMinimumBalanceDateList(const MyMoneyAccount& acc); + TQValueList<TQDate> accountMinimumBalanceDateList(const MyMoneyAccount& acc); /** * returns a list of the dates where the account was on its highest balance in each cycle */ - QValueList<QDate> accountMaximumBalanceDateList(const MyMoneyAccount& acc); + TQValueList<TQDate> accountMaximumBalanceDateList(const MyMoneyAccount& acc); /** * returns the average balance of the account within the forecast period @@ -126,7 +126,7 @@ public: /** * creates a budget based on the history of a given timeframe */ - void createBudget(MyMoneyBudget& budget, QDate historyStart, QDate historyEnd, QDate budgetStart, QDate budgetEnd, const bool returnBudget); + void createBudget(MyMoneyBudget& budget, TQDate historyStart, TQDate historyEnd, TQDate budgetStart, TQDate budgetEnd, const bool returnBudget); /** * number of days to go back in history to calculate forecast @@ -136,15 +136,15 @@ public: void setAccountsCycle(int accountsCycle) { m_accountsCycle = accountsCycle; } void setForecastCycles(int forecastCycles) { m_forecastCycles = forecastCycles; } void setForecastDays(int forecastDays) { m_forecastDays = forecastDays; } - void setBeginForecastDate(QDate beginForecastDate) { m_beginForecastDate = beginForecastDate; } + void setBeginForecastDate(TQDate beginForecastDate) { m_beginForecastDate = beginForecastDate; } void setBeginForecastDay(int beginDay) { m_beginForecastDay = beginDay; } void setForecastMethod(int forecastMethod) { m_forecastMethod = forecastMethod; } - void setHistoryStartDate(QDate historyStartDate) { m_historyStartDate = historyStartDate; } - void setHistoryEndDate(QDate historyEndDate) { m_historyEndDate = historyEndDate; } - void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(QDate::currentDate().addDays(-daysToStartDate)); } - void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(QDate::currentDate().addDays(-daysToEndDate)); } - void setForecastStartDate(QDate _startDate) { m_forecastStartDate = _startDate; } - void setForecastEndDate(QDate _endDate) { m_forecastEndDate = _endDate; } + void setHistoryStartDate(TQDate historyStartDate) { m_historyStartDate = historyStartDate; } + void setHistoryEndDate(TQDate historyEndDate) { m_historyEndDate = historyEndDate; } + void setHistoryStartDate(int daysToStartDate) { setHistoryStartDate(TQDate::tqcurrentDate().addDays(-daysToStartDate)); } + void setHistoryEndDate(int daysToEndDate) { setHistoryEndDate(TQDate::tqcurrentDate().addDays(-daysToEndDate)); } + void setForecastStartDate(TQDate _startDate) { m_forecastStartDate = _startDate; } + void setForecastEndDate(TQDate _endDate) { m_forecastEndDate = _endDate; } void setSkipOpeningDate(bool _skip) { m_skipOpeningDate = _skip; } void setHistoryMethod(int historyMethod) { m_historyMethod = historyMethod; } void setIncludeUnusedAccounts(bool _bool) { m_includeUnusedAccounts = _bool; } @@ -155,13 +155,13 @@ public: int accountsCycle(void) const { return m_accountsCycle; } int forecastCycles(void) const { return m_forecastCycles; } int forecastDays(void) const { return m_forecastDays; } - QDate beginForecastDate(void) const { return m_beginForecastDate; } + TQDate beginForecastDate(void) const { return m_beginForecastDate; } int beginForecastDay(void) const { return m_beginForecastDay; } int forecastMethod(void) const { return m_forecastMethod; } - QDate historyStartDate(void) const { return m_historyStartDate; } - QDate historyEndDate(void) const { return m_historyEndDate; } - QDate forecastStartDate(void) const { return m_forecastStartDate; } - QDate forecastEndDate(void) const { return m_forecastEndDate; } + TQDate historyStartDate(void) const { return m_historyStartDate; } + TQDate historyEndDate(void) const { return m_historyEndDate; } + TQDate forecastStartDate(void) const { return m_forecastStartDate; } + TQDate forecastEndDate(void) const { return m_forecastEndDate; } bool skipOpeningDate(void) const { return m_skipOpeningDate; } int historyMethod(void) const { return m_historyMethod; } bool isIncludingUnusedAccounts(void) const { return m_includeUnusedAccounts; } @@ -175,11 +175,11 @@ public: * * @param schedule const reference to the schedule the transaction is based on * @param transaction reference to the transaction to be checked and modified - * @param balances QMap of (account-id,balance) pairs to be used as current balance + * @param balances TQMap of (account-id,balance) pairs to be used as current balance * for the calculation of interest. If map is empty, the engine * will be interrogated for current balances. */ - static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const QMap<QString, MyMoneyMoney>& balances); + static void calculateAutoLoan(const MyMoneySchedule& schedule, MyMoneyTransaction& transaction, const TQMap<TQString, MyMoneyMoney>& balances); private: @@ -188,22 +188,22 @@ private: /** * daily balances of an account */ - typedef QMap<QDate, MyMoneyMoney> dailyBalances; + typedef TQMap<TQDate, MyMoneyMoney> dailyBalances; /** * map of trends of an account */ - typedef QMap<int, MyMoneyMoney> trendBalances; + typedef TQMap<int, MyMoneyMoney> trendBalances; /** * Returns the list of accounts to be forecast. Only Asset and Liability are returned. */ - static QValueList<MyMoneyAccount> forecastAccountList(void); + static TQValueList<MyMoneyAccount> forecastAccountList(void); /** * Returns the list of accounts to create a budget. Only Income and Expenses are returned. */ - QValueList<MyMoneyAccount> budgetAccountList(void); + TQValueList<MyMoneyAccount> budgetAccountList(void); /** * calculate daily forecast balance based on historic transactions @@ -300,27 +300,27 @@ private: * remove accounts from the list if the accounts has no transactions in the forecast timeframe. * Used for scheduled-forecast method. */ - void purgeForecastAccountsList(QMap<QString, dailyBalances>& accountList); + void purgeForecastAccountsList(TQMap<TQString, dailyBalances>& accountList); /** * daily forecast balance of accounts */ - QMap<QString, dailyBalances> m_accountList; + TQMap<TQString, dailyBalances> m_accountList; /** * daily past balance of accounts */ - QMap<QString, dailyBalances> m_accountListPast; + TQMap<TQString, dailyBalances> m_accountListPast; /** * daily forecast trends of accounts */ - QMap<QString, trendBalances> m_accountTrendList; + TQMap<TQString, trendBalances> m_accountTrendList; /** * list of forecast accounts */ - QMap<QString, QString> m_nameIdx; + TQMap<TQString, TQString> m_nameIdx; /** * cycle of accounts in days @@ -340,7 +340,7 @@ private: /** * date to start forecast */ - QDate m_beginForecastDate; + TQDate m_beginForecastDate; /** * day to start forecast @@ -360,22 +360,22 @@ private: /** * start date of history */ - QDate m_historyStartDate; + TQDate m_historyStartDate; /** * end date of history */ - QDate m_historyEndDate; + TQDate m_historyEndDate; /** * start date of forecast */ - QDate m_forecastStartDate; + TQDate m_forecastStartDate; /** * end date of forecast */ - QDate m_forecastEndDate; + TQDate m_forecastEndDate; /** * skip opening date when fetching transactions of an account diff --git a/kmymoney2/mymoney/mymoneyforecasttest.cpp b/kmymoney2/mymoney/mymoneyforecasttest.cpp index dbe96ac..c200a1f 100644 --- a/kmymoney2/mymoney/mymoneyforecasttest.cpp +++ b/kmymoney2/mymoney/mymoneyforecasttest.cpp @@ -17,7 +17,7 @@ #include "mymoneyforecasttest.h" #include <iostream> -#include <qvaluelist.h> +#include <tqvaluelist.h> #include "mymoneybudget.h" @@ -52,7 +52,7 @@ void MyMoneyForecastTest::setUp () { MyMoneyFileTransaction ft; file->addCurrency(MyMoneySecurity("CAD", "Canadian Dollar", "C$")); file->addCurrency(MyMoneySecurity("USD", "US Dollar", "$")); - file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", QChar(0x00A5), 100, 1)); + file->addCurrency(MyMoneySecurity("JPY", "Japanese Yen", TQChar(0x00A5), 100, 1)); file->addCurrency(MyMoneySecurity("GBP", "British Pound", "#")); file->setBaseCurrency(file->currency("USD")); @@ -65,20 +65,20 @@ void MyMoneyForecastTest::setUp () { acLiability = (MyMoneyFile::instance()->liability().id()); acExpense = (MyMoneyFile::instance()->expense().id()); acIncome = (MyMoneyFile::instance()->income().id()); - acChecking = makeAccount(QString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,QDate(2004,5,15),acAsset, "USD"); - acCredit = makeAccount(QString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,QDate(2004,7,15),acLiability, "USD"); - acSolo = makeAccount(QString("Solo"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acParent = makeAccount(QString("Parent"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acChild = makeAccount(QString("Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent, "USD"); - acForeign = makeAccount(QString("Foreign"),MyMoneyAccount::Expense,0,QDate(2004,1,11),acExpense, "USD"); - acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,QDate(2004,1,1),acAsset, "USD"); - - acSecondChild = makeAccount(QString("Second Child"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acParent, "USD"); - acGrandChild1 = makeAccount(QString("Grand Child 1"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild, "USD"); - acGrandChild2 = makeAccount(QString("Grand Child 2"),MyMoneyAccount::Expense,0,QDate(2004,2,11),acChild, "USD"); + acChecking = makeAccount(TQString("Checking Account"),MyMoneyAccount::Checkings,moCheckingOpen,TQDate(2004,5,15),acAsset, "USD"); + acCredit = makeAccount(TQString("Credit Card"),MyMoneyAccount::CreditCard,moCreditOpen,TQDate(2004,7,15),acLiability, "USD"); + acSolo = makeAccount(TQString("Solo"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acParent = makeAccount(TQString("Parent"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acChild = makeAccount(TQString("Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent, "USD"); + acForeign = makeAccount(TQString("Foreign"),MyMoneyAccount::Expense,0,TQDate(2004,1,11),acExpense, "USD"); + acInvestment = makeAccount("Investment",MyMoneyAccount::Investment,moZero,TQDate(2004,1,1),acAsset, "USD"); + + acSecondChild = makeAccount(TQString("Second Child"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acParent, "USD"); + acGrandChild1 = makeAccount(TQString("Grand Child 1"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD"); + acGrandChild2 = makeAccount(TQString("Grand Child 2"),MyMoneyAccount::Expense,0,TQDate(2004,2,11),acChild, "USD"); //this account added to have an account to test opening date calculations - acCash = makeAccount(QString("Cash"),MyMoneyAccount::Cash,moCreditOpen,QDate::currentDate().addDays(-2),acAsset, "USD"); + acCash = makeAccount(TQString("Cash"),MyMoneyAccount::Cash,moCreditOpen,TQDate::tqcurrentDate().addDays(-2),acAsset, "USD"); MyMoneyInstitution i("Bank of the World","","","","","",""); @@ -97,18 +97,18 @@ void MyMoneyForecastTest::testEmptyConstructor() { MyMoneyForecast a; MyMoneyAccount b; - int f = a.forecastBalance(b, QDate::currentDate()); + int f = a.forecastBalance(b, TQDate::tqcurrentDate()); CPPUNIT_ASSERT(f == 0); CPPUNIT_ASSERT(!a.isForecastAccount(b)); - CPPUNIT_ASSERT(a.forecastBalance(b, QDate::currentDate()) == MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(b, TQDate::tqcurrentDate()) == MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.daysToMinimumBalance(b) == -1); CPPUNIT_ASSERT(a.daysToZeroBalance(b) == -2); CPPUNIT_ASSERT(a.forecastDays() == KMyMoneyGlobalSettings::forecastDays()); CPPUNIT_ASSERT(a.accountsCycle() == KMyMoneyGlobalSettings::forecastAccountCycle()); CPPUNIT_ASSERT(a.forecastCycles() == KMyMoneyGlobalSettings::forecastCycles()); - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); - CPPUNIT_ASSERT(a.historyEndDate() == QDate::currentDate().addDays(-1)); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-KMyMoneyGlobalSettings::forecastCycles()*KMyMoneyGlobalSettings::forecastAccountCycle())); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1)); CPPUNIT_ASSERT(a.historyDays() == KMyMoneyGlobalSettings::forecastAccountCycle() * KMyMoneyGlobalSettings::forecastCycles()); } @@ -177,9 +177,9 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //this is just to check nothing goes wrong if forecast is run agains an empty template //setup some transactions - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -190,32 +190,32 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); //checking didn't have balance variations, so the forecast should be equal to the current balance - MyMoneyMoney b_checking = file->balance(a_checking.id(), QDate::currentDate()); + MyMoneyMoney b_checking = file->balance(a_checking.id(), TQDate::tqcurrentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(1))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(2))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(3))==b_checking); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate())==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(1))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(2))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(3))==b_checking); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate())==b_checking); //credit had a variation so the forecast should be different for each day - MyMoneyMoney b_credit = file->balance(a_credit.id(), QDate::currentDate()); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); a.setHistoryMethod(1); //weighted moving average a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(moT2-moT1))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(moT2-moT1))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)) == (b_credit+((moT2-moT1)*2))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3)) == b_credit+((moT2-moT1)*3)); //insert transactions outside the forecast period. The calculation should be the same. - TransactionHelper t4( QDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t5( QDate::currentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); - TransactionHelper t6( QDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t5( TQDate::tqcurrentDate().addDays(-10), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); + TransactionHelper t6( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acCredit, acParent ); a.setForecastMethod(1); a.setForecastDays(3); @@ -225,14 +225,14 @@ void MyMoneyForecastTest::testDoForecast() { a.setHistoryMethod(0); //moving average a.doForecast(); //check forecast - b_credit = file->balance(a_credit.id(), QDate::currentDate()); + b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); MyMoneyMoney b_credit_1_exp = (b_credit+((moT2-moT1))); - MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, QDate::currentDate().addDays(2)); + MyMoneyMoney b_credit_2 = a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2)); MyMoneyMoney b_credit_2_exp = (b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate())==file->balance(a_credit.id(), QDate::currentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); //test weighted moving average a.setForecastMethod(1); @@ -244,7 +244,7 @@ void MyMoneyForecastTest::testDoForecast() { a.doForecast(); CPPUNIT_ASSERT(a.forecastBalance(a_credit, 0) == b_credit); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1)) == (b_credit+(((moT2-moT1)*3+moT2*2+moT2)/MyMoneyMoney(6,1)))); } @@ -253,19 +253,19 @@ void MyMoneyForecastTest::testGetForecastAccountList() MyMoneyForecast a; MyMoneyAccount a_checking = file->account(acChecking); MyMoneyAccount a_parent = file->account(acParent); - QValueList<MyMoneyAccount> b; + TQValueList<MyMoneyAccount> b; b = a.forecastAccountList(); //check that it contains asset account, but not expense accounts - CPPUNIT_ASSERT(b.contains(a_checking)); - CPPUNIT_ASSERT(!b.contains(a_parent)); + CPPUNIT_ASSERT(b.tqcontains(a_checking)); + CPPUNIT_ASSERT(!b.tqcontains(a_parent)); } void MyMoneyForecastTest::testCalculateAccountTrend() { //set up environment - TransactionHelper t1( QDate::currentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-3), MyMoneySplit::ActionDeposit, -moT2, acChecking, acSolo ); MyMoneyAccount a_checking = file->account(acChecking); //test invalid arguments @@ -296,8 +296,8 @@ void MyMoneyForecastTest::testCalculateAccountTrend() //test that it does not take into account the transactions of the opening date of the account MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t2( QDate::currentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, moT1, acCash, acParent ); CPPUNIT_ASSERT(MyMoneyForecast::calculateAccountTrend(a_cash,3) == -moT1); } @@ -307,9 +307,9 @@ void MyMoneyForecastTest::testGetForecastBalance() //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); a.setForecastMethod(1); a.setForecastDays(3); @@ -322,23 +322,23 @@ void MyMoneyForecastTest::testGetForecastBalance() MyMoneyAccount a_credit = file->account(acCredit); //test invalid arguments - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(-1))==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(-10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-1))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(-10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -1)==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, -100)==MyMoneyMoney(0,1)); //test a date outside the forecast days - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(4))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(4))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 4)==MyMoneyMoney(0,1)); - CPPUNIT_ASSERT(a.forecastBalance(a_checking, QDate::currentDate().addDays(10))==MyMoneyMoney(0,1)); + CPPUNIT_ASSERT(a.forecastBalance(a_checking, TQDate::tqcurrentDate().addDays(10))==MyMoneyMoney(0,1)); CPPUNIT_ASSERT(a.forecastBalance(a_checking, 10)==MyMoneyMoney(0,1)); //test it returns valid results - MyMoneyMoney b_credit = file->balance(a_credit.id(), QDate::currentDate()); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate())==file->balance(a_credit.id(), QDate::currentDate())); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(1))==b_credit+(moT2-moT1)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(2))==b_credit+((moT2-moT1)*2)); - CPPUNIT_ASSERT(a.forecastBalance(a_credit, QDate::currentDate().addDays(3))==b_credit+((moT2-moT1)*3)); + MyMoneyMoney b_credit = file->balance(a_credit.id(), TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate())==file->balance(a_credit.id(), TQDate::tqcurrentDate())); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(1))==b_credit+(moT2-moT1)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(2))==b_credit+((moT2-moT1)*2)); + CPPUNIT_ASSERT(a.forecastBalance(a_credit, TQDate::tqcurrentDate().addDays(3))==b_credit+((moT2-moT1)*3)); } void MyMoneyForecastTest::testIsForecastAccount() @@ -364,10 +364,10 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() MyMoneyForecast a; MyMoneyAccount a_cash = file->account(acCash); - TransactionHelper t1( QDate::currentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); - TransactionHelper t4( QDate::currentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, -moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(3), MyMoneySplit::ActionDeposit, -moT3, acCash, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(10), MyMoneySplit::ActionDeposit, -moT4, acCash, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -375,13 +375,13 @@ void MyMoneyForecastTest::testDoFutureScheduledForecast() a.setForecastCycles(1); a.doForecast(); - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash+moT1); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash+moT1+moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(3))==b_cash+moT1+moT2+moT3); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash+moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash+moT1+moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash+moT1+moT2+moT3); } void MyMoneyForecastTest::testScheduleForecast() @@ -395,14 +395,14 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(1), - QDate(), + TQDate::tqcurrentDate().addDays(1), + TQDate(), true, true); MyMoneyTransaction t; - t.setPostDate(QDate::currentDate().addDays(1)); - t.setEntryDate(QDate::currentDate().addDays(1)); + t.setPostDate(TQDate::tqcurrentDate().addDays(1)); + t.setEntryDate(TQDate::tqcurrentDate().addDays(1)); //t.setId("T000000000000000001"); t.setBankID("BID"); t.setMemo("Wohnung:Miete"); @@ -437,18 +437,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(5), - QDate(), + TQDate::tqcurrentDate().addDays(5), + TQDate(), true, true); - //sch.setLastPayment(QDate::currentDate()); - //sch.recordPayment(QDate::currentDate().addDays(1)); + //sch.setLastPayment(TQDate::tqcurrentDate()); + //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t3; - t3.setPostDate(QDate::currentDate().addDays(5)); - t3.setEntryDate(QDate::currentDate().addDays(5)); + t3.setPostDate(TQDate::tqcurrentDate().addDays(5)); + t3.setEntryDate(TQDate::tqcurrentDate().addDays(5)); //t.setId("T000000000000000001"); t3.setBankID("BID"); t3.setMemo("Wohnung:Miete"); @@ -484,18 +484,18 @@ void MyMoneyForecastTest::testScheduleForecast() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate().addDays(2), - QDate(), + TQDate::tqcurrentDate().addDays(2), + TQDate(), true, true); - //sch.setLastPayment(QDate::currentDate()); - //sch.recordPayment(QDate::currentDate().addDays(1)); + //sch.setLastPayment(TQDate::tqcurrentDate()); + //sch.recordPayment(TQDate::tqcurrentDate().addDays(1)); //sch.setId("SCH0001"); MyMoneyTransaction t2; - t2.setPostDate(QDate::currentDate().addDays(2)); - t2.setEntryDate(QDate::currentDate().addDays(2)); + t2.setPostDate(TQDate::tqcurrentDate().addDays(2)); + t2.setEntryDate(TQDate::tqcurrentDate().addDays(2)); //t.setId("T000000000000000001"); t2.setBankID("BID"); t2.setMemo("Wohnung:Miete"); @@ -535,13 +535,13 @@ void MyMoneyForecastTest::testScheduleForecast() a.doForecast(); //check result for single schedule - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, QDate::currentDate().addDays(1)); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); //test valid results - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash-moT2-moT1); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2-moT1); } @@ -555,10 +555,10 @@ void MyMoneyForecastTest::testDaysToMinimumBalance() MyMoneyAccount a_parent = file->account(acParent); a_cash.setValue("minBalanceAbsolute", "50"); a_credit.setValue("minBalanceAbsolute", "50"); - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); - TransactionHelper t4( QDate::currentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -moT1, acCash, acParent ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionDeposit, moT2, acCash, acParent ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, -moT1, acCredit, acParent ); + TransactionHelper t4( TQDate::tqcurrentDate().addDays(4), MyMoneySplit::ActionWithdrawal, moT5, acCredit, acParent ); a.setForecastMethod(0); a.setForecastDays(3); @@ -588,9 +588,9 @@ void MyMoneyForecastTest::testDaysToZeroBalance() MyMoneyAccount a_Credit = file->account(acCredit); //MyMoneyFileTransaction ft; - TransactionHelper t1( QDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); - TransactionHelper t2( QDate::currentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); - TransactionHelper t3( QDate::currentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, -moT1, acChecking, acSolo ); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionTransfer, (moT5), acCash, acCredit ); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(2), MyMoneySplit::ActionWithdrawal, (moT5*100), acCredit, acParent ); //ft.commit(); MyMoneyForecast a; @@ -618,7 +618,7 @@ void MyMoneyForecastTest::testDaysToZeroBalance() //test it warns when inside the forecast period - MyMoneyMoney fCash = a.forecastBalance(a_Cash, QDate::currentDate().addDays(2)); + MyMoneyMoney fCash = a.forecastBalance(a_Cash, TQDate::tqcurrentDate().addDays(2)); CPPUNIT_ASSERT(a.daysToZeroBalance(a_Cash) == 2); @@ -631,8 +631,8 @@ void MyMoneyForecastTest::testSkipOpeningDate() //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -644,12 +644,12 @@ void MyMoneyForecastTest::testSkipOpeningDate() MyMoneyAccount a_cash = file->account(acCash); //test it has no variation because it skipped the variation of the opening date - MyMoneyMoney b_cash = file->balance(a_cash.id(), QDate::currentDate()); + MyMoneyMoney b_cash = file->balance(a_cash.id(), TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.skipOpeningDate() == true); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate())==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(1))==b_cash); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(2))==b_cash-moT2); - CPPUNIT_ASSERT(a.forecastBalance(a_cash, QDate::currentDate().addDays(3))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate())==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1))==b_cash); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2))==b_cash-moT2); + CPPUNIT_ASSERT(a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3))==b_cash-moT2); } void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { @@ -657,34 +657,34 @@ void MyMoneyForecastTest::testAccountMinimumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(QDate::currentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); //test - QValueList<QDate> dateList; + TQValueList<TQDate> dateList; dateList = a.accountMinimumBalanceDateList(a_cash); - QValueList<QDate>::iterator it = dateList.begin(); + TQValueList<TQDate>::iterator it = dateList.begin(); - QDate minDate = *it; + TQDate minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(2)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(2)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(4)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(4)); it++; minDate = *it; - CPPUNIT_ASSERT(minDate==QDate::currentDate().addDays(6)); + CPPUNIT_ASSERT(minDate==TQDate::tqcurrentDate().addDays(6)); } @@ -692,34 +692,34 @@ void MyMoneyForecastTest::testAccountMaximumBalanceDateList() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(6); a.setAccountsCycle(2); a.setForecastCycles(3); a.setHistoryMethod(0); - a.setBeginForecastDay(QDate::currentDate().addDays(1).day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().addDays(1).day()); a.doForecast(); MyMoneyAccount a_cash = file->account(acCash); //test - QValueList<QDate> dateList; + TQValueList<TQDate> dateList; dateList = a.accountMaximumBalanceDateList(a_cash); - QValueList<QDate>::iterator it = dateList.begin(); + TQValueList<TQDate>::iterator it = dateList.begin(); - QDate maxDate = *it; + TQDate maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(1)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(1)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(3)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(3)); it++; maxDate = *it; - CPPUNIT_ASSERT(maxDate==QDate::currentDate().addDays(5)); + CPPUNIT_ASSERT(maxDate==TQDate::tqcurrentDate().addDays(5)); } @@ -728,8 +728,8 @@ void MyMoneyForecastTest::testAccountAverageBalance() { //set up environment MyMoneyForecast a; - TransactionHelper t1( QDate::currentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-2), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acSolo); a.setForecastMethod(1); a.setForecastDays(3); @@ -741,9 +741,9 @@ void MyMoneyForecastTest::testAccountAverageBalance() { MyMoneyAccount a_cash = file->account(acCash); //test - MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, QDate::currentDate().addDays(1)); - MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, QDate::currentDate().addDays(2)); - MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, QDate::currentDate().addDays(3)); + MyMoneyMoney b_cash1 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(1)); + MyMoneyMoney b_cash2 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(2)); + MyMoneyMoney b_cash3 = a.forecastBalance(a_cash, TQDate::tqcurrentDate().addDays(3)); MyMoneyMoney average = (b_cash1 + b_cash2 +b_cash3)/MyMoneyMoney(3,1); @@ -754,7 +754,7 @@ void MyMoneyForecastTest::testAccountAverageBalance() { void MyMoneyForecastTest::testBeginForecastDate() { //set up environment MyMoneyForecast a; - QDate beginDate; + TQDate beginDate; int beginDay; a.setForecastMethod(1); @@ -765,7 +765,7 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test when using old method without begin day - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); //setup begin to last day of month a.setBeginForecastDay(31); @@ -773,22 +773,22 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(QDate::currentDate().day() < beginDay) + if(TQDate::tqcurrentDate().day() < beginDay) { - if(QDate::currentDate().daysInMonth() < beginDay) - beginDay = QDate::currentDate().daysInMonth(); + if(TQDate::tqcurrentDate().daysInMonth() < beginDay) + beginDay = TQDate::tqcurrentDate().daysInMonth(); - beginDate = QDate(QDate::currentDate().year(), QDate::currentDate().month(), beginDay); + beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } //setup begin day to same date - a.setBeginForecastDay(QDate::currentDate().day()); + a.setBeginForecastDay(TQDate::tqcurrentDate().day()); beginDay = a.beginForecastDay(); a.doForecast(); - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); //setup to first day of month with small interval a.setBeginForecastDay(1); @@ -797,14 +797,14 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.doForecast(); //test - if(QDate::currentDate() == a.beginForecastDate()) { - CPPUNIT_ASSERT(QDate::currentDate() == a.beginForecastDate()); + if(TQDate::tqcurrentDate() == a.beginForecastDate()) { + CPPUNIT_ASSERT(TQDate::tqcurrentDate() == a.beginForecastDate()); } else { - beginDay = ((((QDate::currentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; - if(beginDay > QDate::currentDate().daysInMonth()) - beginDay = QDate::currentDate().daysInMonth(); - beginDate = QDate(QDate::currentDate().year(), QDate::currentDate().month(), beginDay); - if(QDate::currentDate().day() == QDate::currentDate().daysInMonth() ) { + beginDay = ((((TQDate::tqcurrentDate().day() - beginDay)/a.accountsCycle()) + 1) * a.accountsCycle()) + beginDay; + if(beginDay > TQDate::tqcurrentDate().daysInMonth()) + beginDay = TQDate::tqcurrentDate().daysInMonth(); + beginDate = TQDate(TQDate::tqcurrentDate().year(), TQDate::tqcurrentDate().month(), beginDay); + if(TQDate::tqcurrentDate().day() == TQDate::tqcurrentDate().daysInMonth() ) { std::cout << std::endl << "testBeginForecastDate(): test of first day of month with small interval skipped because it is the last day of month" << std::endl; } else { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); @@ -813,9 +813,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { //setup to test when current date plus cycle equals begin day a.setAccountsCycle(14); - beginDay = QDate::currentDate().addDays(14).day(); + beginDay = TQDate::tqcurrentDate().addDays(14).day(); a.setBeginForecastDay(beginDay); - beginDate = QDate::currentDate().addDays(14); + beginDate = TQDate::tqcurrentDate().addDays(14); a.doForecast(); //test @@ -826,10 +826,10 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setAccountsCycle(40); a.doForecast(); - beginDate = QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1); + beginDate = TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1); //test - if(QDate::currentDate().day() > 1) { + if(TQDate::tqcurrentDate().day() > 1) { CPPUNIT_ASSERT(beginDate == a.beginForecastDate()); } else { //test is not valid if today is 1st of month @@ -841,8 +841,8 @@ void MyMoneyForecastTest::testBeginForecastDate() { { MyMoneyForecast a; - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); - CPPUNIT_ASSERT(a.historyEndDate() == QDate::currentDate().addDays(-1) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-a.forecastCycles()*a.accountsCycle()) ); + CPPUNIT_ASSERT(a.historyEndDate() == TQDate::tqcurrentDate().addDays(-1) ); CPPUNIT_ASSERT(a.historyDays() == a.forecastCycles()*a.accountsCycle()); a.setForecastMethod(1); @@ -852,9 +852,9 @@ void MyMoneyForecastTest::testBeginForecastDate() { a.setBeginForecastDay(0); a.doForecast(); - CPPUNIT_ASSERT(a.historyStartDate() == QDate::currentDate().addDays(-14*3) ); + CPPUNIT_ASSERT(a.historyStartDate() == TQDate::tqcurrentDate().addDays(-14*3) ); CPPUNIT_ASSERT(a.historyDays() == (14*3)); - CPPUNIT_ASSERT(a.historyEndDate() == (QDate::currentDate().addDays(-1)) ); + CPPUNIT_ASSERT(a.historyEndDate() == (TQDate::tqcurrentDate().addDays(-1)) ); } void MyMoneyForecastTest::testCreateBudget() @@ -864,43 +864,43 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneyForecast b; MyMoneyBudget budget; - TransactionHelper t1( QDate(2005, 1, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t2( QDate(2005, 1, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); - TransactionHelper t3( QDate(2005, 1, 30), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); - TransactionHelper t4( QDate(2006, 1, 25), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); - TransactionHelper t5( QDate(2005, 4, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); - TransactionHelper t6( QDate(2006, 5, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); - TransactionHelper t7( QDate(2005, 8, 3), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); - TransactionHelper t8( QDate(2006, 9, 15), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); + TransactionHelper t1( TQDate(2005, 1, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t2( TQDate(2005, 1, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); + TransactionHelper t3( TQDate(2005, 1, 30), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); + TransactionHelper t4( TQDate(2006, 1, 25), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); + TransactionHelper t5( TQDate(2005, 4, 3), MyMoneySplit::ActionWithdrawal, this->moT1, acCash, acSolo); + TransactionHelper t6( TQDate(2006, 5, 15), MyMoneySplit::ActionWithdrawal, this->moT2, acCash, acParent); + TransactionHelper t7( TQDate(2005, 8, 3), MyMoneySplit::ActionWithdrawal, this->moT3, acCash, acSolo); + TransactionHelper t8( TQDate(2006, 9, 15), MyMoneySplit::ActionWithdrawal, this->moT4, acCash, acParent); a.setHistoryMethod(0); a.setForecastMethod(1); - a.createBudget(budget, QDate(2005, 1, 1), QDate(2006, 12, 31), QDate(2007, 1, 1), QDate(2007, 12, 31), true); + a.createBudget(budget, TQDate(2005, 1, 1), TQDate(2006, 12, 31), TQDate(2007, 1, 1), TQDate(2007, 12, 31), true); //test MyMoneyAccount a_solo = file->account(acSolo); MyMoneyAccount a_parent = file->account(acParent); //test it has no variation because it skipped the variation of the opening date - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 1, 1)) == ((moT1+moT3)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 1, 1)) == ((moT2+moT4)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 4, 1)) == ((moT1)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 5, 1)) == ((moT2)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_solo, QDate(2007, 8, 1)) == ((moT3)/MyMoneyMoney(2, 1))); - CPPUNIT_ASSERT(a.forecastBalance(a_parent, QDate(2007, 9, 1)) == ((moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 1, 1)) == ((moT1+moT3)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 1, 1)) == ((moT2+moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 4, 1)) == ((moT1)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 5, 1)) == ((moT2)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_solo, TQDate(2007, 8, 1)) == ((moT3)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(a.forecastBalance(a_parent, TQDate(2007, 9, 1)) == ((moT4)/MyMoneyMoney(2, 1))); //test the budget object returned by the method - CPPUNIT_ASSERT(budget.account(a_parent.id()).period(QDate(2007, 9, 1)).amount() == ((moT4)/MyMoneyMoney(2, 1))); + CPPUNIT_ASSERT(budget.account(a_parent.id()).period(TQDate(2007, 9, 1)).amount() == ((moT4)/MyMoneyMoney(2, 1))); //setup test for a length lower than a year b.setForecastMethod(1); b.setHistoryMethod(0); - b.createBudget(budget, QDate(2005, 1, 1), QDate(2005, 6, 30), QDate(2007, 1, 1), QDate(2007, 6, 30), true); + b.createBudget(budget, TQDate(2005, 1, 1), TQDate(2005, 6, 30), TQDate(2007, 1, 1), TQDate(2007, 6, 30), true); //test - CPPUNIT_ASSERT(b.forecastBalance(a_solo, QDate(2007, 1, 1)) == (moT1+moT3)); - CPPUNIT_ASSERT(b.forecastBalance(a_parent, QDate(2007, 1, 1)) == (moT2)); - CPPUNIT_ASSERT(b.forecastBalance(a_solo, QDate(2007, 4, 1)) == (moT1)); - CPPUNIT_ASSERT(b.forecastBalance(a_parent, QDate(2007, 5, 1)) == (MyMoneyMoney(0, 1))); + CPPUNIT_ASSERT(b.forecastBalance(a_solo, TQDate(2007, 1, 1)) == (moT1+moT3)); + CPPUNIT_ASSERT(b.forecastBalance(a_parent, TQDate(2007, 1, 1)) == (moT2)); + CPPUNIT_ASSERT(b.forecastBalance(a_solo, TQDate(2007, 4, 1)) == (moT1)); + CPPUNIT_ASSERT(b.forecastBalance(a_parent, TQDate(2007, 5, 1)) == (MyMoneyMoney(0, 1))); //set up schedule environment for testing MyMoneyAccount a_cash = file->account(acCash); @@ -910,14 +910,14 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_MONTHLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); MyMoneyTransaction t10; - t10.setPostDate(QDate::currentDate().addMonths(1)); - t10.setEntryDate(QDate::currentDate().addMonths(1)); + t10.setPostDate(TQDate::tqcurrentDate().addMonths(1)); + t10.setEntryDate(TQDate::tqcurrentDate().addMonths(1)); //t.setId("T000000000000000001"); t10.setBankID("BID"); t10.setMemo("Wohnung:Miete"); @@ -951,12 +951,12 @@ void MyMoneyForecastTest::testCreateBudget() MyMoneyForecast c; c.setForecastMethod(0); c.setForecastCycles(1); - c.createBudget(budget, QDate::currentDate().addYears(-2), QDate::currentDate().addYears(-1), QDate::currentDate().addMonths(-2), QDate::currentDate().addMonths(6), true); + c.createBudget(budget, TQDate::tqcurrentDate().addYears(-2), TQDate::tqcurrentDate().addYears(-1), TQDate::tqcurrentDate().addMonths(-2), TQDate::tqcurrentDate().addMonths(6), true); - MyMoneyMoney c_parent = c.forecastBalance(a_parent, QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1) ); + MyMoneyMoney c_parent = c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ); //test valid results - CPPUNIT_ASSERT(c.forecastBalance(a_parent, QDate(QDate::currentDate().addMonths(1).year(), QDate::currentDate().addMonths(1).month(), 1) ) == (moT2)); + CPPUNIT_ASSERT(c.forecastBalance(a_parent, TQDate(TQDate::tqcurrentDate().addMonths(1).year(), TQDate::tqcurrentDate().addMonths(1).month(), 1) ) == (moT2)); } void MyMoneyForecastTest::testLinearRegression() { @@ -967,9 +967,9 @@ void MyMoneyForecastTest::testLinearRegression() { MyMoneyAccount a_credit = file->account(acCredit); //setup some transactions - TransactionHelper t1( QDate::currentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); - TransactionHelper t2( QDate::currentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); - TransactionHelper t3( QDate::currentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); + TransactionHelper t1( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionWithdrawal, this->moT1, acChecking, acSolo); + TransactionHelper t2( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionDeposit, -(this->moT2), acCredit, acParent); + TransactionHelper t3( TQDate::tqcurrentDate().addDays(-1), MyMoneySplit::ActionTransfer, this->moT1, acCredit, acChecking); //TODO Add tests specific for linear regression diff --git a/kmymoney2/mymoney/mymoneyinstitution.cpp b/kmymoney2/mymoney/mymoneyinstitution.cpp index 9969ee7..5b3b19e 100644 --- a/kmymoney2/mymoney/mymoneyinstitution.cpp +++ b/kmymoney2/mymoney/mymoneyinstitution.cpp @@ -34,20 +34,20 @@ MyMoneyInstitution::MyMoneyInstitution() { } -MyMoneyInstitution::MyMoneyInstitution(const QString& id, const MyMoneyInstitution& right) : +MyMoneyInstitution::MyMoneyInstitution(const TQString& id, const MyMoneyInstitution& right) : MyMoneyObject(id) { *this = right; m_id = id; } -MyMoneyInstitution::MyMoneyInstitution(const QString& name, - const QString& town, - const QString& street, - const QString& postcode, - const QString& telephone, - const QString& manager, - const QString& sortcode) +MyMoneyInstitution::MyMoneyInstitution(const TQString& name, + const TQString& town, + const TQString& street, + const TQString& postcode, + const TQString& telephone, + const TQString& manager, + const TQString& sortcode) { clearId(); m_name = name; @@ -59,7 +59,7 @@ MyMoneyInstitution::MyMoneyInstitution(const QString& name, m_sortcode = sortcode; } -MyMoneyInstitution::MyMoneyInstitution(const QDomElement& node) : +MyMoneyInstitution::MyMoneyInstitution(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { @@ -70,13 +70,13 @@ MyMoneyInstitution::MyMoneyInstitution(const QDomElement& node) : m_name = node.attribute("name"); m_manager = node.attribute("manager"); - QDomNodeList nodeList = node.elementsByTagName("ADDRESS"); + TQDomNodeList nodeList = node.elementsByTagName("ADDRESS"); if(nodeList.count() == 0) { - QString msg = QString("No ADDRESS in institution %1").arg(m_name); + TQString msg = TQString("No ADDRESS in institution %1").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } - QDomElement addrNode = nodeList.item(0).toElement(); + TQDomElement addrNode = nodeList.item(0).toElement(); m_street = addrNode.attribute("street"); m_town = addrNode.attribute("city"); m_postcode = addrNode.attribute("zip"); @@ -97,19 +97,19 @@ MyMoneyInstitution::~MyMoneyInstitution() { } -void MyMoneyInstitution::addAccountId(const QString& account) +void MyMoneyInstitution::addAccountId(const TQString& account) { // only add this account if it is not yet presently in the list - if(m_accountList.contains(account) == 0) + if(m_accountList.tqcontains(account) == 0) m_accountList.append(account); } -QString MyMoneyInstitution::removeAccountId(const QString& account) +TQString MyMoneyInstitution::removeAccountId(const TQString& account) { - QStringList::Iterator pos; - QString rc; + TQStringList::Iterator pos; + TQString rc; - pos = m_accountList.find(account); + pos = m_accountList.tqfind(account); if(pos != m_accountList.end()) { m_accountList.remove(pos); rc = account; @@ -138,9 +138,9 @@ bool MyMoneyInstitution::operator == (const MyMoneyInstitution& right) const return false; } -void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyInstitution::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("INSTITUTION"); + TQDomElement el = document.createElement("INSTITUTION"); writeBaseXML(document, el); @@ -148,7 +148,7 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c el.setAttribute("manager", m_manager); el.setAttribute("sortcode", m_sortcode); - QDomElement address = document.createElement("ADDRESS"); + TQDomElement address = document.createElement("ADDRESS"); address.setAttribute("street", m_street); address.setAttribute("city", m_town); address.setAttribute("zip", m_postcode); @@ -156,9 +156,9 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c el.appendChild(address); - QDomElement accounts = document.createElement("ACCOUNTIDS"); - for(QStringList::ConstIterator it = accountList().begin(); it != accountList().end(); ++it){ - QDomElement temp = document.createElement("ACCOUNTID"); + TQDomElement accounts = document.createElement("ACCOUNTIDS"); + for(TQStringList::ConstIterator it = accountList().begin(); it != accountList().end(); ++it){ + TQDomElement temp = document.createElement("ACCOUNTID"); temp.setAttribute("id", (*it)); accounts.appendChild(temp); } @@ -167,16 +167,16 @@ void MyMoneyInstitution::writeXML(QDomDocument& document, QDomElement& parent) c //Add in Key-Value Pairs for institutions. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyInstitution::hasReferenceTo(const QString& /* id */) const +bool MyMoneyInstitution::hasReferenceTo(const TQString& /* id */) const { bool rc = false; return rc; } -QPixmap MyMoneyInstitution::pixmap() const { - return QPixmap(KGlobal::dirs()->findResource("appdata",QString( "icons/hicolor/22x22/actions/%1.png").arg("bank"))); +TQPixmap MyMoneyInstitution::pixmap() const { + return TQPixmap(KGlobal::dirs()->findResource("appdata",TQString( "icons/hicolor/22x22/actions/%1.png").tqarg("bank"))); } diff --git a/kmymoney2/mymoney/mymoneyinstitution.h b/kmymoney2/mymoney/mymoneyinstitution.h index 35b44c5..47d9321 100644 --- a/kmymoney2/mymoney/mymoneyinstitution.h +++ b/kmymoney2/mymoney/mymoneyinstitution.h @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qmap.h> -#include <qstringlist.h> -#include <qpixmap.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqstringlist.h> +#include <tqpixmap.h> // ---------------------------------------------------------------------------- // Project Includes @@ -58,13 +58,13 @@ public: * values required for a new institution. This object should then be * passed to @see MyMoneyFile::addInstitution */ - MyMoneyInstitution(const QString& name, - const QString& city, - const QString& street, - const QString& postcode, - const QString& telephone, - const QString& manager, - const QString& sortCode); + MyMoneyInstitution(const TQString& name, + const TQString& city, + const TQString& street, + const TQString& postcode, + const TQString& telephone, + const TQString& manager, + const TQString& sortCode); /** * This is the destructor for any MyMoneyInstitution object @@ -77,34 +77,34 @@ public: * @param id id assigned to the new institution object * @param right institution definition */ - MyMoneyInstitution(const QString& id, const MyMoneyInstitution& right); + MyMoneyInstitution(const TQString& id, const MyMoneyInstitution& right); /** * This is the constructor for an institution that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyInstitution(const QDomElement& el); + MyMoneyInstitution(const TQDomElement& el); - const QString& manager(void) const { return m_manager; } - const QString& name(void) const { return m_name; } - const QString& postcode(void) const { return m_postcode; } - const QString& street(void) const { return m_street; } - const QString& telephone(void) const { return m_telephone; } - const QString& town(void) const { return m_town; } - const QString& city(void) const { return town(); } - const QString& sortcode(void) const { return m_sortcode; } + const TQString& manager(void) const { return m_manager; } + const TQString& name(void) const { return m_name; } + const TQString& postcode(void) const { return m_postcode; } + const TQString& street(void) const { return m_street; } + const TQString& telephone(void) const { return m_telephone; } + const TQString& town(void) const { return m_town; } + const TQString& city(void) const { return town(); } + const TQString& sortcode(void) const { return m_sortcode; } - void setManager(QString manager) { m_manager = manager; } - void setName(QString name) { m_name = name; } - void setPostcode(QString code) { m_postcode = code; } - void setStreet(QString street) { m_street = street; } - void setTelephone(QString tel) { m_telephone = tel; } - void setTown(QString town) { m_town = town; } - void setCity(QString town) { setTown(town); } - void setSortcode(QString code) { m_sortcode = code; } + void setManager(TQString manager) { m_manager = manager; } + void setName(TQString name) { m_name = name; } + void setPostcode(TQString code) { m_postcode = code; } + void setStreet(TQString street) { m_street = street; } + void setTelephone(TQString tel) { m_telephone = tel; } + void setTown(TQString town) { m_town = town; } + void setCity(TQString town) { setTown(town); } + void setSortcode(TQString code) { m_sortcode = code; } /** * This method adds the id of an account to the account list of @@ -113,7 +113,7 @@ public: * * @param account id of the account to be added */ - void addAccountId(const QString& account); + void addAccountId(const TQString& account); /** * This method deletes the id of an account from the account list @@ -122,14 +122,14 @@ public: * @param account id of the account to be deleted * @return id of account deleted, otherwise empty string */ - QString removeAccountId(const QString& account); + TQString removeAccountId(const TQString& account); /** * This method is used to return the set of accounts known to * this institution - * return QStringList of account ids + * return TQStringList of account ids */ - const QStringList& accountList(void) const { return m_accountList; } + const TQStringList& accountList(void) const { return m_accountList; } /** * This method returns the number of accounts known to @@ -141,7 +141,7 @@ public: bool operator == (const MyMoneyInstitution&) const; bool operator < (const MyMoneyInstitution& right) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -152,55 +152,55 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; - QPixmap pixmap() const; + TQPixmap pixmap() const; private: // Bank 'fields' /** * This member variable keeps the name of the institution */ - QString m_name; + TQString m_name; /** * This member variable keeps the city of the institution */ - QString m_town; + TQString m_town; /** * This member variable keeps the street of the institution */ - QString m_street; + TQString m_street; /** * This member variable keeps the zip-code of the institution */ - QString m_postcode; + TQString m_postcode; /** * This member variable keeps the telephone number of the institution */ - QString m_telephone; + TQString m_telephone; /** * This member variable keeps the name of the representative of * the institution */ - QString m_manager; + TQString m_manager; /** * This member variable keeps the sort code of the institution. * FIXME: I have no idea * what it is good for. I keep it because it was in the old engine. */ - QString m_sortcode; + TQString m_sortcode; /** * This member variable keeps the sorted list of the account ids * available at this institution */ - QStringList m_accountList; + TQStringList m_accountList; }; #endif diff --git a/kmymoney2/mymoney/mymoneyinstitutiontest.cpp b/kmymoney2/mymoney/mymoneyinstitutiontest.cpp index ce707ec..bf889b0 100644 --- a/kmymoney2/mymoney/mymoneyinstitutiontest.cpp +++ b/kmymoney2/mymoney/mymoneyinstitutiontest.cpp @@ -161,8 +161,8 @@ void MyMoneyInstitutionTest::testInequality () { void MyMoneyInstitutionTest::testAccountIDList () { MyMoneyInstitution institution; - QStringList list; - QString id; + TQStringList list; + TQString id; // list must be empty list = institution.accountList(); @@ -172,26 +172,26 @@ void MyMoneyInstitutionTest::testAccountIDList () { institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // adding same account shouldn't make a difference institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // now add another account institution.addAccountId("A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 2); - CPPUNIT_ASSERT(list.contains("A000002") == 1); - CPPUNIT_ASSERT(list.contains("A000001") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000001") == 1); id = institution.removeAccountId("A000001"); CPPUNIT_ASSERT(id == "A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); } @@ -200,17 +200,17 @@ void MyMoneyInstitutionTest::testWriteXML() { n->addAccountId("A000001"); n->addAccountId("A000003"); - n->setValue(QString("key"), "value"); + n->setValue(TQString("key"), "value"); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("INSTITUTION-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("INSTITUTION-CONTAINER"); doc.appendChild(el); MyMoneyInstitution i("I00001", *n); i.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<INSTITUTION-CONTAINER>\n" " <INSTITUTION sortcode=\"sortcode\" id=\"I00001\" manager=\"manager\" name=\"name\" >\n" @@ -230,7 +230,7 @@ void MyMoneyInstitutionTest::testWriteXML() { void MyMoneyInstitutionTest::testReadXML() { MyMoneyInstitution i; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<INSTITUTION-CONTAINER>\n" " <INSTITUTION sortcode=\"sortcode\" id=\"I00001\" manager=\"manager\" name=\"name\" >\n" @@ -245,7 +245,7 @@ void MyMoneyInstitutionTest::testReadXML() { " </INSTITUTION>\n" "</INSTITUTION-CONTAINER>\n"); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<INSTITUTION-CONTAINER>\n" " <KINSTITUTION sortcode=\"sortcode\" id=\"I00001\" manager=\"manager\" name=\"name\" >\n" @@ -257,8 +257,8 @@ void MyMoneyInstitutionTest::testReadXML() { " </KINSTITUTION>\n" "</INSTITUTION-CONTAINER>\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -274,7 +274,7 @@ void MyMoneyInstitutionTest::testReadXML() { doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); try { - QStringList alist; + TQStringList alist; alist << "A000001" << "A000003"; i = MyMoneyInstitution(node); @@ -287,7 +287,7 @@ void MyMoneyInstitutionTest::testReadXML() { CPPUNIT_ASSERT(i.city() == "town"); CPPUNIT_ASSERT(i.telephone() == "telephone"); CPPUNIT_ASSERT(i.accountList() == alist); - CPPUNIT_ASSERT(i.value(QString("key")) == "value"); + CPPUNIT_ASSERT(i.value(TQString("key")) == "value"); } catch(MyMoneyException *e) { delete e; diff --git a/kmymoney2/mymoney/mymoneyinvesttransaction.cpp b/kmymoney2/mymoney/mymoneyinvesttransaction.cpp index a7cf082..89bef92 100644 --- a/kmymoney2/mymoney/mymoneyinvesttransaction.cpp +++ b/kmymoney2/mymoney/mymoneyinvesttransaction.cpp @@ -23,10 +23,10 @@ #include "mymoneyinvesttransaction.h" #if 0 -MyMoneyInvestTransaction::MyMoneyInvestTransaction(MyMoneyAccount *parent, const long id, transactionMethod method, const QString& number, const QString& memo, - const MyMoneyMoney& amount, const QDate& date, const QString& categoryMajor, const QString& categoryMinor, const QString& atmName, - const QString& fromTo, const QString& bankFrom, const QString& bankTo, stateE state) - : MyMoneyTransaction(parent, id, method, number, memo, amount, date, categoryMajor, categoryMinor, atmName, fromTo, bankFrom, bankTo, state) +MyMoneyInvestTransaction::MyMoneyInvestTransaction(MyMoneyAccount *tqparent, const long id, transactionMethod method, const TQString& number, const TQString& memo, + const MyMoneyMoney& amount, const TQDate& date, const TQString& categoryMajor, const TQString& categoryMinor, const TQString& atmName, + const TQString& fromTo, const TQString& bankFrom, const TQString& bankTo, stateE state) + : MyMoneyTransaction(tqparent, id, method, number, memo, amount, date, categoryMajor, categoryMinor, atmName, fromTo, bankFrom, bankTo, state) { } diff --git a/kmymoney2/mymoney/mymoneyinvesttransaction.h b/kmymoney2/mymoney/mymoneyinvesttransaction.h index 59f5d5b..e414b3a 100644 --- a/kmymoney2/mymoney/mymoneyinvesttransaction.h +++ b/kmymoney2/mymoney/mymoneyinvesttransaction.h @@ -33,9 +33,9 @@ class MyMoneyInvestTransaction : public MyMoneyTransaction { public: MyMoneyInvestTransaction(); - MyMoneyInvestTransaction(MyMoneyAccount *parent, const long id, transactionMethod method, const QString& number, const QString& memo, - const MyMoneyMoney& amount, const QDate& date, const QString& categoryMajor, const QString& categoryMinor, const QString& atmName, - const QString& fromTo, const QString& bankFrom, const QString& bankTo, stateE state); + MyMoneyInvestTransaction(MyMoneyAccount *tqparent, const long id, transactionMethod method, const TQString& number, const TQString& memo, + const MyMoneyMoney& amount, const TQDate& date, const TQString& categoryMajor, const TQString& categoryMinor, const TQString& atmName, + const TQString& fromTo, const TQString& bankFrom, const TQString& bankTo, stateE state); ~MyMoneyInvestTransaction(); }; #endif diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp index 4df855b..382893a 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainer.cpp @@ -28,7 +28,7 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer() { } -MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) +MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const TQDomElement& node) { if(!node.isNull()) { if("KEYVALUEPAIRS" != node.tagName()) @@ -36,9 +36,9 @@ MyMoneyKeyValueContainer::MyMoneyKeyValueContainer(const QDomElement& node) m_kvp.clear(); - QDomNodeList nodeList = node.elementsByTagName("PAIR"); + TQDomNodeList nodeList = node.elementsByTagName("PAIR"); for(unsigned int i = 0; i < nodeList.count(); ++i) { - const QDomElement& el(nodeList.item(i).toElement()); + const TQDomElement& el(nodeList.item(i).toElement()); m_kvp[el.attribute("key")] = el.attribute("value"); } } @@ -48,32 +48,32 @@ MyMoneyKeyValueContainer::~MyMoneyKeyValueContainer() { } -const QString& MyMoneyKeyValueContainer::value(const QString& key) const +const TQString& MyMoneyKeyValueContainer::value(const TQString& key) const { - QMap<QString, QString>::ConstIterator it; + TQMap<TQString, TQString>::ConstIterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) return (*it); - return QString::null; + return TQString(); } -void MyMoneyKeyValueContainer::setValue(const QString& key, const QString& value) +void MyMoneyKeyValueContainer::setValue(const TQString& key, const TQString& value) { m_kvp[key] = value; } -void MyMoneyKeyValueContainer::setPairs(const QMap<QString, QString>& list) +void MyMoneyKeyValueContainer::setPairs(const TQMap<TQString, TQString>& list) { m_kvp = list; } -void MyMoneyKeyValueContainer::deletePair(const QString& key) +void MyMoneyKeyValueContainer::deletePair(const TQString& key) { - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString>::Iterator it; - it = m_kvp.find(key); + it = m_kvp.tqfind(key); if(it != m_kvp.end()) m_kvp.remove(it); } @@ -85,7 +85,7 @@ void MyMoneyKeyValueContainer::clear(void) bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& right) const { - QMap<QString, QString>::ConstIterator it_a, it_b; + TQMap<TQString, TQString>::ConstIterator it_a, it_b; it_a = m_kvp.begin(); it_b = right.m_kvp.begin(); @@ -101,20 +101,20 @@ bool MyMoneyKeyValueContainer::operator == (const MyMoneyKeyValueContainer& righ return (it_a == m_kvp.end() && it_b == right.m_kvp.end()); } -void MyMoneyKeyValueContainer::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyKeyValueContainer::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { if(m_kvp.count() != 0) { - QDomElement el = document.createElement("KEYVALUEPAIRS"); + TQDomElement el = document.createElement("KEYVALUEPAIRS"); - QMap<QString, QString>::ConstIterator it; + TQMap<TQString, TQString>::ConstIterator it; for(it = m_kvp.begin(); it != m_kvp.end(); ++it) { - QDomElement pair = document.createElement("PAIR"); + TQDomElement pair = document.createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); el.appendChild(pair); } - parent.appendChild(el); + tqparent.appendChild(el); } } diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainer.h b/kmymoney2/mymoney/mymoneykeyvaluecontainer.h index fa045b9..42169d5 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainer.h +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainer.h @@ -30,9 +30,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qmap.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqmap.h> +#include <tqdom.h> #include <kmymoney/export.h> // ---------------------------------------------------------------------------- @@ -53,7 +53,7 @@ class KMYMONEY_EXPORT MyMoneyKeyValueContainer { public: MyMoneyKeyValueContainer(); - MyMoneyKeyValueContainer(const QDomElement& node); + MyMoneyKeyValueContainer(const TQDomElement& node); ~MyMoneyKeyValueContainer(); @@ -61,28 +61,28 @@ public: * This method can be used to retrieve the value for a specific @p key. * If the key is unknown in this container, an empty string will be returned. * - * @param key const reference to QString with the key to search for + * @param key const reference to TQString with the key to search for * @return reference to value of this key. If the key does not exist, * an emtpy string is returned. */ - const QString& value(const QString& key) const; + const TQString& value(const TQString& key) const; /** * This method is used to add a key/value pair to the container or * modify an existing pair. * - * @param key const reference to QString with the key to search for - * @param value const reference to QString with the value for this key + * @param key const reference to TQString with the key to search for + * @param value const reference to TQString with the value for this key */ - void setValue(const QString& key, const QString& value); + void setValue(const TQString& key, const TQString& value); /** * This method is used to remove an existing key/value pair from the * container. If the key does not exist, the container is not changed. * - * @param key const reference to QString with the key to remove + * @param key const reference to TQString with the key to remove */ - void deletePair(const QString& key); + void deletePair(const TQString& key); /** * This method clears all pairs currently in the container. @@ -94,46 +94,46 @@ public: * from the container. It is meant to be used for permanent storage * functionality. * - * @return QMap<QString, QString> containing all key/value pairs of + * @return TQMap<TQString, TQString> containing all key/value pairs of * this container. */ - const QMap<QString, QString>& pairs(void) const { return m_kvp; }; + const TQMap<TQString, TQString>& pairs(void) const { return m_kvp; }; /** * This method is used to initially store a set of key/value pairs * in the container. It is meant to be used for loading functionality * from permanent storage. * - * @param list const QMap<QString, QString> containing the set of + * @param list const TQMap<TQString, TQString> containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - void setPairs(const QMap<QString, QString>& list); + void setPairs(const TQMap<TQString, TQString>& list); /** * This operator tests for equality of two MyMoneyKeyValueContainer objects */ bool operator == (const MyMoneyKeyValueContainer &) const; - const QString& operator[] ( const QString& k ) const { return value(k); } + const TQString& operator[] ( const TQString& k ) const { return value(k); } - QString& operator[] ( const QString& k) { return m_kvp[k]; } + TQString& operator[] ( const TQString& k) { return m_kvp[k]; } /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; private: /** * This member variable represents the container of key/value pairs. */ - QMap<QString, QString> m_kvp; + TQMap<TQString, TQString> m_kvp; }; #endif diff --git a/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp b/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp index 6d3d1db..bc1757d 100644 --- a/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp +++ b/kmymoney2/mymoney/mymoneykeyvaluecontainertest.cpp @@ -70,7 +70,7 @@ void MyMoneyKeyValueContainerTest::testClear() { } void MyMoneyKeyValueContainerTest::testRetrieveList() { - QMap<QString, QString> copy; + TQMap<TQString, TQString> copy; copy = m->pairs(); CPPUNIT_ASSERT(copy.count() == 0); @@ -95,12 +95,12 @@ void MyMoneyKeyValueContainerTest::testWriteXML() { m->setValue("Key", "Value"); m->setValue("key", "value"); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("KVP-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("KVP-CONTAINER"); doc.appendChild(el); m->writeXML(doc, el); - QString ref( + TQString ref( "<!DOCTYPE TEST>\n" "<KVP-CONTAINER>\n" " <KEYVALUEPAIRS>\n" @@ -116,7 +116,7 @@ void MyMoneyKeyValueContainerTest::testReadXML() { m->setValue("Key", "Value"); m->setValue("key", "value"); - QString ref_ok( + TQString ref_ok( "<!DOCTYPE TEST>\n" "<KVP-CONTAINER>\n" " <KEYVALUEPAIRS>\n" @@ -125,7 +125,7 @@ void MyMoneyKeyValueContainerTest::testReadXML() { " </KEYVALUEPAIRS>\n" "</KVP-CONTAINER>\n"); - QString ref_false( + TQString ref_false( "<!DOCTYPE TEST>\n" "<KVP-CONTAINER>\n" " <KEYVALUE-PAIRS>\n" @@ -135,14 +135,14 @@ void MyMoneyKeyValueContainerTest::testReadXML() { "</KVP-CONTAINER>\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); // make sure, an empty node does not trigger an exception try { - MyMoneyKeyValueContainer k(QDomNode()); + MyMoneyKeyValueContainer k(TQDomNode()); } catch(MyMoneyException *e) { CPPUNIT_FAIL("Unexpected exception"); delete e; diff --git a/kmymoney2/mymoney/mymoneymoney.cpp b/kmymoney2/mymoney/mymoneymoney.cpp index 993a872..ccf1d80 100644 --- a/kmymoney2/mymoney/mymoneymoney.cpp +++ b/kmymoney2/mymoney/mymoneymoney.cpp @@ -28,7 +28,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qregexp.h> +#include <tqregexp.h> // ---------------------------------------------------------------------------- // Project Includes @@ -111,7 +111,7 @@ void MyMoneyMoney::setFileVersion(fileVersionE version) _fileVersion = version; } -MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) +MyMoneyMoney::MyMoneyMoney(const TQString& pszAmount) { m_num = 0; m_denom = 1; @@ -122,15 +122,15 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) // take care of prices given in the form "8 5/16" // and our own internal represenation - QRegExp regExp("^((\\d+)\\s+|-)?(\\d+)/(\\d+)"); + TQRegExp regExp("^((\\d+)\\s+|-)?(\\d+)/(\\d+)"); // +-#2-+ +-#3-+ +-#4-+ // +-----#1-----+ if (regExp.search(pszAmount) > -1) { m_num = regExp.cap(3).toLongLong(); m_denom = regExp.cap(4).toLongLong(); - const QString& part1 = regExp.cap(1); + const TQString& part1 = regExp.cap(1); if(!part1.isEmpty()) { - if(part1 == QString("-")) { + if(part1 == TQString("-")) { m_num = -m_num; } else { @@ -140,16 +140,16 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) return; } - QString res = pszAmount; + TQString res = pszAmount; // get rid of anything that is not // a) numeric // b) _decimalSeparator // c) negative indicator - QString validChars = QString("\\d%1").arg(QChar(decimalSeparator())); + TQString validChars = TQString("\\d%1").tqarg(TQChar(decimalSeparator())); // we need to escape the minus sign here, because later on it will be // part of "\d,-()" and that does not work. It needs to be "\d,\-()" // And we need two of them, because we're in C - QString negChars("\\-"); + TQString negChars("\\-"); if(_negativeMonetarySignPosition == ParensAround) { // Since we want to allow '-' as well as '()' for negative entry // we just add the parens here. @@ -158,13 +158,13 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) validChars += negChars; // qDebug("0: '%s'", validChars.data()); - QRegExp invChars(QString("[^%1]").arg(validChars)); + TQRegExp invChars(TQString("[^%1]").tqarg(validChars)); // qDebug("1: '%s'", res.data()); res.remove(invChars); - QRegExp negCharSet(QString("[%1]").arg(negChars)); + TQRegExp negCharSet(TQString("[%1]").tqarg(negChars)); bool isNegative = false; - if(res.find(negCharSet) != -1) { + if(res.tqfind(negCharSet) != -1) { isNegative = true; res.remove(negCharSet); } @@ -172,7 +172,7 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) int pos; // qDebug("3: '%s'", res.data()); - if((pos = res.find(_decimalSeparator)) != -1) { + if((pos = res.tqfind(_decimalSeparator)) != -1) { // make sure, we get the denominator right m_denom = precToDenom(res.length() - pos - 1); @@ -187,25 +187,25 @@ MyMoneyMoney::MyMoneyMoney(const QString& pszAmount) m_num = -m_num; } -QString MyMoneyMoney::formatMoney(int denom, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(int denom, bool showThousandSeparator) const { return formatMoney("", denomToPrec(denom), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator) const { return formatMoney(sec.tradingSymbol(), denomToPrec(acc.fraction()), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator) const { return formatMoney(sec.tradingSymbol(), denomToPrec(sec.smallestAccountFraction()), showThousandSeparator); } -QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool showThousandSeparator) const +TQString MyMoneyMoney::formatMoney(const TQString& currency, const int prec, bool showThousandSeparator) const { - QString res; - QString tmpCurrency = currency; + TQString res; + TQString tmpCurrency = currency; int tmpPrec = prec; signed64 denom = 1; signed64 m_64Value; @@ -240,15 +240,15 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool if(left & 0xFFFFFFFF00000000LL) { signed64 tmp = left; - // QString.sprintf("%Ld") did not work :-(, so I had to + // TQString.sprintf("%Ld") did not work :-(, so I had to // do it the old ugly way. while(tmp) { - res.insert(0, QString("%1").arg(static_cast<int>(tmp % 10))); + res.insert(0, TQString("%1").tqarg(static_cast<int>(tmp % 10))); tmp /= 10; } } else - res = QString("%1").arg((long)left); + res = TQString("%1").tqarg((long)left); if(showThousandSeparator) { int pos = res.length(); @@ -262,13 +262,13 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool // using // - // res += QString("%1").arg(right).rightJustify(prec, '0', true); + // res += TQString("%1").tqarg(right).rightJustify(prec, '0', true); // // caused some weird results if right was rather large. Eg: right being // 666600000 should have appended a 0, but instead it prepended a 0. With // res being "2," the result wasn't "2,6666000000" as expected, but rather // "2,0666600000" which was not usable. The code below works for me. - QString rs = QString("%1").arg(right); + TQString rs = TQString("%1").tqarg(right); if(prec != -1) rs = rs.rightJustify(prec, '0', true); else { @@ -276,14 +276,14 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool // no trailing zeroes or decimal separators while(rs.endsWith("0")) rs.truncate(rs.length()-1); - while(rs.endsWith(QChar(decimalSeparator()))) + while(rs.endsWith(TQChar(decimalSeparator()))) rs.truncate(rs.length()-1); } res += rs; } signPosition signpos = bNegative ? _negativeMonetarySignPosition : _positiveMonetarySignPosition; - QString sign = bNegative ? "-" : ""; + TQString sign = bNegative ? "-" : ""; switch(signpos) { case ParensAround: @@ -316,37 +316,37 @@ QString MyMoneyMoney::formatMoney(const QString& currency, const int prec, bool return res; } -const QString MyMoneyMoney::toString(void) const +const TQString MyMoneyMoney::toString(void) const { signed64 tmp = m_num < 0 ? - m_num : m_num; - QString res; - QString resf; + TQString res; + TQString resf; - // QString.sprintf("%Ld") did not work :-(, so I had to + // TQString.sprintf("%Ld") did not work :-(, so I had to // do it the old ugly way. while(tmp) { - res.prepend(QString("%1").arg(static_cast<int>(tmp % 10))); + res.prepend(TQString("%1").tqarg(static_cast<int>(tmp % 10))); tmp /= 10; } if(res.isEmpty()) - res = QString("0"); + res = TQString("0"); if(m_num < 0) res.prepend('-'); tmp = m_denom; while(tmp) { - resf.prepend(QString("%1").arg(static_cast<int>(tmp % 10))); + resf.prepend(TQString("%1").tqarg(static_cast<int>(tmp % 10))); tmp /= 10; } return res + "/" + resf; } -QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) +TQDataStream &operator<<(TQDataStream &s, const MyMoneyMoney &_money) { // We WILL lose data here if the user has more than 2 billion pounds :-( // QT defined it here as long: - // qglobal.h:typedef long Q_INT64; + // qglobal.h:typedef long TQ_INT64; MyMoneyMoney money = _money.convert(100); @@ -355,7 +355,7 @@ QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) if(money.m_num & 0xffffffff00000000LL) qWarning("Lost data while writing out MyMoneyMoney object using deprecated 4 byte writer"); - s << static_cast<Q_INT32> (money.m_num & 0xffffffff); + s << static_cast<TQ_INT32> (money.m_num & 0xffffffff); break; default: @@ -363,16 +363,16 @@ QDataStream &operator<<(QDataStream &s, const MyMoneyMoney &_money) // tricky fall through here case MyMoneyMoney::FILE_8_BYTE_VALUE: - s << static_cast<Q_INT32> (money.m_num >> 32); - s << static_cast<Q_INT32> (money.m_num & 0xffffffff); + s << static_cast<TQ_INT32> (money.m_num >> 32); + s << static_cast<TQ_INT32> (money.m_num & 0xffffffff); break; } return s; } -QDataStream &operator>>(QDataStream &s, MyMoneyMoney &money) +TQDataStream &operator>>(TQDataStream &s, MyMoneyMoney &money) { - Q_INT32 tmp; + TQ_INT32 tmp; switch(MyMoneyMoney::_fileVersion) { case MyMoneyMoney::FILE_4_BYTE_VALUE: s >> tmp; diff --git a/kmymoney2/mymoney/mymoneymoney.h b/kmymoney2/mymoney/mymoneymoney.h index 74235c7..6ff1cae 100644 --- a/kmymoney2/mymoney/mymoneymoney.h +++ b/kmymoney2/mymoney/mymoneymoney.h @@ -39,8 +39,8 @@ #endif // So we can save this object -#include <qstring.h> -#include <qdatastream.h> +#include <tqstring.h> +#include <tqdatastream.h> #include <kmymoney/export.h> #include <kmymoney/mymoneyexception.h> @@ -98,7 +98,7 @@ public: // construction MyMoneyMoney(); MyMoneyMoney( const int iAmount, const signed64 denom = 100 ); - MyMoneyMoney( const QString& pszAmount ); + MyMoneyMoney( const TQString& pszAmount ); MyMoneyMoney( const signed64 Amount, const signed64 denom = 100 ); MyMoneyMoney( const double dAmount, const signed64 denom = 100 ); #if HAVE_LONG_DOUBLE @@ -123,20 +123,20 @@ public: * @param showThousandSeparator should the thousandSeparator symbol be inserted * (@a true) or not (@a false) (default true) */ - QString formatMoney(const QString& currency, const int prec, bool showThousandSeparator = true) const; + TQString formatMoney(const TQString& currency, const int prec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information * about currency symbol and precision out of the MyMoneySecurity and MyMoneyAccount objects * @a acc and @a sec. */ - QString formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator = true) const; + TQString formatMoney(const MyMoneyAccount& acc, const MyMoneySecurity& sec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information * about currency symbol and precision out of the MyMoneySecurity object @a sec. */ - QString formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator = true) const; + TQString formatMoney(const MyMoneySecurity& sec, bool showThousandSeparator = true) const; /** * This is a convenience method. It behaves exactly as the above one, but takes the information @@ -146,7 +146,7 @@ public: * * @note denom is often set to account.fraction(security). */ - QString formatMoney(int denom, bool showThousandSeparator = true) const; + TQString formatMoney(int denom, bool showThousandSeparator = true) const; /** * This method is used to convert the smallest fraction information into @@ -157,7 +157,7 @@ public: */ static int denomToPrec(signed64 fract); - const QString toString(void) const; + const TQString toString(void) const; const MyMoneyMoney convert(const signed64 denom = 100, const roundingMethod how = RndRound) const; static signed64 precToDenom(int prec); double toDouble(void) const; @@ -177,7 +177,7 @@ public: // assignment const MyMoneyMoney& operator=( const MyMoneyMoney& Amount ); - const MyMoneyMoney& operator=( const QString& pszAmount ); + const MyMoneyMoney& operator=( const TQString& pszAmount ); // comparison bool operator==( const MyMoneyMoney& Amount ) const; @@ -187,12 +187,12 @@ public: bool operator<=( const MyMoneyMoney& Amount ) const; bool operator>=( const MyMoneyMoney& Amount ) const; - bool operator==( const QString& pszAmount ) const; - bool operator!=( const QString& pszAmount ) const; - bool operator<( const QString& pszAmount ) const; - bool operator>( const QString& pszAmount ) const; - bool operator<=( const QString& pszAmount ) const; - bool operator>=( const QString& pszAmount ) const; + bool operator==( const TQString& pszAmount ) const; + bool operator!=( const TQString& pszAmount ) const; + bool operator<( const TQString& pszAmount ) const; + bool operator>( const TQString& pszAmount ) const; + bool operator<=( const TQString& pszAmount ) const; + bool operator>=( const TQString& pszAmount ) const; // calculation MyMoneyMoney operator+( const MyMoneyMoney& Amount ) const; @@ -230,8 +230,8 @@ private: signed64 getLcd(const MyMoneyMoney& b) const; - KMYMONEY_EXPORT friend QDataStream &operator<<(QDataStream &, const MyMoneyMoney &); - KMYMONEY_EXPORT friend QDataStream &operator>>(QDataStream &, MyMoneyMoney &); + KMYMONEY_EXPORT friend TQDataStream &operator<<(TQDataStream &, const MyMoneyMoney &); + KMYMONEY_EXPORT friend TQDataStream &operator>>(TQDataStream &, MyMoneyMoney &); static unsigned char _thousandSeparator; static unsigned char _decimalSeparator; @@ -371,7 +371,7 @@ inline const MyMoneyMoney& MyMoneyMoney::operator=(const MyMoneyMoney& Amount) // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline const MyMoneyMoney& MyMoneyMoney::operator=(const QString& pszAmount) +inline const MyMoneyMoney& MyMoneyMoney::operator=(const TQString& pszAmount) { *this = MyMoneyMoney( pszAmount ); return *this; @@ -508,7 +508,7 @@ inline bool MyMoneyMoney::operator>=(const MyMoneyMoney& Amount) const // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline bool MyMoneyMoney::operator==(const QString& pszAmount) const +inline bool MyMoneyMoney::operator==(const TQString& pszAmount) const { MyMoneyMoney Amount( pszAmount ); return ( *this == Amount ) ; @@ -523,7 +523,7 @@ inline bool MyMoneyMoney::operator==(const QString& pszAmount) const // Arguments: pszAmount - NULL terminated string that contains amount // //////////////////////////////////////////////////////////////////////////////// -inline bool MyMoneyMoney::operator!=(const QString& pszAmount) const +inline bool MyMoneyMoney::operator!=(const TQString& pszAmount) const { MyMoneyMoney Amount( pszAmount ); return ( *this != Amount ) ; diff --git a/kmymoney2/mymoney/mymoneymoneytest.cpp b/kmymoney2/mymoney/mymoneymoneytest.cpp index 64c2961..81967a1 100644 --- a/kmymoney2/mymoney/mymoneymoneytest.cpp +++ b/kmymoney2/mymoney/mymoneymoneytest.cpp @@ -97,15 +97,15 @@ void MyMoneyMoneyTest::testAssignment() CPPUNIT_ASSERT(m->m_num == -5678); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-987"); + *m = TQString("-987"); CPPUNIT_ASSERT(m->m_num == -987); CPPUNIT_ASSERT(m->m_denom == 1); - *m = QString("9998887776665554.44"); + *m = TQString("9998887776665554.44"); CPPUNIT_ASSERT(m->m_num == 999888777666555444LL); CPPUNIT_ASSERT(m->m_denom == 100); - *m = QString("-99988877766655.444"); + *m = TQString("-99988877766655.444"); CPPUNIT_ASSERT(m->m_num == -99988877766655444LL); CPPUNIT_ASSERT(m->m_denom == 1000); @@ -179,22 +179,22 @@ void MyMoneyMoneyTest::testConvert() MyMoneyMoney b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-123.456"); + a = TQString("-123.456"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == -12346); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("123.1"); + a = TQString("123.1"); b = a.convert(100); CPPUNIT_ASSERT(b.m_num == 12310); CPPUNIT_ASSERT(b.m_denom == 100); - a = QString("-73010.28"); - b = QString("1.95583"); - CPPUNIT_ASSERT((a * b).convert(100) == QString("-142795.70")); + a = TQString("-73010.28"); + b = TQString("1.95583"); + CPPUNIT_ASSERT((a * b).convert(100) == TQString("-142795.70")); - a = QString("-142795.69"); - CPPUNIT_ASSERT((a / b).convert(100) == QString("-73010.28")); + a = TQString("-142795.69"); + CPPUNIT_ASSERT((a / b).convert(100) == TQString("-73010.28")); } void MyMoneyMoneyTest::testEquality() @@ -216,7 +216,7 @@ void MyMoneyMoneyTest::testEquality() CPPUNIT_ASSERT(m5 == m6); CPPUNIT_ASSERT(m5 == m7); - CPPUNIT_ASSERT(m5 == QString("369/30")); + CPPUNIT_ASSERT(m5 == TQString("369/30")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc == MyMoneyMoney::autoCalc); } @@ -234,7 +234,7 @@ void MyMoneyMoneyTest::testInequality() MyMoneyMoney m4(LLCONST(999666555444)); CPPUNIT_ASSERT(m3 != m4); - CPPUNIT_ASSERT(m4 != QString("999666555444")); + CPPUNIT_ASSERT(m4 != TQString("999666555444")); CPPUNIT_ASSERT(MyMoneyMoney::autoCalc != MyMoneyMoney(1,100)); CPPUNIT_ASSERT(MyMoneyMoney(1,100) != MyMoneyMoney::autoCalc); @@ -258,9 +258,9 @@ void MyMoneyMoneyTest::testAddition() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(101)); // CPPUNIT_ASSERT((++m1) == MyMoneyMoney(102)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(40, 1000); - CPPUNIT_ASSERT((m1 + m2) == QString("123.24")); + CPPUNIT_ASSERT((m1 + m2) == TQString("123.24")); m1 += m2; CPPUNIT_ASSERT(m1.m_num == 123240); @@ -284,7 +284,7 @@ void MyMoneyMoneyTest::testSubtraction() // CPPUNIT_ASSERT(m1 == MyMoneyMoney(99)); // CPPUNIT_ASSERT((--m1) == MyMoneyMoney(98)); - m1 = QString("123.20"); + m1 = TQString("123.20"); MyMoneyMoney m2(1, 5); CPPUNIT_ASSERT((m1 - m2) == MyMoneyMoney(123,1)); @@ -301,9 +301,9 @@ void MyMoneyMoneyTest::testMultiplication() CPPUNIT_ASSERT((m1 * MyMoneyMoney(10000000,1)) == MyMoneyMoney(1000000000,1)); CPPUNIT_ASSERT((m1 * (*m_0)) == MyMoneyMoney(1200)); - MyMoneyMoney m2 = QString("-73010.28"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m1 * m2) == QString("-142795.6959324")); + MyMoneyMoney m2 = TQString("-73010.28"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m1 * m2) == TQString("-142795.6959324")); } void MyMoneyMoneyTest::testDivision() @@ -311,9 +311,9 @@ void MyMoneyMoneyTest::testDivision() MyMoneyMoney m1(100); CPPUNIT_ASSERT((m1 / MyMoneyMoney(50)) == MyMoneyMoney(2,1)); - MyMoneyMoney m2 = QString("-142795.69"); - m1 = QString("1.95583"); - CPPUNIT_ASSERT((m2 / m1).convert(100000000) == QString("-73010.27696681")); + MyMoneyMoney m2 = TQString("-142795.69"); + m1 = TQString("1.95583"); + CPPUNIT_ASSERT((m2 / m1).convert(100000000) == TQString("-73010.27696681")); MyMoneyMoney m3 = MyMoneyMoney(0) / MyMoneyMoney(100); CPPUNIT_ASSERT(m3.m_num == 0); @@ -325,12 +325,12 @@ void MyMoneyMoneyTest::testSetDecimalSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == '.'); MyMoneyMoney::setDecimalSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000:00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2,000:00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000:00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2,000:00")); CPPUNIT_ASSERT(MyMoneyMoney::decimalSeparator() == ':'); } @@ -340,57 +340,57 @@ void MyMoneyMoneyTest::testSetThousandSeparator() MyMoneyMoney m1(100000); MyMoneyMoney m2(200000); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ','); MyMoneyMoney::setThousandSeparator(':'); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1:000.00")); - CPPUNIT_ASSERT(m2.formatMoney("", 2) == QString("2:000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1:000.00")); + CPPUNIT_ASSERT(m2.formatMoney("", 2) == TQString("2:000.00")); CPPUNIT_ASSERT(MyMoneyMoney::thousandSeparator() == ':'); } void MyMoneyMoneyTest::testFormatMoney() { - CPPUNIT_ASSERT(m_0->formatMoney("", 2) == QString("0.12")); - CPPUNIT_ASSERT(m_1->formatMoney("", 2) == QString("-0.10")); + CPPUNIT_ASSERT(m_0->formatMoney("", 2) == TQString("0.12")); + CPPUNIT_ASSERT(m_1->formatMoney("", 2) == TQString("-0.10")); MyMoneyMoney m1(10099); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.99")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.99")); m1 = MyMoneyMoney(100,1); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("100.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("100")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("100.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("100")); m1 = m1 * 10; - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("1,000.00")); - CPPUNIT_ASSERT(m1.formatMoney("", -1) == QString("1,000")); - CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == QString("1000")); - CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == QString("1000.000")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("1,000.00")); + CPPUNIT_ASSERT(m1.formatMoney("", -1) == TQString("1,000")); + CPPUNIT_ASSERT(m1.formatMoney("", -1, false) == TQString("1000")); + CPPUNIT_ASSERT(m1.formatMoney("", 3, false) == TQString("1000.000")); m1 = MyMoneyMoney(INT64_MAX, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("92,233,720,368,547,758.07")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("92233720368547758.07")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("92,233,720,368,547,758.07")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("92233720368547758.07")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("92233720368547758.07")); m1 = MyMoneyMoney(INT64_MIN, 100); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("-92,233,720,368,547,758.08")); - CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == QString("-92233720368547758.08")); - CPPUNIT_ASSERT(m1.formatMoney(100, false) == QString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("-92,233,720,368,547,758.08")); + CPPUNIT_ASSERT(m1.formatMoney("", 2, false) == TQString("-92233720368547758.08")); + CPPUNIT_ASSERT(m1.formatMoney(100, false) == TQString("-92233720368547758.08")); m1 = MyMoneyMoney(1,5); - CPPUNIT_ASSERT(m1.formatMoney("", 2) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(1000) == QString("0.200")); - CPPUNIT_ASSERT(m1.formatMoney(100) == QString("0.20")); - CPPUNIT_ASSERT(m1.formatMoney(10) == QString("0.2")); + CPPUNIT_ASSERT(m1.formatMoney("", 2) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(1000) == TQString("0.200")); + CPPUNIT_ASSERT(m1.formatMoney(100) == TQString("0.20")); + CPPUNIT_ASSERT(m1.formatMoney(10) == TQString("0.2")); m1 = MyMoneyMoney(13333,5000); - CPPUNIT_ASSERT(m1.formatMoney("", 10) == QString("2.6666000000")); + CPPUNIT_ASSERT(m1.formatMoney("", 10) == TQString("2.6666000000")); m1 = MyMoneyMoney(-1404,100); - CPPUNIT_ASSERT(m1.formatMoney("",-1) == QString("-14.04")); + CPPUNIT_ASSERT(m1.formatMoney("",-1) == TQString("-14.04")); } void MyMoneyMoneyTest::testRelation() @@ -409,17 +409,17 @@ void MyMoneyMoneyTest::testRelation() CPPUNIT_ASSERT(m3 >= m3); // tests with different denominator - m1 = QString("1/8"); - m2 = QString("1/7"); + m1 = TQString("1/8"); + m2 = TQString("1/7"); CPPUNIT_ASSERT(m1 < m2); CPPUNIT_ASSERT(m2 > m1); - m2 = QString("-1/7"); + m2 = TQString("-1/7"); CPPUNIT_ASSERT(m2 < m1); CPPUNIT_ASSERT(m1 > m2); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m2 <= m1); - m1 = QString("-2/14"); + m1 = TQString("-2/14"); CPPUNIT_ASSERT(m1 >= m2); CPPUNIT_ASSERT(m1 <= m2); @@ -462,9 +462,9 @@ void MyMoneyMoneyTest::testToString() MyMoneyMoney m2(1234); MyMoneyMoney m3; - CPPUNIT_ASSERT(m1.toString() == QString("-100/100")); - CPPUNIT_ASSERT(m2.toString() == QString("1234/100")); - CPPUNIT_ASSERT(m3.toString() == QString("0/1")); + CPPUNIT_ASSERT(m1.toString() == TQString("-100/100")); + CPPUNIT_ASSERT(m2.toString() == TQString("1234/100")); + CPPUNIT_ASSERT(m3.toString() == TQString("0/1")); } void MyMoneyMoneyTest::testNegativeSignPos(void) diff --git a/kmymoney2/mymoney/mymoneyobject.cpp b/kmymoney2/mymoney/mymoneyobject.cpp index 7939ff0..a415a7c 100644 --- a/kmymoney2/mymoney/mymoneyobject.cpp +++ b/kmymoney2/mymoney/mymoneyobject.cpp @@ -24,16 +24,16 @@ #include "mymoneyutils.h" #include "mymoneyexception.h" -const QString MyMoneyObject::m_emptyId; +const TQString MyMoneyObject::m_emptyId; -MyMoneyObject::MyMoneyObject(const QString& id) +MyMoneyObject::MyMoneyObject(const TQString& id) { m_id = id; } -MyMoneyObject::MyMoneyObject(const QDomElement& el, const bool forceId) +MyMoneyObject::MyMoneyObject(const TQDomElement& el, const bool forceId) { - m_id = QStringEmpty(el.attribute("id")); + m_id = TQStringEmpty(el.attribute("id")); if(m_id.length() == 0 && forceId) throw new MYMONEYEXCEPTION("Node has no ID"); } @@ -46,7 +46,7 @@ MyMoneyObject::~MyMoneyObject() { } -void MyMoneyObject::setId(const QString& id) +void MyMoneyObject::setId(const TQString& id) { m_id = id; } @@ -58,15 +58,15 @@ bool MyMoneyObject::operator == (const MyMoneyObject& right) const void MyMoneyObject::clearId(void) { - m_id = QString(); + m_id = TQString(); } -const QString& MyMoneyObject::emptyId(void) +const TQString& MyMoneyObject::emptyId(void) { return m_emptyId; } -void MyMoneyObject::writeBaseXML(QDomDocument& document, QDomElement& el) const +void MyMoneyObject::writeBaseXML(TQDomDocument& document, TQDomElement& el) const { Q_UNUSED(document); diff --git a/kmymoney2/mymoney/mymoneyobject.h b/kmymoney2/mymoney/mymoneyobject.h index d07296b..854bf4d 100644 --- a/kmymoney2/mymoney/mymoneyobject.h +++ b/kmymoney2/mymoney/mymoneyobject.h @@ -24,9 +24,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdom.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdom.h> +#include <tqdatetime.h> // ---------------------------------------------------------------------------- // Project Includes @@ -58,7 +58,7 @@ public: * * @return ID of object */ - const QString& id(void) const { return m_id; }; + const TQString& id(void) const { return m_id; }; /** * This method clears the id of the object @@ -74,20 +74,20 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const = 0; + virtual bool hasReferenceTo(const TQString& id) const = 0; /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const = 0; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const = 0; bool operator == (const MyMoneyObject& right) const; - static const QString& emptyId(void); + static const TQString& emptyId(void); protected: /** @@ -95,13 +95,13 @@ protected: * * @param id ID of object */ - MyMoneyObject(const QString& id); + MyMoneyObject(const TQString& id); /** * This contructor reads the id from the @p id attribute of the - * QDomElement. + * TQDomElement. * - * @param node const reference to the QDomElement from which to + * @param node const reference to the TQDomElement from which to * obtain the id of the object * @param forceId flag to be able to suppress enforcement of an id * defaults to true which requires the node to have an @@ -111,18 +111,18 @@ protected: * used by objects, which are stored w/o id (eg. splits, * transactions within schedules) */ - MyMoneyObject(const QDomElement& node, const bool forceId = true); + MyMoneyObject(const TQDomElement& node, const bool forceId = true); - void setId(const QString& id) /* __attribute__ ((deprecated)) */; + void setId(const TQString& id) /* __attribute__ ((deprecated)) */; /** * This method writes out the members contained in this object. */ - void writeBaseXML(QDomDocument& document, QDomElement& el) const; + void writeBaseXML(TQDomDocument& document, TQDomElement& el) const; protected: - QString m_id; - static const QString m_emptyId; + TQString m_id; + static const TQString m_emptyId; }; #endif diff --git a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp index 666da3b..c842f0d 100644 --- a/kmymoney2/mymoney/mymoneyobjectcontainer.cpp +++ b/kmymoney2/mymoney/mymoneyobjectcontainer.cpp @@ -34,7 +34,7 @@ MyMoneyObjectContainer::~MyMoneyObjectContainer() void MyMoneyObjectContainer::clear(IMyMoneyStorage* storage) { // delete all objects - QMap<QString, MyMoneyObject const *>::const_iterator it; + TQMap<TQString, MyMoneyObject const *>::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { delete (*it); } @@ -46,10 +46,10 @@ void MyMoneyObjectContainer::clear(IMyMoneyStorage* storage) m_storage = storage; } -void MyMoneyObjectContainer::clear(const QString& id) +void MyMoneyObjectContainer::clear(const TQString& id) { - QMap<QString, MyMoneyObject const *>::iterator it; - it = m_map.find(id); + TQMap<TQString, MyMoneyObject const *>::iterator it; + it = m_map.tqfind(id); if(it != m_map.end()) { delete (*it); m_map.erase(it); @@ -57,9 +57,9 @@ void MyMoneyObjectContainer::clear(const QString& id) } #define listMethod(a, T) \ -void MyMoneyObjectContainer::a(QValueList<T>& list) \ +void MyMoneyObjectContainer::a(TQValueList<T>& list) \ { \ - QMap<QString, const MyMoneyObject*>::const_iterator it; \ + TQMap<TQString, const MyMoneyObject*>::const_iterator it; \ for(it = m_map.begin(); it != m_map.end(); ++it) { \ const T* node = dynamic_cast<const T*>(*it); \ if(node) { \ @@ -69,9 +69,9 @@ void MyMoneyObjectContainer::a(QValueList<T>& list) \ } #define preloadListMethod(a, T) \ -void MyMoneyObjectContainer::preload##a(const QValueList<T>& list) \ +void MyMoneyObjectContainer::preload##a(const TQValueList<T>& list) \ { \ - QValueList<T>::const_iterator it; \ + TQValueList<T>::const_iterator it; \ for(it = list.begin(); it != list.end(); ++it) { \ delete m_map[(*it).id()]; \ m_map[(*it).id()] = new T(*it); \ @@ -86,13 +86,13 @@ void MyMoneyObjectContainer::preload##a(const T& obj) \ } #define objectAccessMethod(a, T) \ -const T& MyMoneyObjectContainer::a(const QString& id) \ +const T& MyMoneyObjectContainer::a(const TQString& id) \ { \ static T nullElement; \ if(id.isEmpty()) \ return nullElement; \ - QMap<QString, MyMoneyObject const *>::const_iterator it; \ - it = m_map.find(id); \ + TQMap<TQString, MyMoneyObject const *>::const_iterator it; \ + it = m_map.tqfind(id); \ if(it == m_map.end()) { \ /* not found, need to load from engine */ \ T x = m_storage->a(id); \ @@ -102,9 +102,9 @@ const T& MyMoneyObjectContainer::a(const QString& id) \ return dynamic_cast<const T&>(*(*it)); \ } -void MyMoneyObjectContainer::account(QValueList<MyMoneyAccount>& list) +void MyMoneyObjectContainer::account(TQValueList<MyMoneyAccount>& list) { - QMap<QString, const MyMoneyObject*>::const_iterator it; + TQMap<TQString, const MyMoneyObject*>::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { const MyMoneyAccount* node = dynamic_cast<const MyMoneyAccount*>(*it); if(node) { @@ -114,13 +114,13 @@ void MyMoneyObjectContainer::account(QValueList<MyMoneyAccount>& list) } } -const MyMoneyAccount& MyMoneyObjectContainer::account(const QString& id) +const MyMoneyAccount& MyMoneyObjectContainer::account(const TQString& id) { static MyMoneyAccount nullElement; if(id.isEmpty()) return nullElement; - QMap<QString, MyMoneyObject const *>::iterator it; - it = m_map.find(id); + TQMap<TQString, MyMoneyObject const *>::iterator it; + it = m_map.tqfind(id); if(it == m_map.end()) { /* not found, need to load from engine */ MyMoneyAccount x = m_storage->account(id); @@ -141,10 +141,10 @@ void MyMoneyObjectContainer::assignFraction(MyMoneyAccount* acc) } } -const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const QString& name) const +const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const TQString& name) const { static MyMoneyAccount nullElement; - QMap<QString, MyMoneyObject const *>::const_iterator it; + TQMap<TQString, MyMoneyObject const *>::const_iterator it; for(it = m_map.begin(); it != m_map.end(); ++it) { const MyMoneyAccount* node = dynamic_cast<const MyMoneyAccount *>(*it); if(node) { @@ -155,13 +155,13 @@ const MyMoneyAccount& MyMoneyObjectContainer::accountByName(const QString& name) return nullElement; } -void MyMoneyObjectContainer::refresh(const QString& id) +void MyMoneyObjectContainer::refresh(const TQString& id) { if(id.isEmpty()) return; - QMap<QString, MyMoneyObject const *>::const_iterator it; - it = m_map.find(id); + TQMap<TQString, MyMoneyObject const *>::const_iterator it; + it = m_map.tqfind(id); if(it != m_map.end()) { const MyMoneyAccount* account = dynamic_cast<const MyMoneyAccount *>(*it); const MyMoneyPayee* payee = dynamic_cast<const MyMoneyPayee *>(*it); diff --git a/kmymoney2/mymoney/mymoneyobjectcontainer.h b/kmymoney2/mymoney/mymoneyobjectcontainer.h index 1f3b598..715154c 100644 --- a/kmymoney2/mymoney/mymoneyobjectcontainer.h +++ b/kmymoney2/mymoney/mymoneyobjectcontainer.h @@ -24,8 +24,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> // ---------------------------------------------------------------------------- // Project Includes @@ -46,51 +46,52 @@ /** * This class represents a generic container for all MyMoneyObject derived objects. */ -class KMYMONEY_EXPORT MyMoneyObjectContainer : public QObject +class KMYMONEY_EXPORT MyMoneyObjectContainer : public TQObject { Q_OBJECT + TQ_OBJECT public: MyMoneyObjectContainer(); ~MyMoneyObjectContainer(); - const MyMoneyAccount& account(const QString& id); - const MyMoneyPayee& payee(const QString& id); - const MyMoneySecurity& security(const QString& id); - const MyMoneyInstitution& institution(const QString& id); - const MyMoneySchedule& schedule(const QString& id); + const MyMoneyAccount& account(const TQString& id); + const MyMoneyPayee& payee(const TQString& id); + const MyMoneySecurity& security(const TQString& id); + const MyMoneyInstitution& institution(const TQString& id); + const MyMoneySchedule& schedule(const TQString& id); - void account(QValueList<MyMoneyAccount>& list); - void payee(QValueList<MyMoneyPayee>& list); - void institution(QValueList<MyMoneyInstitution>& list); + void account(TQValueList<MyMoneyAccount>& list); + void payee(TQValueList<MyMoneyPayee>& list); + void institution(TQValueList<MyMoneyInstitution>& list); - void preloadAccount(const QValueList<MyMoneyAccount>& list); - void preloadPayee(const QValueList<MyMoneyPayee>& list); - void preloadInstitution(const QValueList<MyMoneyInstitution>& list); - void preloadSecurity(const QValueList<MyMoneySecurity>& list); - void preloadSchedule(const QValueList<MyMoneySchedule>& list); + void preloadAccount(const TQValueList<MyMoneyAccount>& list); + void preloadPayee(const TQValueList<MyMoneyPayee>& list); + void preloadInstitution(const TQValueList<MyMoneyInstitution>& list); + void preloadSecurity(const TQValueList<MyMoneySecurity>& list); + void preloadSchedule(const TQValueList<MyMoneySchedule>& list); void preloadAccount(const MyMoneyAccount& account); void preloadSecurity(const MyMoneySecurity& security); void preloadPayee(const MyMoneyPayee& payee); void preloadInstitution(const MyMoneyInstitution& institution); - void clear(const QString& id); + void clear(const TQString& id); void clear(IMyMoneyStorage* storage = 0); - const MyMoneyAccount& accountByName(const QString& name) const; + const MyMoneyAccount& accountByName(const TQString& name) const; /** * This method refreshes an already existing object in the container * with a copy from the engine. The object is identified by its @a id. * If the object is unknown or the @a id is empty, nothing is done. */ - void refresh(const QString& id); + void refresh(const TQString& id); private: void assignFraction(MyMoneyAccount* acc); private: - QMap<QString, MyMoneyObject const *> m_map; + TQMap<TQString, MyMoneyObject const *> m_map; IMyMoneyStorage* m_storage; }; diff --git a/kmymoney2/mymoney/mymoneyobjecttest.cpp b/kmymoney2/mymoney/mymoneyobjecttest.cpp index f7201a9..b69d63a 100644 --- a/kmymoney2/mymoney/mymoneyobjecttest.cpp +++ b/kmymoney2/mymoney/mymoneyobjecttest.cpp @@ -34,14 +34,14 @@ void MyMoneyObjectTest::testEmptyConstructor() { } void MyMoneyObjectTest::testConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); CPPUNIT_ASSERT(!a.id().isEmpty()); - CPPUNIT_ASSERT(a.id() == QString("thb")); + CPPUNIT_ASSERT(a.id() == TQString("thb")); } void MyMoneyObjectTest::testClearId() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); CPPUNIT_ASSERT(!a.id().isEmpty()); a.clearId(); @@ -49,23 +49,23 @@ void MyMoneyObjectTest::testClearId() { } void MyMoneyObjectTest::testCopyConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); MyMoneyAccount b(a); CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); } void MyMoneyObjectTest::testAssignmentConstructor() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); MyMoneyAccount b = a; CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); } void MyMoneyObjectTest::testEquality() { - MyMoneyAccount a(QString("thb"), MyMoneyAccount()); - MyMoneyAccount b(QString("thb"), MyMoneyAccount()); - MyMoneyAccount c(QString("ace"), MyMoneyAccount()); + MyMoneyAccount a(TQString("thb"), MyMoneyAccount()); + MyMoneyAccount b(TQString("thb"), MyMoneyAccount()); + MyMoneyAccount c(TQString("ace"), MyMoneyAccount()); CPPUNIT_ASSERT(a.MyMoneyObject::operator==(b)); CPPUNIT_ASSERT(!(a.MyMoneyObject::operator==(c))); diff --git a/kmymoney2/mymoney/mymoneyobserver.h b/kmymoney2/mymoney/mymoneyobserver.h index 3e6c922..3ec05d0 100644 --- a/kmymoney2/mymoney/mymoneyobserver.h +++ b/kmymoney2/mymoney/mymoneyobserver.h @@ -35,7 +35,7 @@ #include <kmymoney/export.h> class MyMoneySubject; -class QString; +class TQString; /** * This is the base class to be used to construct an @@ -46,7 +46,7 @@ class QString; class KMYMONEY_EXPORT MyMoneyObserver { public: virtual ~MyMoneyObserver(); - virtual void update(const QString& id) = 0; + virtual void update(const TQString& id) = 0; protected: MyMoneyObserver(); diff --git a/kmymoney2/mymoney/mymoneyobservertest.h b/kmymoney2/mymoney/mymoneyobservertest.h index a806882..51ca900 100644 --- a/kmymoney2/mymoney/mymoneyobservertest.h +++ b/kmymoney2/mymoney/mymoneyobservertest.h @@ -23,11 +23,11 @@ class TestObserver : public MyMoneyObserver { public: TestObserver() { m_updated = ""; } - void update(const QString& id) { m_updated = id; }; - const QString& updated(void) { return m_updated; }; + void update(const TQString& id) { m_updated = id; }; + const TQString& updated(void) { return m_updated; }; void reset(void) { m_updated = ""; }; private: - QString m_updated; + TQString m_updated; }; class TestSubject : public MyMoneySubject diff --git a/kmymoney2/mymoney/mymoneypayee.cpp b/kmymoney2/mymoney/mymoneypayee.cpp index cbfbbb7..7023e51 100644 --- a/kmymoney2/mymoney/mymoneypayee.cpp +++ b/kmymoney2/mymoney/mymoneypayee.cpp @@ -19,7 +19,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstringlist.h> +#include <tqstringlist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -37,7 +37,7 @@ MyMoneyPayee::MyMoneyPayee() : { } -MyMoneyPayee::MyMoneyPayee(const QString& id, const MyMoneyPayee& payee) : +MyMoneyPayee::MyMoneyPayee(const TQString& id, const MyMoneyPayee& payee) : m_matchingEnabled(false), m_usingMatchKey(false), m_matchKeyIgnoreCase(true) @@ -46,9 +46,9 @@ MyMoneyPayee::MyMoneyPayee(const QString& id, const MyMoneyPayee& payee) : m_id = id; } -MyMoneyPayee::MyMoneyPayee(const QString& name, const QString& address, - const QString& city, const QString& state, const QString& postcode, - const QString& telephone, const QString& email) : +MyMoneyPayee::MyMoneyPayee(const TQString& name, const TQString& address, + const TQString& city, const TQString& state, const TQString& postcode, + const TQString& telephone, const TQString& email) : m_matchingEnabled(false), m_usingMatchKey(false), m_matchKeyIgnoreCase(true) @@ -62,7 +62,7 @@ MyMoneyPayee::MyMoneyPayee(const QString& name, const QString& address, m_email = email; } -MyMoneyPayee::MyMoneyPayee(const QDomElement& node) : +MyMoneyPayee::MyMoneyPayee(const TQDomElement& node) : MyMoneyObject(node) { if ("PAYEE" != node.tagName()) { @@ -89,13 +89,13 @@ MyMoneyPayee::MyMoneyPayee(const QDomElement& node) : m_defaultAccountId = node.attribute("defaultaccountid"); } - QDomNodeList nodeList = node.elementsByTagName("ADDRESS"); + TQDomNodeList nodeList = node.elementsByTagName("ADDRESS"); if(nodeList.count() == 0) { - QString msg = QString("No ADDRESS in payee %1").arg(m_name); + TQString msg = TQString("No ADDRESS in payee %1").tqarg(m_name); throw new MYMONEYEXCEPTION(msg); } - QDomElement addrNode = nodeList.item(0).toElement(); + TQDomElement addrNode = nodeList.item(0).toElement(); m_address = addrNode.attribute("street"); m_city = addrNode.attribute("city"); m_postcode = addrNode.attribute("postcode"); @@ -131,9 +131,9 @@ bool MyMoneyPayee::operator == (const MyMoneyPayee& right) const ((m_defaultAccountId.length() == 0 && right.m_defaultAccountId.length() == 0) || m_defaultAccountId == right.m_defaultAccountId) ); } -void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyPayee::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("PAYEE"); + TQDomElement el = document.createElement("PAYEE"); writeBaseXML(document, el); @@ -155,7 +155,7 @@ void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const el.setAttribute("defaultaccountid", m_defaultAccountId); } - QDomElement address = document.createElement("ADDRESS"); + TQDomElement address = document.createElement("ADDRESS"); address.setAttribute("street", m_address); address.setAttribute("city", m_city); address.setAttribute("postcode", m_postcode); @@ -164,16 +164,16 @@ void MyMoneyPayee::writeXML(QDomDocument& document, QDomElement& parent) const el.appendChild(address); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyPayee::hasReferenceTo(const QString& id) const +bool MyMoneyPayee::hasReferenceTo(const TQString& id) const { return id == m_defaultAccountId; } -MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QStringList& keys) const +MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, TQStringList& keys) const { payeeMatchType type = matchDisabled; keys.clear(); @@ -183,25 +183,25 @@ MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QStringLi { type = m_usingMatchKey ? matchKey : matchName; if(type == matchKey) - keys = QStringList::split(";", m_matchKey); + keys = TQStringList::split(";", m_matchKey); } return type; } -MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, QString& keyString) const +MyMoneyPayee::payeeMatchType MyMoneyPayee::matchData(bool& ignorecase, TQString& keyString) const { - QStringList keys; + TQStringList keys; payeeMatchType type = matchData(ignorecase, keys); keyString = keys.join(";"); return type; } -void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QStringList& keys) +void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const TQStringList& keys) { m_matchingEnabled = (type != matchDisabled); m_matchKeyIgnoreCase = ignorecase; - m_matchKey = QString(); + m_matchKey = TQString(); if ( m_matchingEnabled ) { @@ -212,9 +212,9 @@ void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QStr } } -void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const QString& keys) +void MyMoneyPayee::setMatchData(payeeMatchType type, bool ignorecase, const TQString& keys) { - setMatchData(type, ignorecase, QStringList::split(";", keys)); + setMatchData(type, ignorecase, TQStringList::split(";", keys)); } // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneypayee.h b/kmymoney2/mymoney/mymoneypayee.h index c2c711b..b1d2fce 100644 --- a/kmymoney2/mymoney/mymoneypayee.h +++ b/kmymoney2/mymoney/mymoneypayee.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -class QStringList; +#include <tqstring.h> +class TQStringList; // ---------------------------------------------------------------------------- // Project Includes @@ -46,14 +46,14 @@ class KMYMONEY_EXPORT MyMoneyPayee : public MyMoneyObject { private: // Simple fields - QString m_name; - QString m_address; - QString m_city; - QString m_state; - QString m_postcode; - QString m_telephone; - QString m_email; - QString m_notes; + TQString m_name; + TQString m_address; + TQString m_city; + TQString m_state; + TQString m_postcode; + TQString m_telephone; + TQString m_email; + TQString m_notes; // Transaction matching fields bool m_matchingEnabled; //< Whether this payee should be matched at all @@ -64,10 +64,10 @@ private: * Semicolon separated list of matching keys used when trying to find a suitable * payee for imported transactions. */ - QString m_matchKey; + TQString m_matchKey; // Category (account) matching fields - QString m_defaultAccountId; + TQString m_defaultAccountId; /** * This member keeps a reference to an external database @@ -78,7 +78,7 @@ private: * If no external database is available it should be kept * empty by the application. */ - QString m_reference; + TQString m_reference; public: typedef enum { @@ -88,48 +88,48 @@ public: } payeeMatchType; MyMoneyPayee(); - MyMoneyPayee(const QString& id, const MyMoneyPayee& payee); - MyMoneyPayee(const QString& name, - const QString& address=QString::null, - const QString& city=QString::null, - const QString& state=QString::null, - const QString& postcode=QString::null, - const QString& telephone=QString::null, - const QString& email=QString::null); + MyMoneyPayee(const TQString& id, const MyMoneyPayee& payee); + MyMoneyPayee(const TQString& name, + const TQString& address=TQString(), + const TQString& city=TQString(), + const TQString& state=TQString(), + const TQString& postcode=TQString(), + const TQString& telephone=TQString(), + const TQString& email=TQString()); /** * This is the constructor for a payee that is described by a - * QDomElement (e.g. from a file). + * TQDomElement (e.g. from a file). * - * @param el const reference to the QDomElement from which to + * @param el const reference to the TQDomElement from which to * create the object */ - MyMoneyPayee(const QDomElement& el); + MyMoneyPayee(const TQDomElement& el); ~MyMoneyPayee(); // Simple get operations - QString name(void) const { return m_name; } - QString address(void) const { return m_address; } - QString city(void) const { return m_city; } - QString state(void) const { return m_state; } - QString postcode(void) const { return m_postcode; } - QString telephone(void) const { return m_telephone; } - QString email(void) const { return m_email; } - QString notes(void) const { return m_notes; } - - const QString id(void) const { return m_id; }; - const QString reference(void) const { return m_reference; }; + TQString name(void) const { return m_name; } + TQString address(void) const { return m_address; } + TQString city(void) const { return m_city; } + TQString state(void) const { return m_state; } + TQString postcode(void) const { return m_postcode; } + TQString telephone(void) const { return m_telephone; } + TQString email(void) const { return m_email; } + TQString notes(void) const { return m_notes; } + + const TQString id(void) const { return m_id; }; + const TQString reference(void) const { return m_reference; }; // Simple set operations - void setName(const QString& val) { m_name = val; } - void setAddress(const QString& val) { m_address = val; } - void setCity(const QString& val) { m_city = val; } - void setState(const QString& val) { m_state = val; } - void setPostcode(const QString& val) { m_postcode = val; } - void setTelephone(const QString& val) { m_telephone = val; } - void setEmail(const QString& val) { m_email = val; } - void setNotes(const QString& val) { m_notes = val; } - void setReference(const QString& ref) { m_reference = ref; } + void setName(const TQString& val) { m_name = val; } + void setAddress(const TQString& val) { m_address = val; } + void setCity(const TQString& val) { m_city = val; } + void setState(const TQString& val) { m_state = val; } + void setPostcode(const TQString& val) { m_postcode = val; } + void setTelephone(const TQString& val) { m_telephone = val; } + void setEmail(const TQString& val) { m_email = val; } + void setNotes(const TQString& val) { m_notes = val; } + void setReference(const TQString& ref) { m_reference = ref; } /** * Get all match data in one call @@ -140,7 +140,7 @@ public: * * @return the matching type (see payeeMatchType for details) */ - payeeMatchType matchData(bool& ignorecase, QStringList& keys) const; + payeeMatchType matchData(bool& ignorecase, TQStringList& keys) const; /** * Set all match data in one call @@ -149,7 +149,7 @@ public: * @param ignorecase Whether case should be ignored for the key/name match * @param keys A list of keys themselves, if applicable */ - void setMatchData(payeeMatchType type, bool ignorecase, const QStringList& keys); + void setMatchData(payeeMatchType type, bool ignorecase, const TQStringList& keys); /** * Get all match data in one call (overloaded version for database module) @@ -160,7 +160,7 @@ public: * * @return the matching type (see payeeMatchType for details) */ - payeeMatchType matchData(bool& ignorecase, QString& keyString) const; + payeeMatchType matchData(bool& ignorecase, TQString& keyString) const; /** * Set all match data in one call (overloaded version for database module) @@ -169,12 +169,12 @@ public: * @param ignorecase Whether case should be ignored for the key/name match * @param keys A list of keys in single-string format, if applicable */ - void setMatchData(payeeMatchType type, bool ignorecase, const QString& keys); + void setMatchData(payeeMatchType type, bool ignorecase, const TQString& keys); bool defaultAccountEnabled() const { return !m_defaultAccountId.isEmpty(); } - const QString& defaultAccountId() const { return m_defaultAccountId; } - void setDefaultAccountId(const QString& id = QString()) { + const TQString& defaultAccountId() const { return m_defaultAccountId; } + void setDefaultAccountId(const TQString& id = TQString()) { m_defaultAccountId = id; } @@ -184,7 +184,7 @@ public: // Equality operator bool operator == (const MyMoneyPayee &) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -195,12 +195,12 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; static MyMoneyPayee null; }; -inline bool operator==(const MyMoneyPayee& lhs, const QString& rhs) { return lhs.id() == rhs; } +inline bool operator==(const MyMoneyPayee& lhs, const TQString& rhs) { return lhs.id() == rhs; } #endif // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneypayeetest.cpp b/kmymoney2/mymoney/mymoneypayeetest.cpp index 601679c..124cc65 100644 --- a/kmymoney2/mymoney/mymoneypayeetest.cpp +++ b/kmymoney2/mymoney/mymoneypayeetest.cpp @@ -26,21 +26,21 @@ void MyMoneyPayeeTest::tearDown () { } void MyMoneyPayeeTest::testXml(){ - QDomDocument doc; - QDomElement parent = doc.createElement("Test"); - doc.appendChild(parent); + TQDomDocument doc; + TQDomElement tqparent = doc.createElement("Test"); + doc.appendChild(tqparent); MyMoneyPayee payee1; payee1.m_id = "some random id";//if the ID isn't set, w ethrow an exception - payee1.writeXML(doc,parent); - QString temp1 = "Account1"; + payee1.writeXML(doc,tqparent); + TQString temp1 = "Account1"; payee1.setDefaultAccountId(temp1); - payee1.writeXML(doc,parent); - QString temp2 = "Account2"; + payee1.writeXML(doc,tqparent); + TQString temp2 = "Account2"; payee1.setDefaultAccountId(temp2); - payee1.writeXML(doc,parent); + payee1.writeXML(doc,tqparent); payee1.setDefaultAccountId(); - payee1.writeXML(doc,parent); - QDomElement el = parent.firstChild().toElement(); + payee1.writeXML(doc,tqparent); + TQDomElement el = tqparent.firstChild().toElement(); CPPUNIT_ASSERT(!el.isNull()); MyMoneyPayee payee2(el); CPPUNIT_ASSERT(!payee2.defaultAccountEnabled()); @@ -66,7 +66,7 @@ void MyMoneyPayeeTest::testDefaultAccount(){ MyMoneyPayee payee; CPPUNIT_ASSERT(!payee.defaultAccountEnabled()); CPPUNIT_ASSERT(payee.defaultAccountId().isEmpty()); - QString temp = "Account1"; + TQString temp = "Account1"; payee.setDefaultAccountId(temp); CPPUNIT_ASSERT(payee.defaultAccountEnabled()); CPPUNIT_ASSERT(payee.defaultAccountId()==temp); diff --git a/kmymoney2/mymoney/mymoneyprice.cpp b/kmymoney2/mymoney/mymoneyprice.cpp index b674776..df43221 100644 --- a/kmymoney2/mymoney/mymoneyprice.cpp +++ b/kmymoney2/mymoney/mymoneyprice.cpp @@ -37,11 +37,11 @@ #include "mymoneyexception.h" MyMoneyPrice::MyMoneyPrice() : - m_date(QDate()) + m_date(TQDate()) { } -MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomElement& node) +MyMoneyPrice::MyMoneyPrice(const TQString& from, const TQString& to, const TQDomElement& node) { if("PRICE" != node.tagName()) throw new MYMONEYEXCEPTION("Node was not PRICE"); @@ -49,7 +49,7 @@ MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomEle m_fromSecurity = from; m_toSecurity = to; - m_date = QDate::fromString(node.attribute("date"), Qt::ISODate); + m_date = TQDate::fromString(node.attribute("date"), Qt::ISODate); m_rate = MyMoneyMoney(node.attribute("price")); m_source = node.attribute("source"); @@ -59,7 +59,7 @@ MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDomEle qDebug("Price with zero value loaded"); } -MyMoneyPrice::MyMoneyPrice(const QString& from, const QString& to, const QDate& date, const MyMoneyMoney& rate, const QString& source) : +MyMoneyPrice::MyMoneyPrice(const TQString& from, const TQString& to, const TQDate& date, const MyMoneyMoney& rate, const TQString& source) : m_fromSecurity(from), m_toSecurity(to), m_date(date), @@ -76,7 +76,7 @@ MyMoneyPrice::~MyMoneyPrice() { } -const MyMoneyMoney MyMoneyPrice::rate(const QString& id) const +const MyMoneyMoney MyMoneyPrice::rate(const TQString& id) const { static MyMoneyMoney dummyPrice(1,1); @@ -88,7 +88,7 @@ const MyMoneyMoney MyMoneyPrice::rate(const QString& id) const if(id == m_fromSecurity) return m_invRate; - QString msg = QString("Unknown security id %1 for price info %2/%3.").arg(id).arg(m_fromSecurity).arg(m_toSecurity); + TQString msg = TQString("Unknown security id %1 for price info %2/%3.").tqarg(id).tqarg(m_fromSecurity).tqarg(m_toSecurity); throw new MYMONEYEXCEPTION(msg); } @@ -107,7 +107,7 @@ bool MyMoneyPrice::operator == (const MyMoneyPrice &right) const ((m_source.length() == 0 && right.m_source.length() == 0) || (m_source == right.m_source))); } -bool MyMoneyPrice::hasReferenceTo(const QString& id) const +bool MyMoneyPrice::hasReferenceTo(const TQString& id) const { return (id == m_fromSecurity) || (id == m_toSecurity); } diff --git a/kmymoney2/mymoney/mymoneyprice.h b/kmymoney2/mymoney/mymoneyprice.h index faf6454..9c4f1c0 100644 --- a/kmymoney2/mymoney/mymoneyprice.h +++ b/kmymoney2/mymoney/mymoneyprice.h @@ -30,11 +30,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qpair.h> -#include <qmap.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqpair.h> +#include <tqmap.h> +#include <tqdom.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -71,8 +71,8 @@ class KMYMONEY_EXPORT MyMoneyPrice { public: MyMoneyPrice(); - MyMoneyPrice(const QString& from, const QString& to, const QDomElement& node); - MyMoneyPrice(const QString& from, const QString& to, const QDate& date, const MyMoneyMoney& rate, const QString& source = QString()); + MyMoneyPrice(const TQString& from, const TQString& to, const TQDomElement& node); + MyMoneyPrice(const TQString& from, const TQString& to, const TQDate& date, const MyMoneyMoney& rate, const TQString& source = TQString()); virtual ~MyMoneyPrice(); /** @@ -96,7 +96,7 @@ public: * * @code * - * MyMoneyPrice price("ADF", "GBP", QDate(2005,9,20), MyMoneyMoney(1,3), "User"); + * MyMoneyPrice price("ADF", "GBP", TQDate(2005,9,20), MyMoneyMoney(1,3), "User"); * MyMoneyMoney valADF, valGBP(100,1); * * valADF = valGBP * price.rate("ADF"); @@ -107,12 +107,12 @@ public: * @p 3/1 even though the price information kept with the object was @p 1/3, but based on the other * conversion direction (from ADF to GBP). */ - const MyMoneyMoney rate(const QString& id) const; + const MyMoneyMoney rate(const TQString& id) const; - const QDate& date(void) const { return m_date; }; - const QString& source(void) const { return m_source; }; - const QString& from(void) const { return m_fromSecurity; }; - const QString& to(void) const { return m_toSecurity; }; + const TQDate& date(void) const { return m_date; }; + const TQString& source(void) const { return m_source; }; + const TQString& from(void) const { return m_fromSecurity; }; + const TQString& to(void) const { return m_toSecurity; }; /** * Check whether the object is valid or not. A MyMoneyPrice object @@ -139,20 +139,20 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - bool hasReferenceTo(const QString& id) const; + bool hasReferenceTo(const TQString& id) const; private: - QString m_fromSecurity; - QString m_toSecurity; - QDate m_date; + TQString m_fromSecurity; + TQString m_toSecurity; + TQDate m_date; MyMoneyMoney m_rate; MyMoneyMoney m_invRate; - QString m_source; + TQString m_source; }; -typedef QPair<QString, QString> MyMoneySecurityPair; -typedef QMap<QDate, MyMoneyPrice> MyMoneyPriceEntries; -typedef QMap<MyMoneySecurityPair, MyMoneyPriceEntries> MyMoneyPriceList; +typedef TQPair<TQString, TQString> MyMoneySecurityPair; +typedef TQMap<TQDate, MyMoneyPrice> MyMoneyPriceEntries; +typedef TQMap<MyMoneySecurityPair, MyMoneyPriceEntries> MyMoneyPriceList; #endif diff --git a/kmymoney2/mymoney/mymoneypricetest.cpp b/kmymoney2/mymoney/mymoneypricetest.cpp index 203e9ca..444754a 100644 --- a/kmymoney2/mymoney/mymoneypricetest.cpp +++ b/kmymoney2/mymoney/mymoneypricetest.cpp @@ -39,23 +39,23 @@ void MyMoneyPriceTest::testDefaultConstructor() void MyMoneyPriceTest::testConstructor() { - MyMoneyPrice n(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); + MyMoneyPrice n(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); CPPUNIT_ASSERT(n.isValid() == true); - CPPUNIT_ASSERT(n.from() == QString("from")); - CPPUNIT_ASSERT(n.to() == QString("to")); - CPPUNIT_ASSERT(n.date() == QDate(2005,9,23)); - CPPUNIT_ASSERT(n.source() == QString("MySource")); + CPPUNIT_ASSERT(n.from() == TQString("from")); + CPPUNIT_ASSERT(n.to() == TQString("to")); + CPPUNIT_ASSERT(n.date() == TQDate(2005,9,23)); + CPPUNIT_ASSERT(n.source() == TQString("MySource")); CPPUNIT_ASSERT(n.rate("to") == MyMoneyMoney(1,3)); } void MyMoneyPriceTest::testValidity() { - QString emptyId; - MyMoneyPrice n1(emptyId, QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n2(QString("from"), emptyId, QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n3(QString("from"), QString("to"), QDate(), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n4(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); + TQString emptyId; + MyMoneyPrice n1(emptyId, TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n2(TQString("from"), emptyId, TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n3(TQString("from"), TQString("to"), TQDate(), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n4(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); CPPUNIT_ASSERT(n1.isValid() == false); CPPUNIT_ASSERT(n2.isValid() == false); @@ -65,13 +65,13 @@ void MyMoneyPriceTest::testValidity() void MyMoneyPriceTest::testRate() { - MyMoneyPrice n1(QString("from"), QString("to"), QDate(2005,9,23), MyMoneyMoney(1,3), QString("MySource")); - MyMoneyPrice n2(QString("from"), QString("to"), QDate(), MyMoneyMoney(1,3), QString("MySource")); + MyMoneyPrice n1(TQString("from"), TQString("to"), TQDate(2005,9,23), MyMoneyMoney(1,3), TQString("MySource")); + MyMoneyPrice n2(TQString("from"), TQString("to"), TQDate(), MyMoneyMoney(1,3), TQString("MySource")); try { CPPUNIT_ASSERT(n1.rate("to") == MyMoneyMoney(1,3)); CPPUNIT_ASSERT(n1.rate("from") == MyMoneyMoney(3,1)); - CPPUNIT_ASSERT(n1.rate(QString()) == MyMoneyMoney(1,3)); + CPPUNIT_ASSERT(n1.rate(TQString()) == MyMoneyMoney(1,3)); CPPUNIT_ASSERT(n2.isValid() == false); CPPUNIT_ASSERT(n2.rate("to") == MyMoneyMoney(1,1)); diff --git a/kmymoney2/mymoney/mymoneyreport.cpp b/kmymoney2/mymoney/mymoneyreport.cpp index 63c4ca7..4cd667b 100644 --- a/kmymoney2/mymoney/mymoneyreport.cpp +++ b/kmymoney2/mymoney/mymoneyreport.cpp @@ -22,8 +22,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdom.h> +#include <tqstring.h> +#include <tqdom.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -34,22 +34,22 @@ #include "mymoneyfile.h" #include "mymoneyreport.h" -const QStringList MyMoneyReport::kRowTypeText = QStringList::split ( ",", "none,assetliability,expenseincome,category,topcategory,account,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow", true ); -const QStringList MyMoneyReport::kColumnTypeText = QStringList::split ( ",", "none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years", true ); +const TQStringList MyMoneyReport::kRowTypeText = TQStringList::split ( ",", "none,assetliability,expenseincome,category,topcategory,account,payee,month,week,topaccount,topaccount-account,equitytype,accounttype,institution,budget,budgetactual,schedule,accountinfo,accountloaninfo,accountreconcile,cashflow", true ); +const TQStringList MyMoneyReport::kColumnTypeText = TQStringList::split ( ",", "none,months,bimonths,quarters,4,5,6,weeks,8,9,10,11,years", true ); // if you add names here, don't forget to update the bitmap for EQueryColumns -// and shift the bit for eQCend one position to the left -const QStringList MyMoneyReport::kQueryColumnsText = QStringList::split ( ",", "none,number,payee,category,memo,account,reconcileflag,action,shares,price,performance,loan,balance", true ); +// and shift the bit for eTQCend one position to the left +const TQStringList MyMoneyReport::kQueryColumnsText = TQStringList::split ( ",", "none,number,payee,category,memo,account,reconcileflag,action,shares,price,performance,loan,balance", true ); const MyMoneyReport::EReportType MyMoneyReport::kTypeArray[] = { eNoReport, ePivotTable, ePivotTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, eQueryTable, ePivotTable, ePivotTable, eInfoTable, eInfoTable, eInfoTable, eQueryTable, eQueryTable, eNoReport }; -const QStringList MyMoneyReport::kDetailLevelText = QStringList::split ( ",", "none,all,top,group,total,invalid", true ); -const QStringList MyMoneyReport::kChartTypeText = QStringList::split ( ",", "none,line,bar,pie,ring,stackedbar,invalid", true ); +const TQStringList MyMoneyReport::kDetailLevelText = TQStringList::split ( ",", "none,all,top,group,total,invalid", true ); +const TQStringList MyMoneyReport::kChartTypeText = TQStringList::split ( ",", "none,line,bar,pie,ring,stackedbar,invalid", true ); // This should live in mymoney/mymoneytransactionfilter.h -static const QStringList kTypeText = QStringList::split ( ",", "all,payments,deposits,transfers,none" ); -static const QStringList kStateText = QStringList::split ( ",", "all,notreconciled,cleared,reconciled,frozen,none" ); -static const QStringList kDateLockText = QStringList::split ( ",", "alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today" ); -static const QStringList kAccountTypeText = QStringList::split ( ",", "unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid" ); +static const TQStringList kTypeText = TQStringList::split ( ",", "all,payments,deposits,transfers,none" ); +static const TQStringList kStateText = TQStringList::split ( ",", "all,notreconciled,cleared,reconciled,frozen,none" ); +static const TQStringList kDateLockText = TQStringList::split ( ",", "alldates,untiltoday,currentmonth,currentyear,monthtodate,yeartodate,yeartomonth,lastmonth,lastyear,last7days,last30days,last3months,last6months,last12months,next7days,next30days,next3months,next6months,next12months,userdefined,last3tonext3months,last11Months,currentQuarter,lastQuarter,nextQuarter,currentFiscalYear,lastFiscalYear,today" ); +static const TQStringList kAccountTypeText = TQStringList::split ( ",", "unknown,checkings,savings,cash,creditcard,loan,certificatedep,investment,moneymarket,asset,liability,currency,income,expense,assetloan,stock,equity,invalid" ); MyMoneyReport::MyMoneyReport() : m_name ( "Unconfigured Pivot Table Report" ), @@ -63,7 +63,7 @@ MyMoneyReport::MyMoneyReport() : m_rowType ( eExpenseIncome ), m_columnType ( eMonths ), m_columnsAreDays ( false ), - m_queryColumns ( eQCnone ), + m_queryColumns ( eTQCnone ), m_dateLock ( userDefined ), m_accountGroupFilter ( false ), m_chartType ( eChartLine ), @@ -83,14 +83,14 @@ MyMoneyReport::MyMoneyReport() : { } -MyMoneyReport::MyMoneyReport ( const QString& id, const MyMoneyReport& right ) : +MyMoneyReport::MyMoneyReport ( const TQString& id, const MyMoneyReport& right ) : MyMoneyObject ( id ) { *this = right; setId ( id ); } -MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment ) : +MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const TQString& _name, const TQString& _comment ) : m_name ( _name ), m_comment ( _comment ), m_detailLevel ( _ss ), @@ -162,7 +162,7 @@ MyMoneyReport::MyMoneyReport ( ERowType _rt, unsigned _ct, dateOptionE _dl, EDet } } -MyMoneyReport::MyMoneyReport ( const QDomElement& node ) : +MyMoneyReport::MyMoneyReport ( const TQDomElement& node ) : MyMoneyObject ( node ) { if ( !read ( node ) ) @@ -177,7 +177,7 @@ void MyMoneyReport::clear ( void ) MyMoneyTransactionFilter::clear(); } -void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de ) +void MyMoneyReport::validDateRange ( TQDate& _db, TQDate& _de ) { _db = fromDate(); _de = toDate(); @@ -193,16 +193,16 @@ void MyMoneyReport::validDateRange ( QDate& _db, QDate& _de ) // year as the filter criteria. if ( !_db.isValid() || !_de.isValid() ) { - QValueList<MyMoneyTransaction> list = MyMoneyFile::instance()->transactionList ( *this ); - QDate tmpBegin, tmpEnd; + TQValueList<MyMoneyTransaction> list = MyMoneyFile::instance()->transactionList ( *this ); + TQDate tmpBegin, tmpEnd; if ( !list.isEmpty() ) { qHeapSort ( list ); tmpBegin = list.front().postDate(); tmpEnd = list.back().postDate(); } else { - tmpBegin = QDate ( QDate::currentDate().year(), 1, 1 ); // the first date in the file - tmpEnd = QDate ( QDate::currentDate().year(), 12, 31 );// the last date in the file + tmpBegin = TQDate ( TQDate::tqcurrentDate().year(), 1, 1 ); // the first date in the file + tmpEnd = TQDate ( TQDate::tqcurrentDate().year(), 12, 31 );// the last date in the file } if ( !_db.isValid() ) _db = tmpBegin; @@ -233,14 +233,14 @@ void MyMoneyReport::setRowType ( ERowType _rt ) } } -bool MyMoneyReport::accountGroups(QValueList<MyMoneyAccount::accountTypeE>& list) const +bool MyMoneyReport::accountGroups(TQValueList<MyMoneyAccount::accountTypeE>& list) const { bool result = m_accountGroupFilter; if ( result ) { - QValueList<MyMoneyAccount::accountTypeE>::const_iterator it_group = m_accountGroups.begin(); + TQValueList<MyMoneyAccount::accountTypeE>::const_iterator it_group = m_accountGroups.begin(); while ( it_group != m_accountGroups.end() ) { list += ( *it_group ); @@ -253,7 +253,7 @@ bool MyMoneyReport::accountGroups(QValueList<MyMoneyAccount::accountTypeE>& list void MyMoneyReport::addAccountGroup ( MyMoneyAccount::accountTypeE type ) { if ( !m_accountGroups.isEmpty() && type != MyMoneyAccount::UnknownAccountType ) { - if ( m_accountGroups.contains ( type ) ) + if ( m_accountGroups.tqcontains ( type ) ) return; } m_accountGroupFilter = true; @@ -265,7 +265,7 @@ bool MyMoneyReport::includesAccountGroup( MyMoneyAccount::accountTypeE type ) co { bool result = ( ! m_accountGroupFilter ) || ( isIncludingTransfers() && m_rowType == MyMoneyReport::eExpenseIncome ) - || m_accountGroups.contains ( type ); + || m_accountGroups.tqcontains ( type ); return result; } @@ -305,7 +305,7 @@ bool MyMoneyReport::includes( const MyMoneyAccount& acc ) const return result; } -void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) const +void MyMoneyReport::write ( TQDomElement& e, TQDomDocument *doc, bool anonymous ) const { // No matter what changes, be sure to have a 'type' attribute. Only change // the major type if it becomes impossible to maintain compatability with @@ -317,7 +317,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( anonymous ) { e.setAttribute ( "name", m_id ); - e.setAttribute ( "comment", QString ( m_comment ).fill ( 'x' ) ); + e.setAttribute ( "comment", TQString ( m_comment ).fill ( 'x' ) ); } else { @@ -363,11 +363,11 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) { e.setAttribute ( "type", "querytable 1.14" ); - QStringList columns; + TQStringList columns; unsigned qc = m_queryColumns; - unsigned it_qc = eQCbegin; + unsigned it_qc = eTQCbegin; unsigned index = 1; - while ( it_qc != eQCend ) + while ( it_qc != eTQCend ) { if ( qc & it_qc ) columns += kQueryColumnsText[index]; @@ -387,10 +387,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Text Filter // - QRegExp textfilter; + TQRegExp textfilter; if ( textFilter ( textfilter ) ) { - QDomElement f = doc->createElement ( "TEXT" ); + TQDomElement f = doc->createElement ( "TEXT" ); f.setAttribute ( "pattern", textfilter.pattern() ); f.setAttribute ( "casesensitive", textfilter.caseSensitive() ); f.setAttribute ( "regex", !textfilter.wildcard() ); @@ -401,14 +401,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // // Type & State Filters // - QValueList<int> typelist; + TQValueList<int> typelist; if ( types ( typelist ) && ! typelist.empty() ) { // iterate over payees, and add each one - QValueList<int>::const_iterator it_type = typelist.begin(); + TQValueList<int>::const_iterator it_type = typelist.begin(); while ( it_type != typelist.end() ) { - QDomElement p = doc->createElement ( "TYPE" ); + TQDomElement p = doc->createElement ( "TYPE" ); p.setAttribute ( "type", kTypeText[*it_type] ); e.appendChild ( p ); @@ -416,14 +416,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) } } - QValueList<int> statelist; + TQValueList<int> statelist; if ( states ( statelist ) && ! statelist.empty() ) { // iterate over payees, and add each one - QValueList<int>::const_iterator it_state = statelist.begin(); + TQValueList<int>::const_iterator it_state = statelist.begin(); while ( it_state != statelist.end() ) { - QDomElement p = doc->createElement ( "STATE" ); + TQDomElement p = doc->createElement ( "STATE" ); p.setAttribute ( "state", kStateText[*it_state] ); e.appendChild ( p ); @@ -434,10 +434,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Number Filter // - QString nrFrom, nrTo; + TQString nrFrom, nrTo; if ( numberFilter ( nrFrom, nrTo ) ) { - QDomElement f = doc->createElement ( "NUMBER" ); + TQDomElement f = doc->createElement ( "NUMBER" ); f.setAttribute ( "from", nrFrom ); f.setAttribute ( "to", nrTo ); e.appendChild ( f ); @@ -450,7 +450,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) MyMoneyMoney from, to; if ( amountFilter ( from, to ) ) // bool getAmountFilter(MyMoneyMoney&,MyMoneyMoney&); { - QDomElement f = doc->createElement ( "AMOUNT" ); + TQDomElement f = doc->createElement ( "AMOUNT" ); f.setAttribute ( "from", from.toString() ); f.setAttribute ( "to", to.toString() ); e.appendChild ( f ); @@ -460,21 +460,21 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Payees Filter // - QStringList payeelist; + TQStringList payeelist; if ( payees ( payeelist ) ) { if ( payeelist.empty() ) { - QDomElement p = doc->createElement ( "PAYEE" ); + TQDomElement p = doc->createElement ( "PAYEE" ); e.appendChild ( p ); } else { // iterate over payees, and add each one - QStringList::const_iterator it_payee = payeelist.begin(); + TQStringList::const_iterator it_payee = payeelist.begin(); while ( it_payee != payeelist.end() ) { - QDomElement p = doc->createElement ( "PAYEE" ); + TQDomElement p = doc->createElement ( "PAYEE" ); p.setAttribute ( "id", *it_payee ); e.appendChild ( p ); @@ -487,14 +487,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Account Groups Filter // - QValueList<MyMoneyAccount::accountTypeE> accountgrouplist; + TQValueList<MyMoneyAccount::accountTypeE> accountgrouplist; if ( accountGroups ( accountgrouplist ) ) { // iterate over accounts, and add each one - QValueList<MyMoneyAccount::accountTypeE>::const_iterator it_group = accountgrouplist.begin(); + TQValueList<MyMoneyAccount::accountTypeE>::const_iterator it_group = accountgrouplist.begin(); while ( it_group != accountgrouplist.end() ) { - QDomElement p = doc->createElement ( "ACCOUNTGROUP" ); + TQDomElement p = doc->createElement ( "ACCOUNTGROUP" ); p.setAttribute ( "group", kAccountTypeText[*it_group] ); e.appendChild ( p ); @@ -506,14 +506,14 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) // Accounts Filter // - QStringList accountlist; + TQStringList accountlist; if ( accounts ( accountlist ) ) { // iterate over accounts, and add each one - QStringList::const_iterator it_account = accountlist.begin(); + TQStringList::const_iterator it_account = accountlist.begin(); while ( it_account != accountlist.end() ) { - QDomElement p = doc->createElement ( "ACCOUNT" ); + TQDomElement p = doc->createElement ( "ACCOUNT" ); p.setAttribute ( "id", *it_account ); e.appendChild ( p ); @@ -529,10 +529,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( categories ( accountlist ) ) { // iterate over accounts, and add each one - QStringList::const_iterator it_account = accountlist.begin(); + TQStringList::const_iterator it_account = accountlist.begin(); while ( it_account != accountlist.end() ) { - QDomElement p = doc->createElement ( "CATEGORY" ); + TQDomElement p = doc->createElement ( "CATEGORY" ); p.setAttribute ( "id", *it_account ); e.appendChild ( p ); @@ -546,10 +546,10 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) if ( m_dateLock == userDefined ) { - QDate dateFrom, dateTo; + TQDate dateFrom, dateTo; if ( dateFilter ( dateFrom, dateTo ) ) { - QDomElement f = doc->createElement ( "DATES" ); + TQDomElement f = doc->createElement ( "DATES" ); if ( dateFrom.isValid() ) f.setAttribute ( "from", dateFrom.toString ( Qt::ISODate ) ); if ( dateTo.isValid() ) @@ -559,7 +559,7 @@ void MyMoneyReport::write ( QDomElement& e, QDomDocument *doc, bool anonymous ) } } -bool MyMoneyReport::read ( const QDomElement& e ) +bool MyMoneyReport::read ( const TQDomElement& e ) { // The goal of this reading method is 100% backward AND 100% forward // compatability. Any report ever created with any version of KMyMoney @@ -572,11 +572,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) "REPORT" == e.tagName() && ( - ( e.attribute ( "type" ).find ( "pivottable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "pivottable 1." ) == 0 ) || - ( e.attribute ( "type" ).find ( "querytable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "querytable 1." ) == 0 ) || - ( e.attribute ( "type" ).find ( "infotable 1." ) == 0 ) + ( e.attribute ( "type" ).tqfind ( "infotable 1." ) == 0 ) ) ) { @@ -588,11 +588,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) m_comment = e.attribute ( "comment", "Extremely old report" ); //set report type - if(!e.attribute ( "type" ).find ( "pivottable" )) { + if(!e.attribute ( "type" ).tqfind ( "pivottable" )) { m_reportType = MyMoneyReport::ePivotTable; - } else if(!e.attribute ( "type" ).find ( "querytable" )) { + } else if(!e.attribute ( "type" ).tqfind ( "querytable" )) { m_reportType = MyMoneyReport::eQueryTable; - } else if(!e.attribute ( "type" ).find ( "infotable" )) { + } else if(!e.attribute ( "type" ).tqfind ( "infotable" )) { m_reportType = MyMoneyReport::eInfoTable; } else { m_reportType = MyMoneyReport::eNoReport; @@ -607,7 +607,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) //check for reports with older settings which didn't have the detail attribute if ( e.hasAttribute ( "detail" ) ) { - i = kDetailLevelText.findIndex ( e.attribute ( "detail", "all" ) ); + i = kDetailLevelText.tqfindIndex ( e.attribute ( "detail", "all" ) ); if ( i != -1 ) m_detailLevel = static_cast<EDetailLevel> ( i ); } else if ( e.attribute ( "showsubaccounts", "0" ).toUInt() ) { @@ -639,7 +639,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) //only load chart data if it is a pivot table if ( m_reportType == ePivotTable ) { - i = kChartTypeText.findIndex ( e.attribute ( "charttype" ) ); + i = kChartTypeText.tqfindIndex ( e.attribute ( "charttype" ) ); if ( i != -1 ) m_chartType = static_cast<EChartType> ( i ); @@ -660,20 +660,20 @@ bool MyMoneyReport::read ( const QDomElement& e ) m_chartLineWidth = 1; } - QString datelockstr = e.attribute ( "datelock", "userdefined" ); + TQString datelockstr = e.attribute ( "datelock", "userdefined" ); // Handle the pivot 1.2/query 1.1 case where the values were saved as // numbers bool ok = false; i = datelockstr.toUInt ( &ok ); if ( !ok ) { - i = kDateLockText.findIndex ( datelockstr ); + i = kDateLockText.tqfindIndex ( datelockstr ); if ( i == -1 ) i = userDefined; } setDateFilter ( static_cast<dateOptionE> ( i ) ); - i = kRowTypeText.findIndex ( e.attribute ( "rowtype", "expenseincome" ) ); + i = kRowTypeText.tqfindIndex ( e.attribute ( "rowtype", "expenseincome" ) ); if ( i != -1 ) { setRowType ( static_cast<ERowType> ( i ) ); @@ -687,16 +687,16 @@ bool MyMoneyReport::read ( const QDomElement& e ) if ( e.hasAttribute ( "showrowtotals" ) ) m_showRowTotals = e.attribute ( "showrowtotals" ).toUInt(); - i = kColumnTypeText.findIndex ( e.attribute ( "columntype", "months" ) ); + i = kColumnTypeText.tqfindIndex ( e.attribute ( "columntype", "months" ) ); if ( i != -1 ) setColumnType ( static_cast<EColumnType> ( i ) ); unsigned qc = 0; - QStringList columns = QStringList::split ( ",", e.attribute ( "querycolumns", "none" ) ); - QStringList::const_iterator it_column = columns.begin(); + TQStringList columns = TQStringList::split ( ",", e.attribute ( "querycolumns", "none" ) ); + TQStringList::const_iterator it_column = columns.begin(); while ( it_column != columns.end() ) { - i = kQueryColumnsText.findIndex ( *it_column ); + i = kQueryColumnsText.tqfindIndex ( *it_column ); if ( i > 0 ) qc |= ( 1 << ( i - 1 ) ); @@ -704,23 +704,23 @@ bool MyMoneyReport::read ( const QDomElement& e ) } setQueryColumns ( static_cast<EQueryColumns> ( qc ) ); - QDomNode child = e.firstChild(); + TQDomNode child = e.firstChild(); while ( !child.isNull() && child.isElement() ) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if ( "TEXT" == c.tagName() && c.hasAttribute ( "pattern" ) ) { - setTextFilter ( QRegExp ( c.attribute ( "pattern" ), c.attribute ( "casesensitive", "1" ).toUInt(), !c.attribute ( "regex", "1" ).toUInt() ), c.attribute ( "inverttext", "0" ).toUInt() ); + setTextFilter ( TQRegExp ( c.attribute ( "pattern" ), c.attribute ( "casesensitive", "1" ).toUInt(), !c.attribute ( "regex", "1" ).toUInt() ), c.attribute ( "inverttext", "0" ).toUInt() ); } if ( "TYPE" == c.tagName() && c.hasAttribute ( "type" ) ) { - i = kTypeText.findIndex ( c.attribute ( "type" ) ); + i = kTypeText.tqfindIndex ( c.attribute ( "type" ) ); if ( i != -1 ) addType ( i ); } if ( "STATE" == c.tagName() && c.hasAttribute ( "state" ) ) { - i = kStateText.findIndex ( c.attribute ( "state" ) ); + i = kStateText.tqfindIndex ( c.attribute ( "state" ) ); if ( i != -1 ) addState ( i ); } @@ -734,11 +734,11 @@ bool MyMoneyReport::read ( const QDomElement& e ) } if ( "DATES" == c.tagName() ) { - QDate from, to; + TQDate from, to; if ( c.hasAttribute ( "from" ) ) - from = QDate::fromString ( c.attribute ( "from" ), Qt::ISODate ); + from = TQDate::fromString ( c.attribute ( "from" ), Qt::ISODate ); if ( c.hasAttribute ( "to" ) ) - to = QDate::fromString ( c.attribute ( "to" ), Qt::ISODate ); + to = TQDate::fromString ( c.attribute ( "to" ), Qt::ISODate ); MyMoneyTransactionFilter::setDateFilter ( from, to ); } if ( "PAYEE" == c.tagName() ) @@ -755,7 +755,7 @@ bool MyMoneyReport::read ( const QDomElement& e ) } if ( "ACCOUNTGROUP" == c.tagName() && c.hasAttribute ( "group" ) ) { - i = kAccountTypeText.findIndex ( c.attribute ( "group" ) ); + i = kAccountTypeText.tqfindIndex ( c.attribute ( "group" ) ); if ( i != -1 ) addAccountGroup ( static_cast<MyMoneyAccount::accountTypeE> ( i ) ); } @@ -765,23 +765,23 @@ bool MyMoneyReport::read ( const QDomElement& e ) return result; } -void MyMoneyReport::writeXML ( QDomDocument& document, QDomElement& parent ) const +void MyMoneyReport::writeXML ( TQDomDocument& document, TQDomElement& tqparent ) const { - QDomElement el = document.createElement ( "REPORT" ); + TQDomElement el = document.createElement ( "REPORT" ); write ( el, &document, false ); - parent.appendChild ( el ); + tqparent.appendChild ( el ); } -bool MyMoneyReport::hasReferenceTo ( const QString& id ) const +bool MyMoneyReport::hasReferenceTo ( const TQString& id ) const { - QStringList list; + TQStringList list; // collect all ids accounts ( list ); categories ( list ); payees ( list ); - return ( list.contains ( id ) > 0 ); + return ( list.tqcontains ( id ) > 0 ); } // vim:cin:si:ai:et:ts=2:sw=2: diff --git a/kmymoney2/mymoney/mymoneyreport.h b/kmymoney2/mymoney/mymoneyreport.h index e467179..a541042 100644 --- a/kmymoney2/mymoney/mymoneyreport.h +++ b/kmymoney2/mymoney/mymoneyreport.h @@ -24,11 +24,11 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qmap.h> -#include <qvaluelist.h> -#include <qstring.h> -class QDomElement; -class QDomDocument; +#include <tqmap.h> +#include <tqvaluelist.h> +#include <tqstring.h> +class TQDomElement; +class TQDomDocument; // ---------------------------------------------------------------------------- // Project Includes @@ -45,8 +45,8 @@ class QDomDocument; * A report is a transactionfilter, so any report can specify which * transactions it's interested down to the most minute level of detail. * It extends the transactionfilter by providing identification (name, - * comments, group type, etc) as well as layout information (what kind - * of layout should be used, how the rows & columns should be presented, + * comments, group type, etc) as well as tqlayout information (what kind + * of tqlayout should be used, how the rows & columns should be presented, * currency converted, etc.) * * As noted above, this class only provides a report DEFINITION. The @@ -64,34 +64,34 @@ public: enum EReportType { eNoReport = 0, ePivotTable, eQueryTable, eInfoTable }; enum EColumnType { eNoColumns = 0, eDays = 1, eMonths = 1, eBiMonths = 2, eQuarters = 3, eWeeks = 7, eYears = 12 }; - // if you add bits to this bitmask, start with the value currently assigned to eQCend and update its value afterwards + // if you add bits to this bittqmask, start with the value currently assigned to eTQCend and update its value afterwards // also don't forget to add column names to kQueryColumnsText in mymoneyreport.cpp - enum EQueryColumns { eQCnone = 0x0, eQCbegin = 0x1, eQCnumber = 0x1, eQCpayee = 0x2, eQCcategory = 0x4, eQCmemo = 0x8, eQCaccount = 0x10, eQCreconciled = 0x20, eQCaction = 0x40, eQCshares = 0x80, eQCprice = 0x100, eQCperformance = 0x200, eQCloan = 0x400, eQCbalance = 0x800, eQCend = 0x1000 }; + enum EQueryColumns { eTQCnone = 0x0, eTQCbegin = 0x1, eTQCnumber = 0x1, eTQCpayee = 0x2, eTQCcategory = 0x4, eTQCmemo = 0x8, eTQCaccount = 0x10, eTQCreconciled = 0x20, eTQCaction = 0x40, eTQCshares = 0x80, eTQCprice = 0x100, eTQCperformance = 0x200, eTQCloan = 0x400, eTQCbalance = 0x800, eTQCend = 0x1000 }; enum EDetailLevel { eDetailNone = 0, eDetailAll, eDetailTop, eDetailGroup, eDetailTotal, eDetailEnd }; enum EChartType { eChartNone = 0, eChartLine, eChartBar, eChartPie, eChartRing, eChartStackedBar, eChartEnd }; - static const QStringList kRowTypeText; - static const QStringList kColumnTypeText; - static const QStringList kQueryColumnsText; - static const QStringList kDetailLevelText; - static const QStringList kChartTypeText; + static const TQStringList kRowTypeText; + static const TQStringList kColumnTypeText; + static const TQStringList kQueryColumnsText; + static const TQStringList kDetailLevelText; + static const TQStringList kChartTypeText; static const EReportType kTypeArray[]; public: MyMoneyReport(void); - MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const QString& _name, const QString& _comment ); - MyMoneyReport(const QString& id, const MyMoneyReport& right); + MyMoneyReport(ERowType _rt, unsigned _ct, dateOptionE _dl, EDetailLevel _ss, const TQString& _name, const TQString& _comment ); + MyMoneyReport(const TQString& id, const MyMoneyReport& right); /** * This constructor creates an object based on the data found in the - * QDomElement referenced by @p node. If problems arise, the @p id of + * TQDomElement referenced by @p node. If problems arise, the @p id of * the object is cleared (see MyMoneyObject::clearId()). */ - MyMoneyReport(const QDomElement& node); + MyMoneyReport(const TQDomElement& node); // Simple get operations - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } bool isShowingRowTotals(void) const { return (m_showRowTotals); } EReportType reportType(void) const { return m_reportType; } ERowType rowType(void) const { return m_rowType; } @@ -100,9 +100,9 @@ public: bool isConvertCurrency(void) const { return m_convertCurrency; } unsigned columnPitch(void) const { return static_cast<unsigned>(m_columnType); } bool isShowingColumnTotals(void) const { return m_convertCurrency; } - const QString& comment( void ) const { return m_comment; } + const TQString& comment( void ) const { return m_comment; } EQueryColumns queryColumns(void) const { return m_queryColumns; } - const QString& group( void ) const { return m_group; } + const TQString& group( void ) const { return m_group; } bool isFavorite(void) const { return m_favorite; } bool isTax(void) const { return m_tax; } bool isInvestmentsOnly(void) const { return m_investments; } @@ -118,7 +118,7 @@ public: bool isIncludingTransfers(void) const { return m_includeTransfers; } bool isIncludingUnusedAccounts(void) const { return m_includeUnusedAccounts; } bool hasBudget(void) const { return !m_budgetId.isEmpty(); } - const QString& budget(void) const { return m_budgetId; } + const TQString& budget(void) const { return m_budgetId; } bool isIncludingBudgetActuals(void) const { return m_includeBudgetActuals; } bool isIncludingForecast(void) const { return m_includeForecast; } bool isIncludingMovingAverage(void) const { return m_includeMovingAverage; } @@ -128,12 +128,12 @@ public: bool isUserDefined(void) const { return m_dateLock == userDefined; } // Simple set operations - void setName(const QString& _s) { m_name = _s; } + void setName(const TQString& _s) { m_name = _s; } void setConvertCurrency(bool _f) { m_convertCurrency = _f; } void setRowType(ERowType _rt); void setColumnType(EColumnType _ct) { m_columnType = _ct; } - void setComment( const QString& _comment ) { m_comment = _comment; } - void setGroup( const QString& _group ) { m_group = _group; } + void setComment( const TQString& _comment ) { m_comment = _comment; } + void setGroup( const TQString& _group ) { m_group = _group; } void setFavorite(bool _f) { m_favorite = _f; } void setQueryColumns( EQueryColumns _qc ) { m_queryColumns = _qc; } void setTax(bool _f) { m_tax = _f; } @@ -168,7 +168,7 @@ public: * simply checked for any non-empty string, and if so, hasBudget() * will return true. */ - void setBudget( const QString& _budget, bool _fa = true ) { m_budgetId = _budget; m_includeBudgetActuals=_fa; } + void setBudget( const TQString& _budget, bool _fa = true ) { m_budgetId = _budget; m_includeBudgetActuals=_fa; } /** * This method allows you to clear the underlying transaction filter @@ -212,7 +212,7 @@ public: * @param _de The inclusive end date of the date range */ - void setDateFilter(const QDate& _db,const QDate& _de) { MyMoneyTransactionFilter::setDateFilter( _db,_de ); } + void setDateFilter(const TQDate& _db,const TQDate& _de) { MyMoneyTransactionFilter::setDateFilter( _db,_de ); } /** * Set the underlying date filter using the 'date lock' property. @@ -230,19 +230,19 @@ public: /** * Retrieves a VALID beginning & ending date for this report. * - * The underlying date filter can return en empty QDate() for either the + * The underlying date filter can return en empty TQDate() for either the * begin or end date or both. This is typically unacceptable for reports, * which need the REAL begin and end date. * * This function gets the underlying date filter range, and if either is - * an empty QDate(), it determines the missing date from looking at all + * an empty TQDate(), it determines the missing date from looking at all * the transactions which match the underlying filter, and returning the * date of the first or last transaction (as appropriate). * * @param _db The inclusive begin date of the date range * @param _de The inclusive end date of the date range */ - void validDateRange(QDate& _db, QDate& _de); + void validDateRange(TQDate& _db, TQDate& _de); /** * This method turns on the account group filter and adds the @@ -251,7 +251,7 @@ public: * Note that account group filtering is handled differently * than all the filters of the underlying class. This filter * is meant to be applied to individual splits of matched - * transactions AFTER the underlying filter is used to find + * transactions AFTER the underlying filter is used to tqfind * the matching transactions. * * @param type the account group to add to the allowed groups list @@ -265,7 +265,7 @@ public: * @param list list to append account groups into * @return return true if an account group filter has been set */ - bool accountGroups(QValueList<MyMoneyAccount::accountTypeE>& list) const; + bool accountGroups(TQValueList<MyMoneyAccount::accountTypeE>& list) const; /** * This method returns whether the specified account group @@ -296,9 +296,9 @@ public: * @param doc The document which we can use to create new sub-elements * if needed * @param anonymous Whether the sensitive parts of the report should be - * masked + * tqmasked */ - void write(QDomElement& e, QDomDocument *doc, bool anonymous=false) const; + void write(TQDomElement& e, TQDomDocument *doc, bool anonymous=false) const; /** * This method reads a report from the DOM element @p e, and @@ -310,17 +310,17 @@ public: * element @p e. If false is returned, the contents of this report * object are undefined. */ - bool read(const QDomElement& e); + bool read(const TQDomElement& e); /** - * This method creates a QDomElement for the @p document - * under the parent node @p parent. (This version overwrites the + * This method creates a TQDomElement for the @p document + * under the tqparent node @p tqparent. (This version overwrites the * MMObject base class.) * - * @param document reference to QDomDocument - * @param parent reference to QDomElement parent node + * @param document reference to TQDomDocument + * @param tqparent reference to TQDomElement tqparent node */ - virtual void writeXML(QDomDocument& document, QDomElement& parent) const; + virtual void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -331,23 +331,23 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; private: /** * The user-assigned name of the report */ - QString m_name; + TQString m_name; /** * The user-assigned comment for the report, in case they want to make * additional notes for themselves about the report. */ - QString m_comment; + TQString m_comment; /** * Where to group this report amongst the others in the UI view. This * should be assigned by the UI system. */ - QString m_group; + TQString m_group; /** * How much detail to show in the accounts */ @@ -417,7 +417,7 @@ private: * is applied to the individual splits AFTER a transaction has been * matched using the underlying filter. */ - QValueList<MyMoneyAccount::accountTypeE> m_accountGroups; + TQValueList<MyMoneyAccount::accountTypeE> m_accountGroups; /** * Whether an account group filter has been set (see m_accountGroups) */ @@ -454,7 +454,7 @@ private: /** * The id of the budget associated with this report. */ - QString m_budgetId; + TQString m_budgetId; /** * Whether this report should print the actual data to go along with * the budget. This is only valid if the report has a budget. diff --git a/kmymoney2/mymoney/mymoneyscheduled.cpp b/kmymoney2/mymoney/mymoneyscheduled.cpp index 88b4c7b..ef8264c 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.cpp +++ b/kmymoney2/mymoney/mymoneyscheduled.cpp @@ -40,17 +40,17 @@ MyMoneySchedule::MyMoneySchedule() : m_paymentType = STYPE_ANY; m_fixed = false; m_autoEnter = false; - m_startDate = QDate(); - m_endDate = QDate(); - m_lastPayment = QDate(); + m_startDate = TQDate(); + m_endDate = TQDate(); + m_lastPayment = TQDate(); m_weekendOption = MoveNothing; } -MyMoneySchedule::MyMoneySchedule(const QString& name, typeE type, +MyMoneySchedule::MyMoneySchedule(const TQString& name, typeE type, occurenceE occurence, int occurenceMultiplier, paymentTypeE paymentType, - const QDate& /* startDate */, - const QDate& endDate, + const TQDate& /* startDate */, + const TQDate& endDate, bool fixed, bool autoEnter) : MyMoneyObject() { @@ -63,13 +63,13 @@ MyMoneySchedule::MyMoneySchedule(const QString& name, typeE type, m_paymentType = paymentType; m_fixed = fixed; m_autoEnter = autoEnter; - m_startDate = QDate(); + m_startDate = TQDate(); m_endDate = endDate; - m_lastPayment = QDate(); + m_lastPayment = TQDate(); m_weekendOption = MoveNothing; } -MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : +MyMoneySchedule::MyMoneySchedule(const TQDomElement& node) : MyMoneyObject(node) { if("SCHEDULED_TX" != node.tagName()) @@ -91,7 +91,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : m_weekendOption = static_cast<MyMoneySchedule::weekendOptionE>(node.attribute("weekendOption").toInt()); // read in the associated transaction - QDomNodeList nodeList = node.elementsByTagName("TRANSACTION"); + TQDomNodeList nodeList = node.elementsByTagName("TRANSACTION"); if(nodeList.count() == 0) throw new MYMONEYEXCEPTION("SCHEDULED_TX has no TRANSACTION node"); @@ -101,8 +101,8 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : // in the schedule. So if this is the case, we deal with a very old transaction // and can't use the post date field as next due date. Hence, we wipe it out here if(m_transaction.entryDate().isValid()) { - m_transaction.setPostDate(QDate()); - m_transaction.setEntryDate(QDate()); + m_transaction.setPostDate(TQDate()); + m_transaction.setEntryDate(TQDate()); } // readin the recorded payments @@ -119,7 +119,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : if(!nextDueDate().isValid() && !m_lastPayment.isValid()) { m_transaction.setPostDate(m_startDate); // clear it, because the schedule has never been used - m_startDate = QDate(); + m_startDate = TQDate(); } // There are reports that lastPayment and nextDueDate are identical or @@ -127,7 +127,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : // be caused by older versions of the application. In this case, we just // clear out the nextDueDate and let it calculate from the lastPayment. if(nextDueDate().isValid() && nextDueDate() <= m_lastPayment) { - m_transaction.setPostDate(QDate()); + m_transaction.setPostDate(TQDate()); } if(!nextDueDate().isValid()) { @@ -136,7 +136,7 @@ MyMoneySchedule::MyMoneySchedule(const QDomElement& node) : } } -MyMoneySchedule::MyMoneySchedule(const QString& id, const MyMoneySchedule& right) : +MyMoneySchedule::MyMoneySchedule(const TQString& id, const MyMoneySchedule& right) : MyMoneyObject(id) { *this = right; @@ -151,7 +151,7 @@ MyMoneySchedule::occurenceE MyMoneySchedule::occurence(void) const return occ; } -void MyMoneySchedule::setStartDate(const QDate& date) +void MyMoneySchedule::setStartDate(const TQDate& date) { m_startDate = date; } @@ -190,14 +190,14 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool // make sure to clear out some unused information in scheduled transactions // we need to do this for the case that the transaction passed as argument // is a matched or imported transaction. - QValueList<MyMoneySplit> splits = t.splits(); + TQValueList<MyMoneySplit> splits = t.splits(); if(splits.count() > 0) { - QValueList<MyMoneySplit>::const_iterator it_s; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = splits.begin(); it_s != splits.end(); ++it_s) { MyMoneySplit s = *it_s; // clear out the bankID if(!(*it_s).bankID().isEmpty()) { - s.setBankID(QString()); + s.setBankID(TQString()); t.modifySplit(s); } @@ -212,10 +212,10 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool // simply skip the test // Don't check for accounts with an id of 'Phony-ID' which is used // internally for non-existing accounts (during creation of accounts) - if(file->storageAttached() && s.accountId() != QString("Phony-ID")) { + if(file->storageAttached() && s.accountId() != TQString("Phony-ID")) { MyMoneyAccount acc = file->account(s.accountId()); if(acc.isIncomeExpense()) { - s.setPayeeId(QString()); + s.setPayeeId(TQString()); t.modifySplit(s); } } @@ -229,7 +229,7 @@ void MyMoneySchedule::setTransaction(const MyMoneyTransaction& transaction, bool m_transaction.clearId(); } -void MyMoneySchedule::setEndDate(const QDate& date) +void MyMoneySchedule::setEndDate(const TQDate& date) { m_endDate = date; } @@ -239,27 +239,27 @@ void MyMoneySchedule::setAutoEnter(bool autoenter) m_autoEnter = autoenter; } -const QDate& MyMoneySchedule::startDate(void) const +const TQDate& MyMoneySchedule::startDate(void) const { if(m_startDate.isValid()) return m_startDate; return nextDueDate(); } -const QDate& MyMoneySchedule::nextDueDate(void) const +const TQDate& MyMoneySchedule::nextDueDate(void) const { return m_transaction.postDate(); } -QDate MyMoneySchedule::adjustedNextDueDate(void) const +TQDate MyMoneySchedule::adjustedNextDueDate(void) const { if(isFinished()) - return QDate(); + return TQDate(); return adjustedDate(nextDueDate(), weekendOption()); } -QDate MyMoneySchedule::adjustedDate(QDate date, weekendOptionE option) const +TQDate MyMoneySchedule::adjustedDate(TQDate date, weekendOptionE option) const { if (option == MyMoneySchedule::MoveNothing) return date; @@ -274,7 +274,7 @@ QDate MyMoneySchedule::adjustedDate(QDate date, weekendOptionE option) const return date; } -void MyMoneySchedule::setNextDueDate(const QDate& date) +void MyMoneySchedule::setNextDueDate(const TQDate& date) { if(date.isValid()) { m_transaction.setPostDate(date); @@ -282,11 +282,11 @@ void MyMoneySchedule::setNextDueDate(const QDate& date) } } -void MyMoneySchedule::setLastPayment(const QDate& date) +void MyMoneySchedule::setLastPayment(const TQDate& date) { // Delete all payments older than date - QValueList<QDate>::Iterator it; - QValueList<QDate> delList; + TQValueList<TQDate>::Iterator it; + TQValueList<TQDate> delList; for (it=m_recordedPayments.begin(); it!=m_recordedPayments.end(); ++it) { @@ -304,7 +304,7 @@ void MyMoneySchedule::setLastPayment(const QDate& date) m_startDate = date; } -void MyMoneySchedule::setName(const QString& nm) +void MyMoneySchedule::setName(const TQString& nm) { m_name = nm; } @@ -373,7 +373,7 @@ void MyMoneySchedule::validate(bool id_check) const break; case TYPE_DEPOSIT: - if (m_paymentType == STYPE_DIRECTDEBIT || m_paymentType == STYPE_WRITECHEQUE) + if (m_paymentType == STYPE_DIRECTDEBIT || m_paymentType == STYPE_WRITECHETQUE) throw new MYMONEYEXCEPTION("Invalid payment type for deposits"); break; @@ -391,21 +391,21 @@ void MyMoneySchedule::validate(bool id_check) const } } -QDate MyMoneySchedule::adjustedNextPayment(const QDate& refDate) const +TQDate MyMoneySchedule::adjustedNextPayment(const TQDate& refDate) const { - QDate date(nextPayment(refDate)); + TQDate date(nextPayment(refDate)); return date.isValid() ? adjustedDate(date, weekendOption()) : date; } -QDate MyMoneySchedule::nextPayment(const QDate& refDate) const +TQDate MyMoneySchedule::nextPayment(const TQDate& refDate) const { // if the enddate is valid and it is before the reference date, // then there will be no more payments. if(m_endDate.isValid() && m_endDate < refDate) { - return QDate(); + return TQDate(); } - QDate paymentDate(nextDueDate()); + TQDate paymentDate(nextDueDate()); if(refDate >= paymentDate) { switch (m_occurence) @@ -414,11 +414,11 @@ QDate MyMoneySchedule::nextPayment(const QDate& refDate) const // if the lastPayment is already set, then there will be no more payments // otherwise, the start date is the payment date if(m_lastPayment.isValid()) - return QDate(); + return TQDate(); // if the only payment should have been prior to the reference date, // then don't show it if(paymentDate < refDate) - return QDate(); + return TQDate(); break; case OCCUR_DAILY: @@ -461,39 +461,39 @@ QDate MyMoneySchedule::nextPayment(const QDate& refDate) const case OCCUR_ANY: default: - paymentDate = QDate(); + paymentDate = TQDate(); break; } } if(paymentDate.isValid()) { if(m_endDate.isValid() && paymentDate > m_endDate) - paymentDate = QDate(); + paymentDate = TQDate(); } - if (paymentDate.isValid() && m_recordedPayments.contains(paymentDate)) + if (paymentDate.isValid() && m_recordedPayments.tqcontains(paymentDate)) paymentDate = nextPayment(paymentDate); return paymentDate; } -QValueList<QDate> MyMoneySchedule::paymentDates(const QDate& _startDate, const QDate& _endDate) const +TQValueList<TQDate> MyMoneySchedule::paymentDates(const TQDate& _startDate, const TQDate& _endDate) const { - QDate paymentDate(nextDueDate()); - QValueList<QDate> theDates; + TQDate paymentDate(nextDueDate()); + TQValueList<TQDate> theDates; - QDate endDate(_endDate); + TQDate endDate(_endDate); if ( willEnd() && m_endDate < endDate ) endDate = m_endDate; weekendOptionE option(weekendOption()); - QDate start_date(adjustedDate(startDate(), option)); + TQDate start_date(adjustedDate(startDate(), option)); // if the period specified by the parameters and the period // defined for this schedule don't overlap, then the list remains empty if ((willEnd() && m_endDate < _startDate) || start_date > endDate) return theDates; - QDate date(adjustedDate(paymentDate, option)); + TQDate date(adjustedDate(paymentDate, option)); switch (m_occurence) { @@ -594,7 +594,7 @@ int MyMoneySchedule::transactionsRemaining(void) const if (m_endDate.isValid()) { - QValueList<QDate> dates = paymentDates(m_lastPayment, m_endDate); + TQValueList<TQDate> dates = paymentDates(m_lastPayment, m_endDate); // Dont include the last payment so -1 counter = dates.count(); } @@ -603,8 +603,8 @@ int MyMoneySchedule::transactionsRemaining(void) const MyMoneyAccount MyMoneySchedule::account(int cnt) const { - QValueList<MyMoneySplit> splits = m_transaction.splits(); - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit> splits = m_transaction.splits(); + TQValueList<MyMoneySplit>::ConstIterator it; MyMoneyFile* file = MyMoneyFile::instance(); MyMoneyAccount acc; @@ -627,10 +627,10 @@ MyMoneyAccount MyMoneySchedule::account(int cnt) const return MyMoneyAccount(); } -QDate MyMoneySchedule::dateAfter(int transactions) const +TQDate MyMoneySchedule::dateAfter(int transactions) const { int counter=1; - QDate paymentDate(startDate()); + TQDate paymentDate(startDate()); if (transactions<=0) return paymentDate; @@ -680,7 +680,7 @@ bool MyMoneySchedule::isOverdue() const if (isFinished()) return false; - if(adjustedNextDueDate() >= QDate::currentDate()) + if(adjustedNextDueDate() >= TQDate::tqcurrentDate()) return false; return true; @@ -705,19 +705,19 @@ bool MyMoneySchedule::isFinished() const return false; } -bool MyMoneySchedule::hasRecordedPayment(const QDate& date) const +bool MyMoneySchedule::hasRecordedPayment(const TQDate& date) const { // m_lastPayment should always be > recordedPayments() if (m_lastPayment.isValid() && m_lastPayment >= date) return true; - if (m_recordedPayments.contains(date)) + if (m_recordedPayments.tqcontains(date)) return true; return false; } -void MyMoneySchedule::recordPayment(const QDate& date) +void MyMoneySchedule::recordPayment(const TQDate& date) { m_recordedPayments.append(date); } @@ -737,19 +737,19 @@ void MyMoneySchedule::setWeekendOption(const weekendOptionE option) } } -void MyMoneySchedule::fixDate(QDate& date) const +void MyMoneySchedule::fixDate(TQDate& date) const { - QDate fixDate(m_startDate); + TQDate fixDate(m_startDate); if(fixDate.isValid() && date.day() != fixDate.day() - && QDate::isValid(date.year(), date.month(), fixDate.day())) { + && TQDate::isValid(date.year(), date.month(), fixDate.day())) { date.setYMD(date.year(), date.month(), fixDate.day()); } } -void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySchedule::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("SCHEDULED_TX"); + TQDomElement el = document.createElement("SCHEDULED_TX"); writeBaseXML(document, el); @@ -766,11 +766,11 @@ void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) cons el.setAttribute("weekendOption", m_weekendOption); //store the payment history for this scheduled task. - QValueList<QDate> payments = recordedPayments(); - QValueList<QDate>::ConstIterator it; - QDomElement paymentsElement = document.createElement("PAYMENTS"); + TQValueList<TQDate> payments = recordedPayments(); + TQValueList<TQDate>::ConstIterator it; + TQDomElement paymentsElement = document.createElement("PAYMENTS"); for (it=payments.begin(); it!=payments.end(); ++it) { - QDomElement paymentEntry = document.createElement("PAYMENT"); + TQDomElement paymentEntry = document.createElement("PAYMENT"); paymentEntry.setAttribute("date", dateToString(*it)); paymentsElement.appendChild(paymentEntry); } @@ -779,22 +779,22 @@ void MyMoneySchedule::writeXML(QDomDocument& document, QDomElement& parent) cons //store the transaction data for this task. m_transaction.writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneySchedule::hasReferenceTo(const QString& id) const +bool MyMoneySchedule::hasReferenceTo(const TQString& id) const { return m_transaction.hasReferenceTo(id); } -QString MyMoneySchedule::occurenceToString() const +TQString MyMoneySchedule::occurenceToString() const { return occurenceToString( occurenceMultiplier(), occurencePeriod() ); } -QString MyMoneySchedule::occurenceToString(occurenceE occurence) +TQString MyMoneySchedule::occurenceToString(occurenceE occurence) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if(occurence == MyMoneySchedule::OCCUR_ONCE) occurenceString = I18N_NOOP("Once"); @@ -822,7 +822,7 @@ QString MyMoneySchedule::occurenceToString(occurenceE occurence) occurenceString = I18N_NOOP("Every two months"); else if(occurence == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) occurenceString = I18N_NOOP("Every three months"); - else if(occurence == MyMoneySchedule::OCCUR_QUARTERLY) + else if(occurence == MyMoneySchedule::OCCUR_TQUARTERLY) occurenceString = I18N_NOOP("Quarterly"); else if(occurence == MyMoneySchedule::OCCUR_EVERYFOURMONTHS) occurenceString = I18N_NOOP("Every four months"); @@ -835,22 +835,22 @@ QString MyMoneySchedule::occurenceToString(occurenceE occurence) return occurenceString; } -QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) +TQString MyMoneySchedule::occurenceToString(int mult, occurenceE type) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if (type == MyMoneySchedule::OCCUR_ONCE) switch (mult) { case 1: occurenceString = I18N_NOOP("Once"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("%1 times").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("%1 times").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_DAILY) switch (mult) { case 1: occurenceString = I18N_NOOP("Daily"); break; case 30: occurenceString = I18N_NOOP("Every thirty days"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("Every %1 days").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 days").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_WEEKLY) switch (mult) @@ -860,13 +860,13 @@ QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) case 3: occurenceString = I18N_NOOP("Every three weeks"); break; case 4: occurenceString = I18N_NOOP("Every four weeks"); break; case 8: occurenceString = I18N_NOOP("Every eight weeks"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("Every %1 weeks").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 weeks").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_EVERYHALFMONTH) switch (mult) { case 1: occurenceString = I18N_NOOP("Every half month"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("Every %1 half months").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 half months").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_MONTHLY) switch (mult) @@ -876,21 +876,21 @@ QString MyMoneySchedule::occurenceToString(int mult, occurenceE type) case 3: occurenceString = I18N_NOOP("Every three months"); break; case 4: occurenceString = I18N_NOOP("Every four months"); break; case 6: occurenceString = I18N_NOOP("Twice yearly"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("Every %1 months").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 months").tqarg(mult)); } else if(type == MyMoneySchedule::OCCUR_YEARLY) switch (mult) { case 1: occurenceString = I18N_NOOP("Yearly"); break; case 2: occurenceString = I18N_NOOP("Every other year"); break; - default: occurenceString = I18N_NOOP(static_cast<QString>("Every %1 years").arg(mult)); + default: occurenceString = I18N_NOOP(static_cast<TQString>("Every %1 years").tqarg(mult)); } return occurenceString; } -QString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE type) +TQString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE type) { - QString occurenceString = I18N_NOOP("Any"); + TQString occurenceString = I18N_NOOP("Any"); if(type == MyMoneySchedule::OCCUR_ONCE) occurenceString = I18N_NOOP("Once"); @@ -907,9 +907,9 @@ QString MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::occurenceE typ return occurenceString; } -QString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) +TQString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) { - QString text; + TQString text; switch (type) { case MyMoneySchedule::TYPE_BILL: @@ -932,9 +932,9 @@ QString MyMoneySchedule::scheduleTypeToString(MyMoneySchedule::typeE type) } -QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) +TQString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType) { - QString text; + TQString text; switch (paymentType) { case MyMoneySchedule::STYPE_DIRECTDEBIT: @@ -949,7 +949,7 @@ QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE pay case MyMoneySchedule::STYPE_OTHER: text = I18N_NOOP("Other"); break; - case MyMoneySchedule::STYPE_WRITECHEQUE: + case MyMoneySchedule::STYPE_WRITECHETQUE: text = I18N_NOOP("Write check"); break; case MyMoneySchedule::STYPE_STANDINGORDER: @@ -965,9 +965,9 @@ QString MyMoneySchedule::paymentMethodToString(MyMoneySchedule::paymentTypeE pay return text; } -QString MyMoneySchedule::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) +TQString MyMoneySchedule::weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption) { - QString text; + TQString text; switch (weekendOption) { case MyMoneySchedule::MoveFriday: @@ -995,7 +995,7 @@ int MyMoneySchedule::variation(void) const if(!isFixed()) { rc = 10; #if 0 - QString var = value("kmm-variation"); + TQString var = value("kmm-variation"); if(!var.isEmpty()) rc = var.toInt(); #endif @@ -1008,7 +1008,7 @@ void MyMoneySchedule::setVariation(int var) #if 0 deletePair("kmm-variation"); if(var != 0) - setValue("kmm-variation", QString("%1").arg(var)); + setValue("kmm-variation", TQString("%1").tqarg(var)); #endif } @@ -1049,7 +1049,7 @@ int MyMoneySchedule::eventsPerYear(MyMoneySchedule::occurenceE occurence) rc = 6; break; case MyMoneySchedule::OCCUR_EVERYTHREEMONTHS: - case MyMoneySchedule::OCCUR_QUARTERLY: + case MyMoneySchedule::OCCUR_TQUARTERLY: rc = 4; break; case MyMoneySchedule::OCCUR_EVERYFOURMONTHS: @@ -1107,7 +1107,7 @@ int MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::occurenceE occurence) rc = 60; break; case MyMoneySchedule::OCCUR_EVERYTHREEMONTHS: - case MyMoneySchedule::OCCUR_QUARTERLY: + case MyMoneySchedule::OCCUR_TQUARTERLY: rc = 90; break; case MyMoneySchedule::OCCUR_EVERYFOURMONTHS: @@ -1126,9 +1126,9 @@ int MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::occurenceE occurence) return rc; } -QDate MyMoneySchedule::addHalfMonths( QDate date, int mult ) const +TQDate MyMoneySchedule::addHalfMonths( TQDate date, int mult ) const { - QDate newdate = date; + TQDate newdate = date; int d, dm; if ( mult > 0 ) { @@ -1184,10 +1184,10 @@ QDate MyMoneySchedule::addHalfMonths( QDate date, int mult ) const return newdate; } -MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const QString& text) +MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const TQString& text) { MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY; - QString tmp = text.lower(); + TQString tmp = text.lower(); if(tmp == i18n("Once").lower()) occurence = MyMoneySchedule::OCCUR_ONCE; @@ -1216,7 +1216,7 @@ MyMoneySchedule::occurenceE MyMoneySchedule::stringToOccurence(const QString& te else if(tmp == i18n("Every three months").lower()) occurence = MyMoneySchedule::OCCUR_EVERYTHREEMONTHS; else if(tmp == i18n("Quarterly").lower()) - occurence = MyMoneySchedule::OCCUR_QUARTERLY; + occurence = MyMoneySchedule::OCCUR_TQUARTERLY; else if(tmp == i18n("Every four months").lower()) occurence = MyMoneySchedule::OCCUR_EVERYFOURMONTHS; else if(tmp == i18n("Twice yearly").lower()) @@ -1279,7 +1279,7 @@ void MyMoneySchedule::simpleToCompoundOccurence(int& multiplier,occurenceE& occu newMulti = 2; } else if(occurence == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS || - occurence == MyMoneySchedule::OCCUR_QUARTERLY ) + occurence == MyMoneySchedule::OCCUR_TQUARTERLY ) { newOcc = MyMoneySchedule::OCCUR_MONTHLY; newMulti = 3; diff --git a/kmymoney2/mymoney/mymoneyscheduled.h b/kmymoney2/mymoney/mymoneyscheduled.h index 46303b2..cc92b1d 100644 --- a/kmymoney2/mymoney/mymoneyscheduled.h +++ b/kmymoney2/mymoney/mymoneyscheduled.h @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstringlist.h> -#include <qmap.h> -#include <qdatetime.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqdatetime.h> // ---------------------------------------------------------------------------- @@ -68,7 +68,7 @@ public: OCCUR_MONTHLY=32, OCCUR_EVERYFOURWEEKS=64, OCCUR_EVERYEIGHTWEEKS=126, OCCUR_EVERYOTHERMONTH=128, OCCUR_EVERYTHREEMONTHS=256, - OCCUR_TWICEYEARLY=1024, OCCUR_EVERYOTHERYEAR=2048, OCCUR_QUARTERLY=4096, + OCCUR_TWICEYEARLY=1024, OCCUR_EVERYOTHERYEAR=2048, OCCUR_TQUARTERLY=4096, OCCUR_EVERYFOURMONTHS=8192, OCCUR_YEARLY=16384 }; @@ -82,7 +82,7 @@ public: */ enum paymentTypeE { STYPE_ANY=0, STYPE_DIRECTDEBIT=1, STYPE_DIRECTDEPOSIT=2, STYPE_MANUALDEPOSIT=4, STYPE_OTHER=8, - STYPE_WRITECHEQUE=16, + STYPE_WRITECHETQUE=16, STYPE_STANDINGORDER=32, STYPE_BANKTRANSFER=64 }; @@ -105,14 +105,14 @@ public: * Please note that the optional fields are not set and the transaction * MUST be set before it can be used. * - * @a startDate is not used anymore and internally set to QDate() + * @a startDate is not used anymore and internally set to TQDate() */ - MyMoneySchedule(const QString& name, typeE type, occurenceE occurence, int occurenceMultiplier, - paymentTypeE paymentType, const QDate& startDate, const QDate& endDate, bool fixed, bool autoEnter); + MyMoneySchedule(const TQString& name, typeE type, occurenceE occurence, int occurenceMultiplier, + paymentTypeE paymentType, const TQDate& startDate, const TQDate& endDate, bool fixed, bool autoEnter); - MyMoneySchedule(const QDomElement& node); + MyMoneySchedule(const TQDomElement& node); - MyMoneySchedule(const QString& id, const MyMoneySchedule& right); + MyMoneySchedule(const TQString& id, const MyMoneySchedule& right); /** * Standard destructor @@ -155,9 +155,9 @@ public: * execution is returned. Otherwise, the next due date is * returned. * - * @return reference to QDate containing the start date. + * @return reference to TQDate containing the start date. */ - const QDate& startDate(void) const; + const TQDate& startDate(void) const; /** * Simple get method that returns the schedule paymentType. @@ -191,9 +191,9 @@ public: /** * Simple get method that returns the schedule end date. * - * @return QDate The end date for the instance. + * @return TQDate The end date for the instance. */ - const QDate& endDate(void) const { return m_endDate; } + const TQDate& endDate(void) const { return m_endDate; } /** * Simple get method that returns true if the transaction should be @@ -212,43 +212,43 @@ public: /** * Simple method that returns the schedules last payment. If the - * schedule has never been executed, QDate() will be returned. + * schedule has never been executed, TQDate() will be returned. * - * @return QDate The last payment for the schedule. + * @return TQDate The last payment for the schedule. */ - const QDate& lastPayment(void) const { return m_lastPayment; } + const TQDate& lastPayment(void) const { return m_lastPayment; } /** * Simple method that returns the next due date for the schedule. * - * @return reference to QDate containing the next due date. + * @return reference to TQDate containing the next due date. * * @note The date returned can represent a value that is past * a possible end of the schedule. Make sure to consider * the return value of isFinished() when using the value returned. */ - const QDate& nextDueDate(void) const; + const TQDate& nextDueDate(void) const; /** * This method adjusts returns the next due date adjusted * according to the rules specified by the schedule's weekend option. * - * @return QDate containing the adjusted next due date. If the + * @return TQDate containing the adjusted next due date. If the * schedule is finished (@sa isFinished()) then the method - * returns an invalid QDate. + * returns an invalid TQDate. * * @sa weekendOption() * @sa adjustedDate() */ - QDate adjustedNextDueDate(void) const; + TQDate adjustedNextDueDate(void) const; /** * This method adjusts returns the date adjusted according to the * rules specified by the schedule's weekend option. * - * @return QDate containing the adjusted date. + * @return TQDate containing the adjusted date. */ - QDate adjustedDate(QDate date, weekendOptionE option) const; + TQDate adjustedDate(TQDate date, weekendOptionE option) const; /** * Get the weekendOption that determines how the schedule check code @@ -296,7 +296,7 @@ public: * @param date The new start date. * @return none */ - void setStartDate(const QDate& date); + void setStartDate(const TQDate& date); /** * Simple method that sets the payment type for the schedule. @@ -330,7 +330,7 @@ public: * @param date The new end date. * @return none */ - void setEndDate(const QDate& date); + void setEndDate(const TQDate& date); /** * Simple set method to set whether this transaction should be automatically @@ -348,7 +348,7 @@ public: * @param date The next payment date. * @return none */ - void setNextDueDate(const QDate& date); + void setNextDueDate(const TQDate& date); /** * Simple set method to set the schedule's last payment. If @@ -360,7 +360,7 @@ public: * @param date The last payment date. * @return none */ - void setLastPayment(const QDate& date); + void setLastPayment(const TQDate& date); /** * Set the weekendOption that determines how the schedule check code @@ -404,12 +404,12 @@ public: * @param refDate The reference date from which the next payment * date will be calculated (defaults to current date) * - * @return QDate The adjusted date the next payment is due. This date is + * @return TQDate The adjusted date the next payment is due. This date is * always past @a refDate. In case of an error or if there - * are no more payments then an empty/invalid QDate() will + * are no more payments then an empty/invalid TQDate() will * be returned. */ - QDate adjustedNextPayment(const QDate& refDate = QDate::currentDate()) const; + TQDate adjustedNextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; /** * Calculates the date of the next payment. @@ -417,12 +417,12 @@ public: * @param refDate The reference date from which the next payment * date will be calculated (defaults to current date) * - * @return QDate The date the next payment is due. This date is + * @return TQDate The date the next payment is due. This date is * always past @a refDate. In case of an error or - * if there is no more payments then an empty/invalid QDate() + * if there is no more payments then an empty/invalid TQDate() * will be returned. */ - QDate nextPayment(const QDate& refDate = QDate::currentDate()) const; + TQDate nextPayment(const TQDate& refDate = TQDate::tqcurrentDate()) const; /** * Calculates the dates of the payment over a certain period of time. @@ -431,16 +431,16 @@ public: * * @param startDate The start date for the range calculations * @param endDate The end date for the range calculations. - * @return QValueList<QDate> The dates on which the payments are due. + * @return TQValueList<TQDate> The dates on which the payments are due. */ - QValueList<QDate> paymentDates(const QDate& startDate, const QDate& endDate) const; + TQValueList<TQDate> paymentDates(const TQDate& startDate, const TQDate& endDate) const; /** * Returns the instances name * * @return The name */ - const QString& name(void) const { return m_name; } + const TQString& name(void) const { return m_name; } /** * Changes the instance name @@ -448,7 +448,7 @@ public: * @param nm The new name * @return none */ - void setName(const QString& nm); + void setName(const TQString& nm); bool operator ==(const MyMoneySchedule& right) const; bool operator !=(const MyMoneySchedule& right) const { return ! operator==(right); } @@ -457,15 +457,15 @@ public: MyMoneyAccount account(int cnt = 1) const; MyMoneyAccount transferAccount(void) const { return account(2); }; - QDate dateAfter(int transactions) const; + TQDate dateAfter(int transactions) const; bool isOverdue() const; bool isFinished() const; - bool hasRecordedPayment(const QDate&) const; - void recordPayment(const QDate&); - QValueList<QDate> recordedPayments(void) const { return m_recordedPayments; } + bool hasRecordedPayment(const TQDate&) const; + void recordPayment(const TQDate&); + TQValueList<TQDate> recordedPayments(void) const { return m_recordedPayments; } - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -476,14 +476,14 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * Returns the human-readable format of Schedule's occurence * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - QString occurenceToString() const; + TQString occurenceToString() const; /** * This method is used to convert the occurence type from it's @@ -492,9 +492,9 @@ public: * @param type numerical representation of the MyMoneySchedule * occurence type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurenceToString(occurenceE type); + static TQString occurenceToString(occurenceE type); /** * This method is used to convert a multiplier and base occurence type @@ -505,9 +505,9 @@ public: * @param mult occurence multiplier * @param type occurence period * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurenceToString(int mult, occurenceE type); + static TQString occurenceToString(int mult, occurenceE type); /** * This method is used to convert an occurence period from @@ -516,9 +516,9 @@ public: * @param type numerical representation of the MyMoneySchedule * occurence type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString occurencePeriodToString(occurenceE type); + static TQString occurencePeriodToString(occurenceE type); /** * This method is used to convert the payment type from it's @@ -527,9 +527,9 @@ public: * @param paymentType numerical representation of the MyMoneySchedule * payment type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); + static TQString paymentMethodToString(MyMoneySchedule::paymentTypeE paymentType); /** * This method is used to convert the schedule weekend option from it's @@ -538,9 +538,9 @@ public: * @param weekendOption numerical representation of the MyMoneySchedule * weekend option * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); + static TQString weekendOptionToString(MyMoneySchedule::weekendOptionE weekendOption); /** * This method is used to convert the schedule type from it's @@ -549,9 +549,9 @@ public: * @param type numerical representation of the MyMoneySchedule * schedule type * - * @return QString representing the human readable format + * @return TQString representing the human readable format */ - static QString scheduleTypeToString(MyMoneySchedule::typeE type); + static TQString scheduleTypeToString(MyMoneySchedule::typeE type); int variation(void) const; void setVariation(int var); @@ -600,10 +600,10 @@ public: * This method is used to convert the occurence type from the * human readable form into it's internal representation. * - * @param text reference to QString representing the human readable format + * @param text reference to TQString representing the human readable format * @return numerical representation of the occurence */ - static MyMoneySchedule::occurenceE stringToOccurence(const QString& text); + static MyMoneySchedule::occurenceE stringToOccurence(const TQString& text); private: /** @@ -612,9 +612,9 @@ private: * in m_startDate. It is internally used when calculating * the payment dates over several periods. * - * @param date reference to QDate object to be checked and adjusted + * @param date reference to TQDate object to be checked and adjusted */ - void fixDate(QDate& date) const; + void fixDate(TQDate& date) const; /** * Simple method that sets the transaction for the schedule. @@ -648,9 +648,9 @@ private: * @param date The date * @param mult The number of half months to add. Default is 1. * - * @return QDate date with mult half months added + * @return TQDate date with mult half months added */ - QDate addHalfMonths( QDate date, int mult = 1 ) const; + TQDate addHalfMonths( TQDate date, int mult = 1 ) const; private: /// Its occurence @@ -663,7 +663,7 @@ private: typeE m_type; /// The date the schedule commences - QDate m_startDate; + TQDate m_startDate; /// The payment type paymentTypeE m_paymentType; @@ -675,19 +675,19 @@ private: MyMoneyTransaction m_transaction; /// The last transaction date if the schedule does end at a fixed date - QDate m_endDate; + TQDate m_endDate; /// Enter the transaction into the register automatically bool m_autoEnter; /// Internal date used for calculations - QDate m_lastPayment; + TQDate m_lastPayment; /// The name - QString m_name; + TQString m_name; /// The recorded payments - QValueList<QDate> m_recordedPayments; + TQValueList<TQDate> m_recordedPayments; /// The weekend option weekendOptionE m_weekendOption; diff --git a/kmymoney2/mymoney/mymoneyscheduletest.cpp b/kmymoney2/mymoney/mymoneyscheduletest.cpp index 0a4a380..07b3cc6 100644 --- a/kmymoney2/mymoney/mymoneyscheduletest.cpp +++ b/kmymoney2/mymoney/mymoneyscheduletest.cpp @@ -55,8 +55,8 @@ void MyMoneyScheduleTest::testConstructor() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); @@ -64,7 +64,7 @@ void MyMoneyScheduleTest::testConstructor() { CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_WEEKLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 1 ); CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); - CPPUNIT_ASSERT(s.startDate() == QDate()); + CPPUNIT_ASSERT(s.startDate() == TQDate()); CPPUNIT_ASSERT(s.willEnd() == false); CPPUNIT_ASSERT(s.isFixed() == true); CPPUNIT_ASSERT(s.autoEnter() == true); @@ -82,8 +82,8 @@ void MyMoneyScheduleTest::testSetFunctions() { s.setType(MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(s.type() == MyMoneySchedule::TYPE_BILL); - s.setEndDate(QDate::currentDate()); - CPPUNIT_ASSERT(s.endDate() == QDate::currentDate()); + s.setEndDate(TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(s.endDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(s.willEnd() == true); } @@ -151,7 +151,7 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(2001, 1, 1), + TQDate(2001, 1, 1), false, true, true); @@ -160,7 +160,7 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_MONTHLY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(2001, 2, 1), + TQDate(2001, 2, 1), false, true, true); @@ -168,8 +168,8 @@ void MyMoneyScheduleTest::testAddSchedule() MyMoneySchedule s3( "s3", MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_YEARLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(2001, 3, 1), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(2001, 3, 1), false, true, true); @@ -216,7 +216,7 @@ void MyMoneyScheduleTest::testAnyScheduled() MyMoneySchedule::STYPE_MANUALDEPOSIT)); CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, - MyMoneySchedule::STYPE_WRITECHEQUE)); + MyMoneySchedule::STYPE_WRITECHETQUE)); // Failures CPPUNIT_ASSERT(m->anyScheduled("A000001", MyMoneySchedule::TYPE_BILL, @@ -229,18 +229,18 @@ void MyMoneyScheduleTest::testOverdue() MyMoneySchedule sch_overdue; MyMoneySchedule sch_intime; - // the following checks only work correctly, if currentDate() is + // the following checks only work correctly, if tqcurrentDate() is // between the 1st and 27th. If it is between 28th and 31st // we don't perform them. Note: this should be fixed. - if(QDate::currentDate().day() > 27 || QDate::currentDate().day() == 1) { + if(TQDate::tqcurrentDate().day() > 27 || TQDate::tqcurrentDate().day() == 1) { std::cout << std::endl << "testOverdue() skipped because current day is between 28th and 2nd" << std::endl; return; } - QDate startDate = QDate::currentDate().addDays(-1).addMonths(-23); - QDate lastPaymentDate = QDate::currentDate().addDays(-1).addMonths(-1); + TQDate startDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-23); + TQDate lastPaymentDate = TQDate::tqcurrentDate().addDays(-1).addMonths(-1); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"0\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"8\" endDate=\"\" type=\"5\" id=\"SCH0002\" name=\"A Name\" fixed=\"0\" occurenceMultiplier=\"1\" occurence=\"32\" >\n" @@ -258,16 +258,16 @@ void MyMoneyScheduleTest::testOverdue() " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n"); - QString ref_overdue = ref.arg(startDate.toString(Qt::ISODate)) - .arg(lastPaymentDate.toString(Qt::ISODate)) - .arg(lastPaymentDate.toString(Qt::ISODate)); + TQString ref_overdue = ref.tqarg(startDate.toString(Qt::ISODate)) + .tqarg(lastPaymentDate.toString(Qt::ISODate)) + .tqarg(lastPaymentDate.toString(Qt::ISODate)); - QString ref_intime = ref.arg(startDate.addDays(1).toString(Qt::ISODate)) - .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate)) - .arg(lastPaymentDate.addDays(1).toString(Qt::ISODate)); + TQString ref_intime = ref.tqarg(startDate.addDays(1).toString(Qt::ISODate)) + .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate)) + .tqarg(lastPaymentDate.addDays(1).toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; // std::cout << ref_intime << std::endl; try { @@ -318,7 +318,7 @@ void MyMoneyScheduleTest::testGetSchedule() CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 1); CPPUNIT_ASSERT(s.paymentType() == MyMoneySchedule::STYPE_MANUALDEPOSIT); - CPPUNIT_ASSERT(s.startDate() == QDate(2001, 2, 1)); + CPPUNIT_ASSERT(s.startDate() == TQDate(2001, 2, 1)); CPPUNIT_ASSERT(s.willEnd() == false); CPPUNIT_ASSERT(s.isFixed() == true); CPPUNIT_ASSERT(s.autoEnter() == true); @@ -344,7 +344,7 @@ void MyMoneyScheduleTest::testGetScheduled() try { - QValueList<QString> testList; + TQValueList<TQString> testList; testList = m->getScheduled("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -370,7 +370,7 @@ void MyMoneyScheduleTest::testGetScheduled() CPPUNIT_ASSERT(testList.size() == 1); CPPUNIT_ASSERT(testList[0] == "SCHED00002"); - testList = m->getScheduled("A000001", QDate(2001, 1, 1), QDate(2001, 2, 1)); + testList = m->getScheduled("A000001", TQDate(2001, 1, 1), TQDate(2001, 2, 1)); CPPUNIT_ASSERT(testList.size() == 2); CPPUNIT_ASSERT(testList[0] == "SCHED00001"); CPPUNIT_ASSERT(testList[1] == "SCHED00002"); @@ -392,7 +392,7 @@ void MyMoneyScheduleTest::testGetOverdue() try { - QValueList<QString> testList; + TQValueList<TQString> testList; testList = m->getOverdue("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -433,7 +433,7 @@ void MyMoneyScheduleTest::testNextPayment() */ { MyMoneySchedule sch; - QString future_sched = QString( + TQString future_sched = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" "<SCHEDULED_TX startDate=\"2007-02-17\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH000058\" name=\"Car Tax\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"16384\" >\n" @@ -449,16 +449,16 @@ void MyMoneyScheduleTest::testNextPayment() "</SCHEDULE-CONTAINER>\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(future_sched); node = doc.documentElement().firstChild().toElement(); try { sch = MyMoneySchedule(node); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,14)) == QDate(2007,2,17)); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,17)) == QDate(2008,2,17)); - CPPUNIT_ASSERT(sch.nextPayment(QDate(2007,2,18)) == QDate(2008,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,14)) == TQDate(2007,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,17)) == TQDate(2008,2,17)); + CPPUNIT_ASSERT(sch.nextPayment(TQDate(2007,2,18)) == TQDate(2008,2,17)); } catch(MyMoneyException *e) { delete e; @@ -474,9 +474,9 @@ void MyMoneyScheduleTest::testNextPayment() MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002"); MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003"); - QDate nextPayment1 = s1.nextPayment(); - QDate nextPayment2 = s2.nextPayment(); - QDate nextPayment3 = s3.nextPayment(); + TQDate nextPayment1 = s1.nextPayment(); + TQDate nextPayment2 = s2.nextPayment(); + TQDate nextPayment3 = s3.nextPayment(); CPPUNIT_ASSERT(nextPayment1.year() != 1900); CPPUNIT_ASSERT(nextPayment2.year() != 1900); @@ -494,148 +494,148 @@ void MyMoneyScheduleTest::testAddHalfMonths() // addHalfMonths is private // Test a Schedule with occurence OCCUR_EVERYHALFMONTH using nextPayment MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); - QString format("yyyy-MM-dd"); + TQString format("yyyy-MM-dd"); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-16" ); - s.setNextDueDate(QDate(2007, 1, 2)); + s.setNextDueDate(TQDate(2007, 1, 2)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-17" ); - s.setNextDueDate(QDate(2007, 1, 3)); + s.setNextDueDate(TQDate(2007, 1, 3)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-18" ); - s.setNextDueDate(QDate(2007, 1, 4)); + s.setNextDueDate(TQDate(2007, 1, 4)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-19" ); - s.setNextDueDate(QDate(2007, 1, 5)); + s.setNextDueDate(TQDate(2007, 1, 5)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-20" ); - s.setNextDueDate(QDate(2007, 1, 6)); + s.setNextDueDate(TQDate(2007, 1, 6)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-21" ); - s.setNextDueDate(QDate(2007, 1, 7)); + s.setNextDueDate(TQDate(2007, 1, 7)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-22" ); - s.setNextDueDate(QDate(2007, 1, 8)); + s.setNextDueDate(TQDate(2007, 1, 8)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-23" ); - s.setNextDueDate(QDate(2007, 1, 9)); + s.setNextDueDate(TQDate(2007, 1, 9)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-24" ); - s.setNextDueDate(QDate(2007, 1, 10)); + s.setNextDueDate(TQDate(2007, 1, 10)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-25" ); - s.setNextDueDate(QDate(2007, 1, 11)); + s.setNextDueDate(TQDate(2007, 1, 11)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-26" ); - s.setNextDueDate(QDate(2007, 1, 12)); + s.setNextDueDate(TQDate(2007, 1, 12)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-27" ); - s.setNextDueDate(QDate(2007, 1, 13)); + s.setNextDueDate(TQDate(2007, 1, 13)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-28" ); - s.setNextDueDate(QDate(2007, 1, 14)); + s.setNextDueDate(TQDate(2007, 1, 14)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-29" ); // 15 -> Last Day - s.setNextDueDate(QDate(2007, 1, 15)); + s.setNextDueDate(TQDate(2007, 1, 15)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-01-31" ); - s.setNextDueDate(QDate(2007, 1, 16)); + s.setNextDueDate(TQDate(2007, 1, 16)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-01" ); - s.setNextDueDate(QDate(2007, 1, 17)); + s.setNextDueDate(TQDate(2007, 1, 17)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-02" ); - s.setNextDueDate(QDate(2007, 1, 18)); + s.setNextDueDate(TQDate(2007, 1, 18)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-03" ); - s.setNextDueDate(QDate(2007, 1, 19)); + s.setNextDueDate(TQDate(2007, 1, 19)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-04" ); - s.setNextDueDate(QDate(2007, 1, 20)); + s.setNextDueDate(TQDate(2007, 1, 20)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-05" ); - s.setNextDueDate(QDate(2007, 1, 21)); + s.setNextDueDate(TQDate(2007, 1, 21)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-06" ); - s.setNextDueDate(QDate(2007, 1, 22)); + s.setNextDueDate(TQDate(2007, 1, 22)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-07" ); - s.setNextDueDate(QDate(2007, 1, 23)); + s.setNextDueDate(TQDate(2007, 1, 23)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-08" ); - s.setNextDueDate(QDate(2007, 1, 24)); + s.setNextDueDate(TQDate(2007, 1, 24)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-09" ); - s.setNextDueDate(QDate(2007, 1, 25)); + s.setNextDueDate(TQDate(2007, 1, 25)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-10" ); - s.setNextDueDate(QDate(2007, 1, 26)); + s.setNextDueDate(TQDate(2007, 1, 26)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-11" ); - s.setNextDueDate(QDate(2007, 1, 27)); + s.setNextDueDate(TQDate(2007, 1, 27)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-12" ); - s.setNextDueDate(QDate(2007, 1, 28)); + s.setNextDueDate(TQDate(2007, 1, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-13" ); - s.setNextDueDate(QDate(2007, 1, 29)); + s.setNextDueDate(TQDate(2007, 1, 29)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-14" ); // 30th,31st -> 15th - s.setNextDueDate(QDate(2007, 1, 30)); + s.setNextDueDate(TQDate(2007, 1, 30)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" ); - s.setNextDueDate(QDate(2007, 1, 31)); + s.setNextDueDate(TQDate(2007, 1, 31)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-02-15" ); // 30th (last day) - s.setNextDueDate(QDate(2007, 4, 30)); + s.setNextDueDate(TQDate(2007, 4, 30)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2007-05-15" ); // 28th of February (Last day): to 15th - s.setNextDueDate(QDate(1900, 2, 28)); + s.setNextDueDate(TQDate(1900, 2, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "1900-03-15" ); // 28th of February (Leap year): to 13th - s.setNextDueDate(QDate(2000, 2, 28)); + s.setNextDueDate(TQDate(2000, 2, 28)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-13" ); // 29th of February (Leap year) - s.setNextDueDate(QDate(2000, 2, 29)); + s.setNextDueDate(TQDate(2000, 2, 29)); CPPUNIT_ASSERT( s.nextPayment(s.nextDueDate()).toString(format) == "2000-03-15" ); // Add multiple transactions - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-16" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-01" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-16" ); - s.setStartDate(QDate(2007, 1, 12)); + s.setStartDate(TQDate(2007, 1, 12)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-27" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-12" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-27" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-12" ); - s.setStartDate(QDate(2007, 1, 13)); + s.setStartDate(TQDate(2007, 1, 13)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-28" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-13" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 14)); + s.setStartDate(TQDate(2007, 1, 14)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-29" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-14" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 15)); + s.setStartDate(TQDate(2007, 1, 15)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-01-31" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-15" ); - s.setStartDate(QDate(2007, 1, 16)); + s.setStartDate(TQDate(2007, 1, 16)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-01" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-16" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-01" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-16" ); - s.setStartDate(QDate(2007, 1, 27)); + s.setStartDate(TQDate(2007, 1, 27)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-12" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-27" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-12" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-27" ); - s.setStartDate(QDate(2007, 1, 28)); + s.setStartDate(TQDate(2007, 1, 28)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-13" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 29)); + s.setStartDate(TQDate(2007, 1, 29)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-14" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 30)); + s.setStartDate(TQDate(2007, 1, 30)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 1, 31)); + s.setStartDate(TQDate(2007, 1, 31)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-02-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-02-28" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-03-15" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-03-31" ); - s.setStartDate(QDate(2007, 4, 29)); + s.setStartDate(TQDate(2007, 4, 29)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-14" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-29" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-14" ); CPPUNIT_ASSERT( s.dateAfter(5).toString(format) == "2007-06-29" ); - s.setStartDate(QDate(2007, 4, 30)); + s.setStartDate(TQDate(2007, 4, 30)); CPPUNIT_ASSERT( s.dateAfter(2).toString(format) == "2007-05-15" ); CPPUNIT_ASSERT( s.dateAfter(3).toString(format) == "2007-05-31" ); CPPUNIT_ASSERT( s.dateAfter(4).toString(format) == "2007-06-15" ); @@ -645,7 +645,7 @@ void MyMoneyScheduleTest::testAddHalfMonths() void MyMoneyScheduleTest::testPaymentDates() { MyMoneySchedule sch; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" @@ -663,23 +663,23 @@ void MyMoneyScheduleTest::testPaymentDates() "</SCHEDULE-CONTAINER>\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); - QDate startDate(2006,1,28); - QDate endDate(2006,5,30); + TQDate startDate(2006,1,28); + TQDate endDate(2006,5,30); try { sch = MyMoneySchedule(node); - QDate nextPayment = sch.nextPayment(startDate); - QValueList<QDate> list = sch.paymentDates(nextPayment, endDate); + TQDate nextPayment = sch.nextPayment(startDate); + TQValueList<TQDate> list = sch.paymentDates(nextPayment, endDate); CPPUNIT_ASSERT(list.count() == 3); - CPPUNIT_ASSERT(list[0] == QDate(2006,2,28)); - CPPUNIT_ASSERT(list[1] == QDate(2006,3,31)); + CPPUNIT_ASSERT(list[0] == TQDate(2006,2,28)); + CPPUNIT_ASSERT(list[1] == TQDate(2006,3,31)); // Would fall on a Sunday so gets moved back to 28th. - CPPUNIT_ASSERT(list[2] == QDate(2006,4,28)); + CPPUNIT_ASSERT(list[2] == TQDate(2006,4,28)); // Add tests for each possible occurence. // Check how paymentDates is meant to work @@ -692,7 +692,7 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list[0] == QDate(2009,1,1)); + CPPUNIT_ASSERT(list[0] == TQDate(2009,1,1)); // MyMoneySchedule::OCCUR_DAILY sch.setOccurence(MyMoneySchedule::OCCUR_DAILY); startDate.setYMD(2009,1,1); @@ -701,20 +701,20 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 1)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 2)); // Would fall on Saturday so gets moved to 2nd. - CPPUNIT_ASSERT(list[2] == QDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 1, 2)); // Would fall on Sunday so gets moved to 2nd. - CPPUNIT_ASSERT(list[3] == QDate(2009, 1, 2)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 1, 5)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 1, 5)); // MyMoneySchedule::OCCUR_DAILY with multiplier 2 sch.setOccurenceMultiplier(2); list = sch.paymentDates(startDate.addDays(1),endDate); CPPUNIT_ASSERT(list.count() == 2); // Would fall on Sunday so gets moved to 2nd. - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 2)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1, 5)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 2)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1, 5)); sch.setOccurenceMultiplier(1); // MyMoneySchedule::OCCUR_WEEKLY sch.setOccurence(MyMoneySchedule::OCCUR_WEEKLY); @@ -724,11 +724,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 1, 6)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 1,13)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 1,20)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 1,27)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 2, 3)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 1, 6)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 1,13)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 1,20)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 1,27)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 2, 3)); // MyMoneySchedule::OCCUR_EVERYOTHERWEEK sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERWEEK); startDate.setYMD(2009,2,5); @@ -737,11 +737,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 2, 5)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 2,19)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 3, 5)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 3,19)); - CPPUNIT_ASSERT(list[4] == QDate(2009, 4, 2)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 2, 5)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 2,19)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 3, 5)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 3,19)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 4, 2)); // MyMoneySchedule::OCCUR_FORTNIGHTLY sch.setOccurence(MyMoneySchedule::OCCUR_FORTNIGHTLY); startDate.setYMD(2009,4,4); @@ -753,13 +753,13 @@ void MyMoneyScheduleTest::testPaymentDates() // First one would fall on a Saturday and would get moved // to 3rd which is before start date so is not in list. // Would fall on a Saturday so gets moved to 17th. - CPPUNIT_ASSERT(list[0] == QDate(2009, 4,17)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 4,17)); // Would fall on a Saturday so gets moved to 1st. - CPPUNIT_ASSERT(list[1] == QDate(2009, 5, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 5, 1)); // Would fall on a Saturday so gets moved to 15th. - CPPUNIT_ASSERT(list[2] == QDate(2009, 5,15)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 5,15)); // Would fall on a Saturday so gets moved to 29th. - CPPUNIT_ASSERT(list[3] == QDate(2009, 5,29)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 5,29)); // MyMoneySchedule::OCCUR_EVERYHALFMONTH sch.setOccurence(MyMoneySchedule::OCCUR_EVERYHALFMONTH); startDate.setYMD(2009,6,1); @@ -768,12 +768,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 6, 1)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 6,16)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 7, 1)); - CPPUNIT_ASSERT(list[3] == QDate(2009, 7,16)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 6, 1)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 6,16)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 7, 1)); + CPPUNIT_ASSERT(list[3] == TQDate(2009, 7,16)); // Would fall on a Saturday so gets moved to 31st. - CPPUNIT_ASSERT(list[4] == QDate(2009, 7, 31)); + CPPUNIT_ASSERT(list[4] == TQDate(2009, 7, 31)); // MyMoneySchedule::OCCUR_EVERYTHREEWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEWEEKS); startDate.setYMD(2009,8,12); @@ -782,11 +782,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009, 8,12)); - CPPUNIT_ASSERT(list[1] == QDate(2009, 9, 2)); - CPPUNIT_ASSERT(list[2] == QDate(2009, 9,23)); - CPPUNIT_ASSERT(list[3] == QDate(2009,10,14)); - CPPUNIT_ASSERT(list[4] == QDate(2009,11, 4)); + CPPUNIT_ASSERT(list[0] == TQDate(2009, 8,12)); + CPPUNIT_ASSERT(list[1] == TQDate(2009, 9, 2)); + CPPUNIT_ASSERT(list[2] == TQDate(2009, 9,23)); + CPPUNIT_ASSERT(list[3] == TQDate(2009,10,14)); + CPPUNIT_ASSERT(list[4] == TQDate(2009,11, 4)); // MyMoneySchedule::OCCUR_EVERYFOURWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURWEEKS); startDate.setYMD(2009,11,13); @@ -795,11 +795,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2009,11,13)); - CPPUNIT_ASSERT(list[1] == QDate(2009,12,11)); - CPPUNIT_ASSERT(list[2] == QDate(2010, 1, 8)); - CPPUNIT_ASSERT(list[3] == QDate(2010, 2, 5)); - CPPUNIT_ASSERT(list[4] == QDate(2010, 3, 5)); + CPPUNIT_ASSERT(list[0] == TQDate(2009,11,13)); + CPPUNIT_ASSERT(list[1] == TQDate(2009,12,11)); + CPPUNIT_ASSERT(list[2] == TQDate(2010, 1, 8)); + CPPUNIT_ASSERT(list[3] == TQDate(2010, 2, 5)); + CPPUNIT_ASSERT(list[4] == TQDate(2010, 3, 5)); // MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHIRTYDAYS); startDate.setYMD(2010,3,19); @@ -808,13 +808,13 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2010, 3,19)); + CPPUNIT_ASSERT(list[0] == TQDate(2010, 3,19)); // Would fall on a Sunday so gets moved to 16th. - CPPUNIT_ASSERT(list[1] == QDate(2010, 4,16)); - CPPUNIT_ASSERT(list[2] == QDate(2010, 5,18)); - CPPUNIT_ASSERT(list[3] == QDate(2010, 6,17)); + CPPUNIT_ASSERT(list[1] == TQDate(2010, 4,16)); + CPPUNIT_ASSERT(list[2] == TQDate(2010, 5,18)); + CPPUNIT_ASSERT(list[3] == TQDate(2010, 6,17)); // Would fall on a Saturday so gets moved to 16th. - CPPUNIT_ASSERT(list[4] == QDate(2010, 7,16)); + CPPUNIT_ASSERT(list[4] == TQDate(2010, 7,16)); // MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS); startDate.setYMD(2010,7,26); @@ -823,11 +823,11 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2010, 7,26)); - CPPUNIT_ASSERT(list[1] == QDate(2010, 9,20)); - CPPUNIT_ASSERT(list[2] == QDate(2010,11,15)); - CPPUNIT_ASSERT(list[3] == QDate(2011, 1,10)); - CPPUNIT_ASSERT(list[4] == QDate(2011, 3, 7)); + CPPUNIT_ASSERT(list[0] == TQDate(2010, 7,26)); + CPPUNIT_ASSERT(list[1] == TQDate(2010, 9,20)); + CPPUNIT_ASSERT(list[2] == TQDate(2010,11,15)); + CPPUNIT_ASSERT(list[3] == TQDate(2011, 1,10)); + CPPUNIT_ASSERT(list[4] == TQDate(2011, 3, 7)); // MyMoneySchedule::OCCUR_EVERYOTHERMONTH sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH); startDate.setYMD(2011,3,14); @@ -836,12 +836,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2011, 3,14)); + CPPUNIT_ASSERT(list[0] == TQDate(2011, 3,14)); // Would fall on a Saturday so gets moved to 13th. - CPPUNIT_ASSERT(list[1] == QDate(2011, 5,13)); - CPPUNIT_ASSERT(list[2] == QDate(2011, 7,14)); - CPPUNIT_ASSERT(list[3] == QDate(2011, 9,14)); - CPPUNIT_ASSERT(list[4] == QDate(2011,11,14)); + CPPUNIT_ASSERT(list[1] == TQDate(2011, 5,13)); + CPPUNIT_ASSERT(list[2] == TQDate(2011, 7,14)); + CPPUNIT_ASSERT(list[3] == TQDate(2011, 9,14)); + CPPUNIT_ASSERT(list[4] == TQDate(2011,11,14)); // MyMoneySchedule::OCCUR_EVERYTHREEMONTHS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); startDate.setYMD(2011,11,15); @@ -850,24 +850,24 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2011,11,15)); - CPPUNIT_ASSERT(list[1] == QDate(2012, 2,15)); - CPPUNIT_ASSERT(list[2] == QDate(2012, 5,15)); - CPPUNIT_ASSERT(list[3] == QDate(2012, 8,15)); - CPPUNIT_ASSERT(list[4] == QDate(2012,11,15)); - // MyMoneySchedule::OCCUR_QUARTERLY - sch.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); + CPPUNIT_ASSERT(list[0] == TQDate(2011,11,15)); + CPPUNIT_ASSERT(list[1] == TQDate(2012, 2,15)); + CPPUNIT_ASSERT(list[2] == TQDate(2012, 5,15)); + CPPUNIT_ASSERT(list[3] == TQDate(2012, 8,15)); + CPPUNIT_ASSERT(list[4] == TQDate(2012,11,15)); + // MyMoneySchedule::OCCUR_TQUARTERLY + sch.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); startDate.setYMD(2012,11,20); endDate.setYMD(2013,11,23); sch.setStartDate(startDate); sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2012,11,20)); - CPPUNIT_ASSERT(list[1] == QDate(2013, 2,20)); - CPPUNIT_ASSERT(list[2] == QDate(2013, 5,20)); - CPPUNIT_ASSERT(list[3] == QDate(2013, 8,20)); - CPPUNIT_ASSERT(list[4] == QDate(2013,11,20)); + CPPUNIT_ASSERT(list[0] == TQDate(2012,11,20)); + CPPUNIT_ASSERT(list[1] == TQDate(2013, 2,20)); + CPPUNIT_ASSERT(list[2] == TQDate(2013, 5,20)); + CPPUNIT_ASSERT(list[3] == TQDate(2013, 8,20)); + CPPUNIT_ASSERT(list[4] == TQDate(2013,11,20)); // MyMoneySchedule::OCCUR_EVERYFOURMONTHS sch.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS); startDate.setYMD(2013,11,21); @@ -876,12 +876,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2013,11,21)); - CPPUNIT_ASSERT(list[1] == QDate(2014, 3,21)); - CPPUNIT_ASSERT(list[2] == QDate(2014, 7,21)); - CPPUNIT_ASSERT(list[3] == QDate(2014,11,21)); + CPPUNIT_ASSERT(list[0] == TQDate(2013,11,21)); + CPPUNIT_ASSERT(list[1] == TQDate(2014, 3,21)); + CPPUNIT_ASSERT(list[2] == TQDate(2014, 7,21)); + CPPUNIT_ASSERT(list[3] == TQDate(2014,11,21)); // Would fall on a Saturday so gets moved to 20th. - CPPUNIT_ASSERT(list[4] == QDate(2015, 3,20)); + CPPUNIT_ASSERT(list[4] == TQDate(2015, 3,20)); // MyMoneySchedule::OCCUR_TWICEYEARLY sch.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY); startDate.setYMD(2015, 3,22); @@ -892,10 +892,10 @@ void MyMoneyScheduleTest::testPaymentDates() CPPUNIT_ASSERT(list.count() == 4); // First date would fall on a Sunday which would get moved // to 20th which is before start date so not in list. - CPPUNIT_ASSERT(list[0] == QDate(2015, 9,22)); - CPPUNIT_ASSERT(list[1] == QDate(2016, 3,22)); - CPPUNIT_ASSERT(list[2] == QDate(2016, 9,22)); - CPPUNIT_ASSERT(list[3] == QDate(2017, 3,22)); + CPPUNIT_ASSERT(list[0] == TQDate(2015, 9,22)); + CPPUNIT_ASSERT(list[1] == TQDate(2016, 3,22)); + CPPUNIT_ASSERT(list[2] == TQDate(2016, 9,22)); + CPPUNIT_ASSERT(list[3] == TQDate(2017, 3,22)); // MyMoneySchedule::OCCUR_YEARLY sch.setOccurence(MyMoneySchedule::OCCUR_YEARLY); startDate.setYMD(2017, 3,23); @@ -904,12 +904,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2017, 3,23)); - CPPUNIT_ASSERT(list[1] == QDate(2018, 3,23)); + CPPUNIT_ASSERT(list[0] == TQDate(2017, 3,23)); + CPPUNIT_ASSERT(list[1] == TQDate(2018, 3,23)); // Would fall on a Saturday so gets moved to 22nd. - CPPUNIT_ASSERT(list[2] == QDate(2019, 3,22)); - CPPUNIT_ASSERT(list[3] == QDate(2020, 3,23)); - CPPUNIT_ASSERT(list[4] == QDate(2021, 3,23)); + CPPUNIT_ASSERT(list[2] == TQDate(2019, 3,22)); + CPPUNIT_ASSERT(list[3] == TQDate(2020, 3,23)); + CPPUNIT_ASSERT(list[4] == TQDate(2021, 3,23)); // MyMoneySchedule::OCCUR_EVERYOTHERYEAR sch.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERYEAR); startDate.setYMD(2021, 3,24); @@ -918,12 +918,12 @@ void MyMoneyScheduleTest::testPaymentDates() sch.setNextDueDate(startDate); list = sch.paymentDates(startDate,endDate); CPPUNIT_ASSERT(list.count() == 5); - CPPUNIT_ASSERT(list[0] == QDate(2021, 3,24)); - CPPUNIT_ASSERT(list[1] == QDate(2023, 3,24)); - CPPUNIT_ASSERT(list[2] == QDate(2025, 3,24)); - CPPUNIT_ASSERT(list[3] == QDate(2027, 3,24)); + CPPUNIT_ASSERT(list[0] == TQDate(2021, 3,24)); + CPPUNIT_ASSERT(list[1] == TQDate(2023, 3,24)); + CPPUNIT_ASSERT(list[2] == TQDate(2025, 3,24)); + CPPUNIT_ASSERT(list[3] == TQDate(2027, 3,24)); // Would fall on a Saturday so gets moved to 23rd. - CPPUNIT_ASSERT(list[4] == QDate(2029, 3,23)); + CPPUNIT_ASSERT(list[4] == TQDate(2029, 3,23)); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -938,9 +938,9 @@ void MyMoneyScheduleTest::testPaymentDates() MyMoneySchedule s2 = m->getSchedule("A000001", "SCHED00002"); MyMoneySchedule s3 = m->getSchedule("A000001", "SCHED00003"); - QValueList<QDate> payments1 = s1.paymentDates(QDate(2001, 1, 1), QDate(2001, 2, 1)); - QValueList<QDate> payments2 = s2.paymentDates(QDate(2001, 2, 1), QDate(2001, 6, 1)); - QValueList<QDate> payments3 = s3.paymentDates(QDate(2001, 3, 1), QDate(2005, 3, 1)); + TQValueList<TQDate> payments1 = s1.paymentDates(TQDate(2001, 1, 1), TQDate(2001, 2, 1)); + TQValueList<TQDate> payments2 = s2.paymentDates(TQDate(2001, 2, 1), TQDate(2001, 6, 1)); + TQValueList<TQDate> payments3 = s3.paymentDates(TQDate(2001, 3, 1), TQDate(2005, 3, 1)); CPPUNIT_ASSERT(payments1.size() == 5); CPPUNIT_ASSERT(payments2.size() == 5); @@ -985,7 +985,7 @@ void MyMoneyScheduleTest::testRemoveSchedule() try { - QValueList<QString> testList; + TQValueList<TQString> testList; testList = m->getScheduled("A000001"); CPPUNIT_ASSERT(testList.size() == 3); @@ -1010,18 +1010,18 @@ void MyMoneyScheduleTest::testWriteXML() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 123, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate::currentDate(), - QDate(), + TQDate::tqcurrentDate(), + TQDate(), true, true); - sch.setLastPayment(QDate::currentDate()); - sch.recordPayment(QDate::currentDate()); + sch.setLastPayment(TQDate::tqcurrentDate()); + sch.recordPayment(TQDate::tqcurrentDate()); sch.setId("SCH0001"); MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -1047,12 +1047,12 @@ void MyMoneyScheduleTest::testWriteXML() { sch.setTransaction(t); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("SCHEDULE-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("SCHEDULE-CONTAINER"); doc.appendChild(el); sch.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0001\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"123\" occurence=\"4\" >\n" @@ -1070,9 +1070,9 @@ void MyMoneyScheduleTest::testWriteXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); CPPUNIT_ASSERT(doc.toString() == ref); } @@ -1080,7 +1080,7 @@ void MyMoneyScheduleTest::testWriteXML() { void MyMoneyScheduleTest::testReadXML() { MyMoneySchedule sch; - QString ref_ok1 = QString( + TQString ref_ok1 = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n" @@ -1098,13 +1098,13 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); // diff to ref_ok1 is that we now have an empty entrydate // in the transaction parameters - QString ref_ok2 = QString( + TQString ref_ok2 = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n" @@ -1122,11 +1122,11 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULE startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n" @@ -1144,12 +1144,12 @@ void MyMoneyScheduleTest::testReadXML() { " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -1167,13 +1167,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate()); - CPPUNIT_ASSERT(sch.endDate() == QDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1181,7 +1181,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1194,13 +1194,13 @@ void MyMoneyScheduleTest::testReadXML() { try { sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.id() == "SCH0002"); - CPPUNIT_ASSERT(sch.nextDueDate() == QDate::currentDate().addDays(7)); - CPPUNIT_ASSERT(sch.startDate() == QDate::currentDate()); - CPPUNIT_ASSERT(sch.endDate() == QDate()); + CPPUNIT_ASSERT(sch.nextDueDate() == TQDate::tqcurrentDate().addDays(7)); + CPPUNIT_ASSERT(sch.startDate() == TQDate::tqcurrentDate()); + CPPUNIT_ASSERT(sch.endDate() == TQDate()); CPPUNIT_ASSERT(sch.autoEnter() == true); CPPUNIT_ASSERT(sch.isFixed() == true); CPPUNIT_ASSERT(sch.weekendOption() == MyMoneySchedule::MoveNothing); - CPPUNIT_ASSERT(sch.lastPayment() == QDate::currentDate()); + CPPUNIT_ASSERT(sch.lastPayment() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(sch.paymentType() == MyMoneySchedule::STYPE_DIRECTDEBIT); CPPUNIT_ASSERT(sch.type() == MyMoneySchedule::TYPE_BILL); CPPUNIT_ASSERT(sch.name() == "A Name"); @@ -1208,7 +1208,7 @@ void MyMoneyScheduleTest::testReadXML() { CPPUNIT_ASSERT(sch.occurenceMultiplier() == 1); CPPUNIT_ASSERT(sch.nextDueDate() == sch.lastPayment().addDays(7)); CPPUNIT_ASSERT(sch.recordedPayments().count() == 1); - CPPUNIT_ASSERT(sch.recordedPayments()[0] == QDate::currentDate()); + CPPUNIT_ASSERT(sch.recordedPayments()[0] == TQDate::tqcurrentDate()); } catch(MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); @@ -1218,7 +1218,7 @@ void MyMoneyScheduleTest::testReadXML() { void MyMoneyScheduleTest::testHasReferenceTo() { MyMoneySchedule sch; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"1\" weekendOption=\"2\" lastPayment=\"%2\" paymentType=\"1\" endDate=\"\" type=\"1\" id=\"SCH0002\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"4\" >\n" @@ -1236,12 +1236,12 @@ void MyMoneyScheduleTest::testHasReferenceTo() " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)) - .arg(QDate::currentDate().toString(Qt::ISODate)); + ).tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)) + .tqarg(TQDate::tqcurrentDate().toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -1263,7 +1263,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() { MyMoneySchedule s; - QDate dueDate(2007,9,3); // start on a monday + TQDate dueDate(2007,9,3); // start on a monday for(int i = 0; i < 7; ++i) { s.setNextDueDate(dueDate); s.setWeekendOption(MyMoneySchedule::MoveNothing); @@ -1274,7 +1274,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() case 5: // saturday case 6: // sunday break; - CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,7)); + CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,7)); default: CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate); break; @@ -1284,7 +1284,7 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() switch(i) { case 5: // saturday case 6: // sunday - CPPUNIT_ASSERT(s.adjustedNextDueDate() == QDate(2007,9,10)); + CPPUNIT_ASSERT(s.adjustedNextDueDate() == TQDate(2007,9,10)); break; default: CPPUNIT_ASSERT(s.adjustedNextDueDate() == dueDate); @@ -1297,30 +1297,30 @@ void MyMoneyScheduleTest::testAdjustedNextDueDate() void MyMoneyScheduleTest::testModifyNextDueDate(void) { MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setOccurence(MyMoneySchedule::OCCUR_MONTHLY); s.setNextDueDate(s.startDate().addMonths(1)); s.setLastPayment(s.startDate()); - QValueList<QDate> dates; - dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1)); - CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,2,1)); + TQValueList<TQDate> dates; + dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1)); + CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,2,1)); CPPUNIT_ASSERT(dates.count() == 1); - CPPUNIT_ASSERT(dates[0] == QDate(2007,2,1)); + CPPUNIT_ASSERT(dates[0] == TQDate(2007,2,1)); - s.setNextDueDate(QDate(2007,1,24)); + s.setNextDueDate(TQDate(2007,1,24)); - dates = s.paymentDates(QDate(2007,2,1), QDate(2007,2,1)); - CPPUNIT_ASSERT(s.nextDueDate() == QDate(2007,1,24)); + dates = s.paymentDates(TQDate(2007,2,1), TQDate(2007,2,1)); + CPPUNIT_ASSERT(s.nextDueDate() == TQDate(2007,1,24)); CPPUNIT_ASSERT(dates.count() == 0); - dates = s.paymentDates(QDate(2007,1,24), QDate(2007,1,24)); + dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,1,24)); CPPUNIT_ASSERT(dates.count() == 1); - dates = s.paymentDates(QDate(2007,1,24), QDate(2007,2,24)); + dates = s.paymentDates(TQDate(2007,1,24), TQDate(2007,2,24)); CPPUNIT_ASSERT(dates.count() == 2); - CPPUNIT_ASSERT(dates[0] == QDate(2007,1,24)); - CPPUNIT_ASSERT(dates[1] == QDate(2007,2,24)); + CPPUNIT_ASSERT(dates[0] == TQDate(2007,1,24)); + CPPUNIT_ASSERT(dates[1] == TQDate(2007,2,24)); } @@ -1339,7 +1339,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents() CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 56); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 60); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 90); - CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_QUARTERLY) == 90); + CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TQUARTERLY) == 90); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 120); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_TWICEYEARLY) == 180); CPPUNIT_ASSERT(MyMoneySchedule::daysBetweenEvents(MyMoneySchedule::OCCUR_YEARLY) == 360); @@ -1349,7 +1349,7 @@ void MyMoneyScheduleTest::testDaysBetweenEvents() void MyMoneyScheduleTest::testStringToOccurence() { // For each occurenceE: - // test MyMoneySchedule::stringToOccurence(QString) == occurence + // test MyMoneySchedule::stringToOccurence(TQString) == occurence CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Once")) == MyMoneySchedule::OCCUR_ONCE ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Daily")) == MyMoneySchedule::OCCUR_DAILY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Weekly")) == MyMoneySchedule::OCCUR_WEEKLY ); @@ -1361,7 +1361,7 @@ void MyMoneyScheduleTest::testStringToOccurence() CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every eight weeks")) == MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every two months")) == MyMoneySchedule::OCCUR_EVERYOTHERMONTH ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every three months")) == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS ); - CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_QUARTERLY ); + CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Quarterly")) == MyMoneySchedule::OCCUR_TQUARTERLY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Every four months")) == MyMoneySchedule::OCCUR_EVERYFOURMONTHS ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Twice yearly")) == MyMoneySchedule::OCCUR_TWICEYEARLY ); CPPUNIT_ASSERT( MyMoneySchedule::stringToOccurence(i18n("Yearly")) == MyMoneySchedule::OCCUR_YEARLY ); @@ -1382,7 +1382,7 @@ void MyMoneyScheduleTest::testStringToOccurence() CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYOTHERMONTH == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYTHREEMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS))) ); - CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_QUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY))) ); + CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TQUARTERLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_EVERYFOURMONTHS == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_TWICEYEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY))) ); CPPUNIT_ASSERT( MyMoneySchedule::OCCUR_YEARLY == MyMoneySchedule::stringToOccurence(i18n(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY))) ); @@ -1403,7 +1403,7 @@ void MyMoneyScheduleTest::testEventsPerYear() CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == 6); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == 6); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == 4); - CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_QUARTERLY) == 4); + CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TQUARTERLY) == 4); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == 3); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_TWICEYEARLY) == 2); CPPUNIT_ASSERT(MyMoneySchedule::eventsPerYear(MyMoneySchedule::OCCUR_YEARLY) == 1); @@ -1426,14 +1426,14 @@ void MyMoneyScheduleTest::testOccurenceToString() CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Every eight weeks" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Every two months" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Every three months" ); - CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Quarterly" ); + CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Quarterly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Every four months" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Twice yearly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == "Yearly" ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Every other year" ); // For each occurenceE set occurence and compare occurenceToString() with oTS(occurence()) MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); s.setOccurence(MyMoneySchedule::OCCUR_ONCE); CPPUNIT_ASSERT(s.occurenceToString() == "Once" ); @@ -1451,7 +1451,7 @@ void MyMoneyScheduleTest::testOccurenceToString() s.setOccurence(MyMoneySchedule::OCCUR_EVERYOTHERMONTH); CPPUNIT_ASSERT(s.occurenceToString() == "Every two months" ); s.setOccurence(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); // Quarterly no longer used. Every three months used instead - s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); + s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); CPPUNIT_ASSERT(s.occurenceToString() == "Every three months" ); s.setOccurence(MyMoneySchedule::OCCUR_EVERYFOURMONTHS); CPPUNIT_ASSERT(s.occurenceToString() == "Every four months" ); s.setOccurence(MyMoneySchedule::OCCUR_TWICEYEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Twice yearly" ); s.setOccurence(MyMoneySchedule::OCCUR_YEARLY); CPPUNIT_ASSERT(s.occurenceToString() == "Yearly" ); @@ -1471,7 +1471,7 @@ void MyMoneyScheduleTest::testOccurenceToString() CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == MyMoneySchedule::occurenceToString(8,MyMoneySchedule::OCCUR_WEEKLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == MyMoneySchedule::occurenceToString(2,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == MyMoneySchedule::occurenceToString(3,MyMoneySchedule::OCCUR_MONTHLY) ); - // OCCUR_QUARTERLY will no longer be used: only Every Three Months + // OCCUR_TQUARTERLY will no longer be used: only Every Three Months CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == MyMoneySchedule::occurenceToString(4,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == MyMoneySchedule::occurenceToString(6,MyMoneySchedule::OCCUR_MONTHLY) ); CPPUNIT_ASSERT(MyMoneySchedule::occurenceToString(MyMoneySchedule::OCCUR_YEARLY) == MyMoneySchedule::occurenceToString(1,MyMoneySchedule::OCCUR_YEARLY) ); @@ -1545,7 +1545,7 @@ void MyMoneyScheduleTest::testOccurencePeriodToString() CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYEIGHTWEEKS) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERMONTH) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYTHREEMONTHS) == "Any" ); - CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_QUARTERLY) == "Any" ); + CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TQUARTERLY) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYFOURMONTHS) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_TWICEYEARLY) == "Any" ); CPPUNIT_ASSERT(MyMoneySchedule::occurencePeriodToString(MyMoneySchedule::OCCUR_EVERYOTHERYEAR) == "Any" ); @@ -1561,7 +1561,7 @@ void MyMoneyScheduleTest::testOccurencePeriod() // Once occurence() and setOccurence() are converting between compound and simple occurences // we need to change the occurence() check and add an occurenceMultiplier() check MyMoneySchedule s; - s.setStartDate(QDate(2007, 1, 1)); + s.setStartDate(TQDate(2007, 1, 1)); s.setNextDueDate(s.startDate()); s.setLastPayment(s.startDate()); // Set all base occurences @@ -1730,7 +1730,7 @@ void MyMoneyScheduleTest::testOccurencePeriod() CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 3); // Quarterly no longer used. Every three months used instead - s.setOccurence(MyMoneySchedule::OCCUR_QUARTERLY); + s.setOccurence(MyMoneySchedule::OCCUR_TQUARTERLY); CPPUNIT_ASSERT(s.occurence() == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS); CPPUNIT_ASSERT(s.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); CPPUNIT_ASSERT(s.occurenceMultiplier() == 3); @@ -1798,7 +1798,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence() occ = MyMoneySchedule::OCCUR_EVERYTHREEMONTHS; mult = 1; MyMoneySchedule::simpleToCompoundOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 ); - occ = MyMoneySchedule::OCCUR_QUARTERLY; mult = 1; + occ = MyMoneySchedule::OCCUR_TQUARTERLY; mult = 1; MyMoneySchedule::simpleToCompoundOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_MONTHLY && mult == 3 ); occ = MyMoneySchedule::OCCUR_EVERYFOURMONTHS; mult = 1; @@ -1851,7 +1851,7 @@ void MyMoneyScheduleTest::testSimpleToFromCompoundOccurence() occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 3; MyMoneySchedule::compoundToSimpleOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYTHREEMONTHS && mult == 1 ); - // MyMoneySchedule::OCCUR_QUARTERLY not converted back + // MyMoneySchedule::OCCUR_TQUARTERLY not converted back occ = MyMoneySchedule::OCCUR_MONTHLY; mult = 4; MyMoneySchedule::compoundToSimpleOccurence(mult, occ); CPPUNIT_ASSERT( occ == MyMoneySchedule::OCCUR_EVERYFOURMONTHS && mult == 1 ); @@ -1872,9 +1872,9 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() // https://bugs.kde.org/show_bug.cgi?id=231029 MyMoneySchedule sch; - QDate paymentInFuture = QDate::currentDate().addDays(7); + TQDate paymentInFuture = TQDate::tqcurrentDate().addDays(7); - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<SCHEDULE-CONTAINER>\n" " <SCHEDULED_TX startDate=\"%1\" autoEnter=\"0\" weekendOption=\"1\" lastPayment=\"%2\" paymentType=\"2\" endDate=\"%3\" type=\"4\" id=\"SCH0042\" name=\"A Name\" fixed=\"1\" occurenceMultiplier=\"1\" occurence=\"32\" >\n" @@ -1887,12 +1887,12 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() " </TRANSACTION>\n" " </SCHEDULED_TX>\n" "</SCHEDULE-CONTAINER>\n" - ).arg(paymentInFuture.toString(Qt::ISODate)) - .arg(paymentInFuture.toString(Qt::ISODate)) - .arg(paymentInFuture.toString(Qt::ISODate)); + ).tqarg(paymentInFuture.toString(Qt::ISODate)) + .tqarg(paymentInFuture.toString(Qt::ISODate)) + .tqarg(paymentInFuture.toString(Qt::ISODate)); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -1900,7 +1900,7 @@ void MyMoneyScheduleTest::testPaidEarlyOneTime() sch = MyMoneySchedule(node); CPPUNIT_ASSERT(sch.isFinished() == true); CPPUNIT_ASSERT(sch.occurencePeriod() == MyMoneySchedule::OCCUR_MONTHLY); - CPPUNIT_ASSERT(sch.paymentDates(QDate::currentDate(), QDate::currentDate().addDays(21)).count() == 0); + CPPUNIT_ASSERT(sch.paymentDates(TQDate::tqcurrentDate(), TQDate::tqcurrentDate().addDays(21)).count() == 0); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); diff --git a/kmymoney2/mymoney/mymoneysecurity.cpp b/kmymoney2/mymoney/mymoneysecurity.cpp index 73edbdb..27a1352 100644 --- a/kmymoney2/mymoney/mymoneysecurity.cpp +++ b/kmymoney2/mymoney/mymoneysecurity.cpp @@ -42,7 +42,7 @@ MyMoneySecurity::MyMoneySecurity() : { } -MyMoneySecurity::MyMoneySecurity(const QString& id, const QString& name, const QString& symbol, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) : +MyMoneySecurity::MyMoneySecurity(const TQString& id, const TQString& name, const TQString& symbol, const int partsPerUnit, const int smallestCashFraction, const int smallestAccountFraction) : MyMoneyObject(id), m_name(name), m_securityType(SECURITY_CURRENCY) @@ -60,24 +60,24 @@ MyMoneySecurity::MyMoneySecurity(const QString& id, const QString& name, const Q m_smallestAccountFraction = smallestCashFraction; } -MyMoneySecurity::MyMoneySecurity(const QString& id, const MyMoneySecurity& equity) : +MyMoneySecurity::MyMoneySecurity(const TQString& id, const MyMoneySecurity& equity) : MyMoneyObject(id) { *this = equity; m_id = id; } -MyMoneySecurity::MyMoneySecurity(const QDomElement& node) : +MyMoneySecurity::MyMoneySecurity(const TQDomElement& node) : MyMoneyObject(node), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { if(("SECURITY" != node.tagName()) - && ("EQUITY" != node.tagName()) + && ("ETQUITY" != node.tagName()) && ("CURRENCY" != node.tagName())) throw new MYMONEYEXCEPTION("Node was not SECURITY or CURRENCY"); - setName(QStringEmpty(node.attribute("name"))); - setTradingSymbol(QStringEmpty(node.attribute("symbol"))); + setName(TQStringEmpty(node.attribute("name"))); + setTradingSymbol(TQStringEmpty(node.attribute("symbol"))); setSecurityType(static_cast<eSECURITYTYPE>(node.attribute("type").toInt())); setSmallestAccountFraction(node.attribute("saf").toInt()); @@ -85,8 +85,8 @@ MyMoneySecurity::MyMoneySecurity(const QDomElement& node) : setPartsPerUnit(node.attribute("ppu").toInt()); setSmallestCashFraction(node.attribute("scf").toInt()); } else { - setTradingCurrency(QStringEmpty(node.attribute("trading-currency"))); - setTradingMarket(QStringEmpty(node.attribute("trading-market"))); + setTradingCurrency(TQStringEmpty(node.attribute("trading-currency"))); + setTradingMarket(TQStringEmpty(node.attribute("trading-market"))); } } @@ -118,14 +118,14 @@ bool MyMoneySecurity::operator < (const MyMoneySecurity& right) const } -bool MyMoneySecurity::hasReferenceTo(const QString& id) const +bool MyMoneySecurity::hasReferenceTo(const TQString& id) const { return (id == m_tradingCurrency); } -void MyMoneySecurity::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySecurity::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el; + TQDomElement el; if(isCurrency()) el = document.createElement("CURRENCY"); else @@ -148,12 +148,12 @@ void MyMoneySecurity::writeXML(QDomDocument& document, QDomElement& parent) cons //Add in Key-Value Pairs for securities. MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -QString MyMoneySecurity::securityTypeToString(const eSECURITYTYPE securityType) +TQString MyMoneySecurity::securityTypeToString(const eSECURITYTYPE securityType) { - QString returnString; + TQString returnString; switch (securityType) { case MyMoneySecurity::SECURITY_STOCK: diff --git a/kmymoney2/mymoney/mymoneysecurity.h b/kmymoney2/mymoney/mymoneysecurity.h index 666398e..fa49cb8 100644 --- a/kmymoney2/mymoney/mymoneysecurity.h +++ b/kmymoney2/mymoney/mymoneysecurity.h @@ -30,8 +30,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qdatetime.h> -#include <qmap.h> +#include <tqdatetime.h> +#include <tqmap.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -57,9 +57,9 @@ class KMYMONEY_EXPORT MyMoneySecurity : public MyMoneyObject, public MyMoneyKeyV { public: MyMoneySecurity(); - MyMoneySecurity(const QString& id, const MyMoneySecurity& equity); - MyMoneySecurity(const QString& id, const QString& name, const QString& symbol = QString(), const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); - MyMoneySecurity(const QDomElement& node); + MyMoneySecurity(const TQString& id, const MyMoneySecurity& equity); + MyMoneySecurity(const TQString& id, const TQString& name, const TQString& symbol = TQString(), const int partsPerUnit = 100, const int smallestCashFraction = 100, const int smallestAccountFraction = 0); + MyMoneySecurity(const TQDomElement& node); virtual ~MyMoneySecurity(); bool operator < (const MyMoneySecurity&) const; @@ -86,21 +86,21 @@ public: SECURITY_NONE } eSECURITYTYPE; - const QString& name() const { return m_name; } + const TQString& name() const { return m_name; } void setName(const String& str) { m_name = str; } - const QString& tradingSymbol() const { return m_tradingSymbol; } + const TQString& tradingSymbol() const { return m_tradingSymbol; } void setTradingSymbol(const String& str) { m_tradingSymbol = str; } eSECURITYTYPE securityType() const { return m_securityType; } void setSecurityType(const eSECURITYTYPE& s) { m_securityType = s; } bool isCurrency(void) const { return m_securityType == SECURITY_CURRENCY; }; - const QString& tradingMarket() const { return m_tradingMarket; } - void setTradingMarket(const QString& str) { m_tradingMarket = str; } + const TQString& tradingMarket() const { return m_tradingMarket; } + void setTradingMarket(const TQString& str) { m_tradingMarket = str; } - const QString& tradingCurrency(void) const { return m_tradingCurrency; }; - void setTradingCurrency(const QString& str) { m_tradingCurrency = str; }; + const TQString& tradingCurrency(void) const { return m_tradingCurrency; }; + void setTradingCurrency(const TQString& str) { m_tradingCurrency = str; }; int smallestAccountFraction(void) const { return m_smallestAccountFraction; }; void setSmallestAccountFraction(const int sf) { m_smallestAccountFraction = sf; }; @@ -111,7 +111,7 @@ public: void setPartsPerUnit(const int ppu) { m_partsPerUnit = ppu; }; void setSmallestCashFraction(const int sf) { m_smallestCashFraction = sf; }; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -122,7 +122,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - bool hasReferenceTo(const QString& id) const; + bool hasReferenceTo(const TQString& id) const; /** * This method is used to convert the internal representation of @@ -131,16 +131,16 @@ public: * @param securityType enumerated representation of the security type. * For possible values, see MyMoneySecurity::eSECURITYTYPE * - * @return QString representing the human readable form + * @return TQString representing the human readable form */ - static QString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); + static TQString securityTypeToString(const MyMoneySecurity::eSECURITYTYPE securityType); protected: - QString m_name; - QString m_tradingSymbol; - QString m_tradingMarket; - QString m_tradingCurrency; + TQString m_name; + TQString m_tradingSymbol; + TQString m_tradingMarket; + TQString m_tradingCurrency; eSECURITYTYPE m_securityType; int m_smallestAccountFraction; int m_smallestCashFraction; diff --git a/kmymoney2/mymoney/mymoneysecuritytest.cpp b/kmymoney2/mymoney/mymoneysecuritytest.cpp index 77b6764..72911db 100644 --- a/kmymoney2/mymoney/mymoneysecuritytest.cpp +++ b/kmymoney2/mymoney/mymoneysecuritytest.cpp @@ -51,7 +51,7 @@ void MyMoneySecurityTest::testCopyConstructor() { } void MyMoneySecurityTest::testNonemptyConstructor() { - QDate date(2004,4,1); + TQDate date(2004,4,1); MyMoneyMoney val("1234/100"); m->setName("name"); @@ -61,8 +61,8 @@ void MyMoneySecurityTest::testNonemptyConstructor() { MyMoneySecurity n("id", *m); - CPPUNIT_ASSERT(n.id() == QString("id")); - CPPUNIT_ASSERT(n.tradingSymbol() == QString("symbol")); + CPPUNIT_ASSERT(n.id() == TQString("id")); + CPPUNIT_ASSERT(n.tradingSymbol() == TQString("symbol")); CPPUNIT_ASSERT(n.securityType() == MyMoneySecurity::SECURITY_CURRENCY); // CPPUNIT_ASSERT(n.priceHistory().count() == 1); } @@ -173,8 +173,8 @@ void MyMoneySecurityTest::testInequality () { /* void MyMoneySecurityTest::testAccountIDList () { MyMoneySecurity equity; - QStringList list; - QString id; + TQStringList list; + TQString id; // list must be empty list = institution.accountList(); @@ -184,26 +184,26 @@ void MyMoneySecurityTest::testAccountIDList () { institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // adding same account shouldn't make a difference institution.addAccountId("A000002"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); // now add another account institution.addAccountId("A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 2); - CPPUNIT_ASSERT(list.contains("A000002") == 1); - CPPUNIT_ASSERT(list.contains("A000001") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000001") == 1); id = institution.removeAccountId("A000001"); CPPUNIT_ASSERT(id == "A000001"); list = institution.accountList(); CPPUNIT_ASSERT(list.count() == 1); - CPPUNIT_ASSERT(list.contains("A000002") == 1); + CPPUNIT_ASSERT(list.tqcontains("A000002") == 1); } */ diff --git a/kmymoney2/mymoney/mymoneysplit.cpp b/kmymoney2/mymoney/mymoneysplit.cpp index a19ff43..4af052d 100644 --- a/kmymoney2/mymoney/mymoneysplit.cpp +++ b/kmymoney2/mymoney/mymoneysplit.cpp @@ -44,7 +44,7 @@ MyMoneySplit::MyMoneySplit() m_reconcileFlag = NotReconciled; } -MyMoneySplit::MyMoneySplit(const QDomElement& node) : +MyMoneySplit::MyMoneySplit(const TQDomElement& node) : MyMoneyObject(node, false), MyMoneyKeyValueContainer(node.elementsByTagName("KEYVALUEPAIRS").item(0).toElement()) { @@ -53,20 +53,20 @@ MyMoneySplit::MyMoneySplit(const QDomElement& node) : clearId(); - m_payee = QStringEmpty(node.attribute("payee")); - m_reconcileDate = stringToDate(QStringEmpty(node.attribute("reconciledate"))); - m_action = QStringEmpty(node.attribute("action")); + m_payee = TQStringEmpty(node.attribute("payee")); + m_reconcileDate = stringToDate(TQStringEmpty(node.attribute("reconciledate"))); + m_action = TQStringEmpty(node.attribute("action")); m_reconcileFlag = static_cast<MyMoneySplit::reconcileFlagE>(node.attribute("reconcileflag").toInt()); - m_memo = QStringEmpty(node.attribute("memo")); - m_value = MyMoneyMoney(QStringEmpty(node.attribute("value"))); - m_shares = MyMoneyMoney(QStringEmpty(node.attribute("shares"))); - m_price = MyMoneyMoney(QStringEmpty(node.attribute("price"))); - m_account = QStringEmpty(node.attribute("account")); - m_number = QStringEmpty(node.attribute("number")); - m_bankID = QStringEmpty(node.attribute("bankid")); + m_memo = TQStringEmpty(node.attribute("memo")); + m_value = MyMoneyMoney(TQStringEmpty(node.attribute("value"))); + m_shares = MyMoneyMoney(TQStringEmpty(node.attribute("shares"))); + m_price = MyMoneyMoney(TQStringEmpty(node.attribute("price"))); + m_account = TQStringEmpty(node.attribute("account")); + m_number = TQStringEmpty(node.attribute("number")); + m_bankID = TQStringEmpty(node.attribute("bankid")); } -MyMoneySplit::MyMoneySplit(const QString& id, const MyMoneySplit& right) : +MyMoneySplit::MyMoneySplit(const TQString& id, const MyMoneySplit& right) : MyMoneyObject(id) { *this = right; @@ -94,17 +94,17 @@ bool MyMoneySplit::operator == (const MyMoneySplit& right) const m_transactionId == right.m_transactionId; } -void MyMoneySplit::setAccountId(const QString& account) +void MyMoneySplit::setAccountId(const TQString& account) { m_account = account; } -void MyMoneySplit::setMemo(const QString& memo) +void MyMoneySplit::setMemo(const TQString& memo) { m_memo = memo; } -void MyMoneySplit::setReconcileDate(const QDate& date) +void MyMoneySplit::setReconcileDate(const TQDate& date) { m_reconcileDate = date; } @@ -124,7 +124,7 @@ void MyMoneySplit::setValue(const MyMoneyMoney& value) m_value = value; } -void MyMoneySplit::setValue(const MyMoneyMoney& value, const QString& transactionCurrencyId, const QString& splitCurrencyId) +void MyMoneySplit::setValue(const MyMoneyMoney& value, const TQString& transactionCurrencyId, const TQString& splitCurrencyId) { if(transactionCurrencyId == splitCurrencyId) setValue(value); @@ -132,7 +132,7 @@ void MyMoneySplit::setValue(const MyMoneyMoney& value, const QString& transactio setShares(value); } -void MyMoneySplit::setPayeeId(const QString& payee) +void MyMoneySplit::setPayeeId(const TQString& payee) { m_payee = payee; } @@ -165,17 +165,17 @@ void MyMoneySplit::setAction(investTransactionTypeE type) } } -void MyMoneySplit::setAction(const QString& action) +void MyMoneySplit::setAction(const TQString& action) { m_action = action; } -void MyMoneySplit::setNumber(const QString& number) +void MyMoneySplit::setNumber(const TQString& number) { m_number = number; } -const MyMoneyMoney MyMoneySplit::value(const QString& transactionCurrencyId, const QString& splitCurrencyId) const +const MyMoneyMoney MyMoneySplit::value(const TQString& transactionCurrencyId, const TQString& splitCurrencyId) const { return (transactionCurrencyId == splitCurrencyId) ? m_value : m_shares; } @@ -194,9 +194,9 @@ MyMoneyMoney MyMoneySplit::price(void) const return MyMoneyMoney(1,1); } -void MyMoneySplit::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneySplit::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("SPLIT"); + TQDomElement el = document.createElement("SPLIT"); writeBaseXML(document, el); @@ -217,10 +217,10 @@ void MyMoneySplit::writeXML(QDomDocument& document, QDomElement& parent) const MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneySplit::hasReferenceTo(const QString& id) const +bool MyMoneySplit::hasReferenceTo(const TQString& id) const { bool rc = false; if(isMatched()) { @@ -239,12 +239,12 @@ void MyMoneySplit::addMatch(const MyMoneyTransaction& _t) if(_t.isImported() && !isMatched()) { MyMoneyTransaction t(_t); t.clearId(); - QDomDocument doc("MATCH"); - QDomElement el = doc.createElement("CONTAINER"); + TQDomDocument doc("MATCH"); + TQDomElement el = doc.createElement("CONTAINER"); doc.appendChild(el); t.writeXML(doc, el); - QString xml = doc.toString(); - xml.replace("<", "<"); + TQString xml = doc.toString(); + xml.tqreplace("<", "<"); setValue("kmm-matched-tx", xml); } } @@ -256,11 +256,11 @@ void MyMoneySplit::removeMatch(void) MyMoneyTransaction MyMoneySplit::matchedTransaction(void) const { - QString xml = value("kmm-matched-tx"); + TQString xml = value("kmm-matched-tx"); if(!xml.isEmpty()) { - xml.replace("<", "<"); - QDomDocument doc; - QDomElement node; + xml.tqreplace("<", "<"); + TQDomDocument doc; + TQDomElement node; doc.setContent(xml); node = doc.documentElement().firstChild().toElement(); MyMoneyTransaction t(node, false); diff --git a/kmymoney2/mymoney/mymoneysplit.h b/kmymoney2/mymoney/mymoneysplit.h index 3408a6a..de7c849 100644 --- a/kmymoney2/mymoney/mymoneysplit.h +++ b/kmymoney2/mymoney/mymoneysplit.h @@ -30,8 +30,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqdatetime.h> // ---------------------------------------------------------------------------- // Project Includes @@ -92,13 +92,13 @@ public: } investTransactionTypeE; MyMoneySplit(); - MyMoneySplit(const QDomElement& node); - MyMoneySplit(const QString& id, const MyMoneySplit& right); + MyMoneySplit(const TQDomElement& node); + MyMoneySplit(const TQString& id, const MyMoneySplit& right); ~MyMoneySplit(); bool operator == (const MyMoneySplit&) const; - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -109,7 +109,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; const MyMoneyMoney& shares(void) const { return m_shares; } const MyMoneyMoney& value(void) const { return m_value; } @@ -126,30 +126,30 @@ public: */ MyMoneyMoney actualPrice(void) const { return m_price; } - const MyMoneyMoney value(const QString& transactionCurrencyId, const QString& splitCurrencyId) const; + const MyMoneyMoney value(const TQString& transactionCurrencyId, const TQString& splitCurrencyId) const; /** * Required to have (direct) access to the MyMoneyKeyValueContainer::value() method. */ - const QString& value(const QString& key) const { return MyMoneyKeyValueContainer::value(key); } + const TQString& value(const TQString& key) const { return MyMoneyKeyValueContainer::value(key); } /** * Required to have (direct) access to the MyMoneyKeyValueContainer::setValue() method. */ - void setValue(const QString& key, const QString& value) { MyMoneyKeyValueContainer::setValue(key, value); } + void setValue(const TQString& key, const TQString& value) { MyMoneyKeyValueContainer::setValue(key, value); } - const QString& accountId(void) const { return m_account; } - const QString& memo(void) const { return m_memo; } + const TQString& accountId(void) const { return m_account; } + const TQString& memo(void) const { return m_memo; } reconcileFlagE reconcileFlag(void) const { return m_reconcileFlag; } - const QDate& reconcileDate(void) const { return m_reconcileDate; } - const QString& payeeId(void) const { return m_payee; } - const QString& action(void) const { return m_action; } - const QString& number(void) const { return m_number; } + const TQDate& reconcileDate(void) const { return m_reconcileDate; } + const TQString& payeeId(void) const { return m_payee; } + const TQString& action(void) const { return m_action; } + const TQString& number(void) const { return m_number; } bool isAmortizationSplit(void) const { return m_action == ActionAmortization; } bool isInterestSplit(void) const { return m_action == ActionInterest; } bool isAutoCalc(void) const { return (m_shares == MyMoneyMoney::autoCalc) || (m_value == MyMoneyMoney::autoCalc); } - const QString& bankID(void) const { return m_bankID; } - const QString& transactionId(void) const { return m_transactionId; } + const TQString& bankID(void) const { return m_bankID; } + const TQString& transactionId(void) const { return m_transactionId; } void setShares(const MyMoneyMoney& shares); void setValue(const MyMoneyMoney& value); @@ -168,18 +168,18 @@ public: * the id of the currency assigned to the account that is * referenced by the split) */ - void setValue(const MyMoneyMoney& value, const QString& transactionCurrencyId, const QString& splitCurrencyId); + void setValue(const MyMoneyMoney& value, const TQString& transactionCurrencyId, const TQString& splitCurrencyId); - void setAccountId(const QString& account); - void setMemo(const QString& memo); + void setAccountId(const TQString& account); + void setMemo(const TQString& memo); void setReconcileFlag(const reconcileFlagE flag); - void setReconcileDate(const QDate& date); - void setPayeeId(const QString& payee); - void setAction(const QString& action); + void setReconcileDate(const TQDate& date); + void setPayeeId(const TQString& payee); + void setAction(const TQString& action); void setAction(investTransactionTypeE type); - void setNumber(const QString& number); - void setBankID(const QString& bankID) { m_bankID = bankID; }; - void setTransactionId(const QString& id) { m_transactionId = id; } + void setNumber(const TQString& number); + void setBankID(const TQString& bankID) { m_bankID = bankID; }; + void setTransactionId(const TQString& id) { m_transactionId = id; } /** * returns @a true if this its a transaction matched against an imported @@ -226,17 +226,17 @@ private: /** * This member contains the ID of the transaction */ - QString m_id; + TQString m_id; /** * This member contains the ID of the payee */ - QString m_payee; + TQString m_payee; /** * This member contains the ID of the account */ - QString m_account; + TQString m_account; /** */ @@ -254,7 +254,7 @@ private: */ MyMoneyMoney m_price; - QString m_memo; + TQString m_memo; /** * This member contains information about the reconciliation @@ -272,20 +272,20 @@ private: * In case the reconciliation flag is set to Reconciled or Frozen * this member contains the date of the reconciliation. */ - QDate m_reconcileDate; + TQDate m_reconcileDate; /** * The m_action member is an arbitrary string, but is intended to * be conveniently limited to a menu of selections such as * "Buy", "Sell", "Interest", etc. */ - QString m_action; + TQString m_action; /** * The m_number member is used to store a reference number to * the split supplied by the user (e.g. check number, etc.). */ - QString m_number; + TQString m_number; /** * This member keeps the bank's unique ID for the split, so we can @@ -294,14 +294,14 @@ private: * This should only be set on the split which refers to the account * that was downloaded. */ - QString m_bankID; + TQString m_bankID; /** * This member keeps a backward id to the transaction that this * split can be found in. It is the purpose of the MyMoneyTransaction * object to maintain this member variable. */ - QString m_transactionId; + TQString m_transactionId; }; #endif diff --git a/kmymoney2/mymoney/mymoneysplittest.cpp b/kmymoney2/mymoney/mymoneysplittest.cpp index a592e1a..806b556 100644 --- a/kmymoney2/mymoney/mymoneysplittest.cpp +++ b/kmymoney2/mymoney/mymoneysplittest.cpp @@ -38,14 +38,14 @@ void MyMoneySplitTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->shares().isZero()); CPPUNIT_ASSERT(m->value().isZero()); CPPUNIT_ASSERT(m->reconcileFlag() == MyMoneySplit::NotReconciled); - CPPUNIT_ASSERT(m->reconcileDate() == QDate()); + CPPUNIT_ASSERT(m->reconcileDate() == TQDate()); CPPUNIT_ASSERT(m->transactionId().isEmpty()); } void MyMoneySplitTest::testSetFunctions() { m->setAccountId("Account"); m->setMemo("Memo"); - m->setReconcileDate(QDate(1,2,3)); + m->setReconcileDate(TQDate(1,2,3)); m->setReconcileFlag(MyMoneySplit::Cleared); m->setShares(1234); m->setValue(3456); @@ -57,7 +57,7 @@ void MyMoneySplitTest::testSetFunctions() { CPPUNIT_ASSERT(m->accountId() == "Account"); CPPUNIT_ASSERT(m->memo() == "Memo"); - CPPUNIT_ASSERT(m->reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(m->reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(m->reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(m->shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(m->value() == MyMoneyMoney(3456)); @@ -76,7 +76,7 @@ void MyMoneySplitTest::testCopyConstructor() { CPPUNIT_ASSERT(n.accountId() == "Account"); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(n.shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(n.value() == MyMoneyMoney(3456)); @@ -96,7 +96,7 @@ void MyMoneySplitTest::testAssignmentConstructor() { CPPUNIT_ASSERT(n.accountId() == "Account"); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.reconcileDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.reconcileDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.reconcileFlag() == MyMoneySplit::Cleared); CPPUNIT_ASSERT(n.shares() == MyMoneyMoney(1234)); CPPUNIT_ASSERT(n.value() == MyMoneyMoney(3456)); @@ -148,7 +148,7 @@ void MyMoneySplitTest::testInequality() { CPPUNIT_ASSERT(!(n == *m)); n = *m; - n.setReconcileDate(QDate(3,4,5)); + n.setReconcileDate(TQDate(3,4,5)); CPPUNIT_ASSERT(!(n == *m)); n = *m; @@ -200,7 +200,7 @@ void MyMoneySplitTest::testSetValue() { } void MyMoneySplitTest::testSetAction() { - CPPUNIT_ASSERT(m->action() == QString()); + CPPUNIT_ASSERT(m->action() == TQString()); m->setAction(MyMoneySplit::BuyShares); CPPUNIT_ASSERT(m->action() == MyMoneySplit::ActionBuyShares); m->setAction(MyMoneySplit::SellShares); @@ -243,12 +243,12 @@ void MyMoneySplitTest::testWriteXML() { s.setAction(MyMoneySplit::ActionDeposit); s.setReconcileFlag(MyMoneySplit::Reconciled); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("SPLIT-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("SPLIT-CONTAINER"); doc.appendChild(el); s.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<SPLIT-CONTAINER>\n" " <SPLIT payee=\"P000001\" reconciledate=\"\" shares=\"96379/100\" action=\"Deposit\" bankid=\"SPID\" number=\"124\" reconcileflag=\"2\" memo=\"\" value=\"96379/1000\" id=\"\" account=\"A000076\" />\n" @@ -259,20 +259,20 @@ void MyMoneySplitTest::testWriteXML() { void MyMoneySplitTest::testReadXML() { MyMoneySplit s; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<SPLIT-CONTAINER>\n" " <SPLIT payee=\"P000001\" reconciledate=\"\" shares=\"96379/100\" action=\"Deposit\" bankid=\"SPID\" number=\"124\" reconcileflag=\"2\" memo=\"MyMemo\" value=\"96379/1000\" account=\"A000076\" />\n" "</SPLIT-CONTAINER>\n"); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<SPLIT-CONTAINER>\n" " <SPLITS payee=\"P000001\" reconciledate=\"\" shares=\"96379/100\" action=\"Deposit\" bankid=\"SPID\" number=\"124\" reconcileflag=\"2\" memo=\"\" value=\"96379/1000\" account=\"A000076\" />\n" "</SPLIT-CONTAINER>\n"); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -290,7 +290,7 @@ void MyMoneySplitTest::testReadXML() { s = MyMoneySplit(node); CPPUNIT_ASSERT(s.id().isEmpty()); CPPUNIT_ASSERT(s.payeeId() == "P000001"); - CPPUNIT_ASSERT(s.reconcileDate() == QDate()); + CPPUNIT_ASSERT(s.reconcileDate() == TQDate()); CPPUNIT_ASSERT(s.shares() == MyMoneyMoney(96379, 100)); CPPUNIT_ASSERT(s.value() == MyMoneyMoney(96379, 1000)); CPPUNIT_ASSERT(s.number() == "124"); diff --git a/kmymoney2/mymoney/mymoneystatement.cpp b/kmymoney2/mymoney/mymoneystatement.cpp index 0373863..3756520 100644 --- a/kmymoney2/mymoney/mymoneystatement.cpp +++ b/kmymoney2/mymoney/mymoneystatement.cpp @@ -24,10 +24,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qdom.h> -#include <qstringlist.h> -#include <qfile.h> -#include <qtextstream.h> +#include <tqdom.h> +#include <tqstringlist.h> +#include <tqfile.h> +#include <tqtextstream.h> // ---------------------------------------------------------------------------- // Project Includes @@ -35,12 +35,12 @@ #include "../../kdecompat.h" #include "mymoneystatement.h" -const QStringList kAccountTypeTxt = QStringList::split(",","none,checkings,savings,investment,creditcard,invalid"); -const QStringList kActionText = QStringList::split(",","none,buy,sell,reinvestdividend,cashdividend,add,remove,stocksplit,fees,interest,invalid"); +const TQStringList kAccountTypeTxt = TQStringList::split(",","none,checkings,savings,investment,creditcard,invalid"); +const TQStringList kActionText = TQStringList::split(",","none,buy,sell,reinvestdividend,cashdividend,add,remove,stocksplit,fees,interest,invalid"); -void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const +void MyMoneyStatement::write(TQDomElement& _root,TQDomDocument* _doc) const { - QDomElement e = _doc->createElement("STATEMENT"); + TQDomElement e = _doc->createElement("STATEMENT"); _root.appendChild(e); e.setAttribute("version","1.1"); @@ -56,10 +56,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const e.setAttribute("skipCategoryMatching", m_skipCategoryMatching); // iterate over transactions, and add each one - QValueList<Transaction>::const_iterator it_t = m_listTransactions.begin(); + TQValueList<Transaction>::const_iterator it_t = m_listTransactions.begin(); while ( it_t != m_listTransactions.end() ) { - QDomElement p = _doc->createElement("TRANSACTION"); + TQDomElement p = _doc->createElement("TRANSACTION"); p.setAttribute("dateposted", (*it_t).m_datePosted.toString(Qt::ISODate)); p.setAttribute("payee", (*it_t).m_strPayee); p.setAttribute("memo", (*it_t).m_strMemo); @@ -77,9 +77,9 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // add all the splits we know of (might be empty) - QValueList<Split>::const_iterator it_s; + TQValueList<Split>::const_iterator it_s; for(it_s = (*it_t).m_listSplits.begin(); it_s != (*it_t).m_listSplits.end(); ++it_s) { - QDomElement split = _doc->createElement("SPLIT"); + TQDomElement split = _doc->createElement("SPLIT"); split.setAttribute("accountid", (*it_s).m_accountId); split.setAttribute("amount", (*it_s).m_amount.toString()); split.setAttribute("reconcile", (*it_s).m_reconcile); @@ -95,10 +95,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // iterate over prices, and add each one - QValueList<Price>::const_iterator it_p = m_listPrices.begin(); + TQValueList<Price>::const_iterator it_p = m_listPrices.begin(); while ( it_p != m_listPrices.end() ) { - QDomElement p = _doc->createElement("PRICE"); + TQDomElement p = _doc->createElement("PRICE"); p.setAttribute("dateposted", (*it_p).m_date.toString(Qt::ISODate)); p.setAttribute("security", (*it_p).m_strSecurity); p.setAttribute("amount", (*it_p).m_amount.toString()); @@ -109,10 +109,10 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } // iterate over securities, and add each one - QValueList<Security>::const_iterator it_s = m_listSecurities.begin(); + TQValueList<Security>::const_iterator it_s = m_listSecurities.begin(); while ( it_s != m_listSecurities.end() ) { - QDomElement p = _doc->createElement("SECURITY"); + TQDomElement p = _doc->createElement("SECURITY"); p.setAttribute("name", (*it_s).m_strName); p.setAttribute("symbol", (*it_s).m_strSymbol); p.setAttribute("id", (*it_s).m_strId); @@ -124,7 +124,7 @@ void MyMoneyStatement::write(QDomElement& _root,QDomDocument* _doc) const } -bool MyMoneyStatement::read(const QDomElement& _e) +bool MyMoneyStatement::read(const TQDomElement& _e) { bool result = false; @@ -136,33 +136,33 @@ bool MyMoneyStatement::read(const QDomElement& _e) m_strAccountNumber = _e.attribute("accountnumber"); m_strRoutingNumber = _e.attribute("routingnumber"); m_strCurrency = _e.attribute("currency"); - m_dateBegin = QDate::fromString(_e.attribute("begindate"),Qt::ISODate); - m_dateEnd = QDate::fromString(_e.attribute("enddate"),Qt::ISODate); + m_dateBegin = TQDate::fromString(_e.attribute("begindate"),Qt::ISODate); + m_dateEnd = TQDate::fromString(_e.attribute("enddate"),Qt::ISODate); m_closingBalance = MyMoneyMoney(_e.attribute("closingbalance")); m_accountId = _e.attribute("accountid"); m_skipCategoryMatching = _e.attribute("skipCategoryMatching"); - int i = kAccountTypeTxt.findIndex(_e.attribute("type",kAccountTypeTxt[1])); + int i = kAccountTypeTxt.tqfindIndex(_e.attribute("type",kAccountTypeTxt[1])); if ( i != -1 ) m_eType = static_cast<EType>(i); - QDomNode child = _e.firstChild(); + TQDomNode child = _e.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if ( c.tagName() == "TRANSACTION" ) { MyMoneyStatement::Transaction t; - t.m_datePosted = QDate::fromString(c.attribute("dateposted"),Qt::ISODate); + t.m_datePosted = TQDate::fromString(c.attribute("dateposted"),Qt::ISODate); t.m_amount = MyMoneyMoney(c.attribute("amount")); t.m_strMemo = c.attribute("memo"); t.m_strNumber = c.attribute("number"); t.m_strPayee = c.attribute("payee"); t.m_strBankID = c.attribute("bankid"); t.m_reconcile = static_cast<MyMoneySplit::reconcileFlagE>(c.attribute("reconcile").toInt()); - int i = kActionText.findIndex(c.attribute("action",kActionText[1])); + int i = kActionText.tqfindIndex(c.attribute("action",kActionText[1])); if ( i != -1 ) t.m_eAction = static_cast<Transaction::EAction>(i); @@ -174,9 +174,9 @@ bool MyMoneyStatement::read(const QDomElement& _e) } // process splits (if any) - QDomNode child = c.firstChild(); + TQDomNode child = c.firstChild(); while(!child.isNull() && child.isElement()) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if(c.tagName() == "SPLIT") { MyMoneyStatement::Split s; s.m_accountId = c.attribute("accountid"); @@ -194,7 +194,7 @@ bool MyMoneyStatement::read(const QDomElement& _e) { MyMoneyStatement::Price p; - p.m_date = QDate::fromString(c.attribute("dateposted"), Qt::ISODate); + p.m_date = TQDate::fromString(c.attribute("dateposted"), Qt::ISODate); p.m_strSecurity = c.attribute("security"); p.m_amount = MyMoneyMoney(c.attribute("amount")); @@ -217,20 +217,20 @@ bool MyMoneyStatement::read(const QDomElement& _e) return result; } -bool MyMoneyStatement::isStatementFile(const QString& _filename) +bool MyMoneyStatement::isStatementFile(const TQString& _filename) { - // filename is considered a statement file if it contains + // filename is considered a statement file if it tqcontains // the tag "<KMYMONEY2-STATEMENT>" in the first 20 lines. bool result = false; - QFile f( _filename ); + TQFile f( _filename ); if ( f.open( IO_ReadOnly ) ) { - QTextStream ts( &f ); + TQTextStream ts( &f ); int lineCount = 20; while ( !ts.atEnd() && !result && lineCount != 0) { - if ( ts.readLine().contains("<KMYMONEY-STATEMENT>",false) ) + if ( ts.readLine().tqcontains("<KMYMONEY-STATEMENT>",false) ) result = true; --lineCount; } @@ -240,29 +240,29 @@ bool MyMoneyStatement::isStatementFile(const QString& _filename) return result; } -void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const QString& _filename ) +void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const TQString& _filename ) { static unsigned filenum = 1; - QString filename = _filename; + TQString filename = _filename; if ( filename.isEmpty() ) { - filename = QString("statement-%1%2.xml").arg((filenum<10)?"0":"").arg(filenum); + filename = TQString("statement-%1%2.xml").tqarg((filenum<10)?"0":"").tqarg(filenum); filenum++; } - QDomDocument* doc = new QDomDocument("KMYMONEY-STATEMENT"); + TQDomDocument* doc = new TQDomDocument("KMYMONEY-STATEMENT"); Q_CHECK_PTR(doc); //writeStatementtoXMLDoc(_s,doc); - QDomProcessingInstruction instruct = doc->createProcessingInstruction(QString("xml"), QString("version=\"1.0\" encoding=\"utf-8\"")); + TQDomProcessingInstruction instruct = doc->createProcessingInstruction(TQString("xml"), TQString("version=\"1.0\" encoding=\"utf-8\"")); doc->appendChild(instruct); - QDomElement eroot = doc->createElement("KMYMONEY-STATEMENT"); + TQDomElement eroot = doc->createElement("KMYMONEY-STATEMENT"); doc->appendChild(eroot); _s.write(eroot,doc); - QFile g( filename ); + TQFile g( filename ); if(g.open( IO_WriteOnly )) { - QTextStream stream(&g); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(&g); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << doc->toString(); g.close(); } @@ -270,22 +270,22 @@ void MyMoneyStatement::writeXMLFile( const MyMoneyStatement& _s, const QString& delete doc; } -bool MyMoneyStatement::readXMLFile( MyMoneyStatement& _s, const QString& _filename ) +bool MyMoneyStatement::readXMLFile( MyMoneyStatement& _s, const TQString& _filename ) { bool result = false; - QFile f( _filename ); + TQFile f( _filename ); f.open( IO_ReadOnly ); - QDomDocument* doc = new QDomDocument; + TQDomDocument* doc = new TQDomDocument; if(doc->setContent(&f, false)) { - QDomElement rootElement = doc->documentElement(); + TQDomElement rootElement = doc->documentElement(); if(!rootElement.isNull()) { - QDomNode child = rootElement.firstChild(); + TQDomNode child = rootElement.firstChild(); while(!child.isNull() && child.isElement()) { result = true; - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); _s.read(childElement); child = child.nextSibling(); diff --git a/kmymoney2/mymoney/mymoneystatement.h b/kmymoney2/mymoney/mymoneystatement.h index 0bea510..a7f8bfe 100644 --- a/kmymoney2/mymoney/mymoneystatement.h +++ b/kmymoney2/mymoney/mymoneystatement.h @@ -31,9 +31,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qvaluelist.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqvaluelist.h> +#include <tqdatetime.h> // ---------------------------------------------------------------------------- // Project Includes @@ -42,8 +42,8 @@ #include <kmymoney/mymoneymoney.h> #include <kmymoney/mymoneysplit.h> -class QDomElement; -class QDomDocument; +class TQDomElement; +class TQDomDocument; /** Represents the electronic analog of the paper bank statement just like we used to get in the regular mail. This class is designed to be easy to extend and easy to create with minimal dependencies. So the header file should include as few project files as possible (preferrably NONE). @@ -60,9 +60,9 @@ public: class Split { public: Split() : m_reconcile(MyMoneySplit::NotReconciled) {} - QString m_strCategoryName; - QString m_strMemo; - QString m_accountId; + TQString m_strCategoryName; + TQString m_strMemo; + TQString m_accountId; MyMoneySplit::reconcileFlagE m_reconcile; MyMoneyMoney m_amount; @@ -71,11 +71,11 @@ public: class Transaction { public: Transaction() : m_reconcile(MyMoneySplit::NotReconciled), m_eAction(eaNone) {} - QDate m_datePosted; - QString m_strPayee; - QString m_strMemo; - QString m_strNumber; - QString m_strBankID; + TQDate m_datePosted; + TQString m_strPayee; + TQString m_strMemo; + TQString m_strNumber; + TQString m_strBankID; MyMoneyMoney m_amount; MyMoneySplit::reconcileFlagE m_reconcile; @@ -86,30 +86,30 @@ public: MyMoneyMoney m_shares; MyMoneyMoney m_fees; MyMoneyMoney m_price; - QString m_strInterestCategory; - QString m_strBrokerageAccount; - QString m_strSymbol; - QString m_strSecurity; - QValueList<Split> m_listSplits; + TQString m_strInterestCategory; + TQString m_strBrokerageAccount; + TQString m_strSymbol; + TQString m_strSecurity; + TQValueList<Split> m_listSplits; }; struct Price { - QDate m_date; - QString m_strSecurity; + TQDate m_date; + TQString m_strSecurity; MyMoneyMoney m_amount; }; struct Security { - QString m_strName; - QString m_strSymbol; - QString m_strId; + TQString m_strName; + TQString m_strSymbol; + TQString m_strId; }; - QString m_strAccountName; - QString m_strAccountNumber; - QString m_strRoutingNumber; + TQString m_strAccountName; + TQString m_strAccountNumber; + TQString m_strRoutingNumber; /** * The statement provider's information for the statement reader how to find the @@ -119,26 +119,26 @@ public: * MyMoneyAccount object for this key. The account id of that account should be returned * here. If no id is available, leave it empty. */ - QString m_accountId; + TQString m_accountId; - QString m_strCurrency; - QDate m_dateBegin; - QDate m_dateEnd; + TQString m_strCurrency; + TQDate m_dateBegin; + TQDate m_dateEnd; MyMoneyMoney m_closingBalance; EType m_eType; - QValueList<Transaction> m_listTransactions; - QValueList<Price> m_listPrices; - QValueList<Security> m_listSecurities; + TQValueList<Transaction> m_listTransactions; + TQValueList<Price> m_listPrices; + TQValueList<Security> m_listSecurities; bool m_skipCategoryMatching; - void write(QDomElement&,QDomDocument*) const; - bool read(const QDomElement&); + void write(TQDomElement&,TQDomDocument*) const; + bool read(const TQDomElement&); - KMYMONEY_EXPORT static bool isStatementFile(const QString&); - KMYMONEY_EXPORT static bool readXMLFile( MyMoneyStatement&, const QString& ); - KMYMONEY_EXPORT static void writeXMLFile( const MyMoneyStatement&, const QString& ); + KMYMONEY_EXPORT static bool isStatementFile(const TQString&); + KMYMONEY_EXPORT static bool readXMLFile( MyMoneyStatement&, const TQString& ); + KMYMONEY_EXPORT static void writeXMLFile( const MyMoneyStatement&, const TQString& ); }; #endif diff --git a/kmymoney2/mymoney/mymoneysubject.cpp b/kmymoney2/mymoney/mymoneysubject.cpp index c54d738..8391570 100644 --- a/kmymoney2/mymoney/mymoneysubject.cpp +++ b/kmymoney2/mymoney/mymoneysubject.cpp @@ -22,7 +22,7 @@ #include "mymoneysubject.h" #include "mymoneyobserver.h" -#include <qptrvector.h> +#include <tqptrvector.h> MyMoneySubject::MyMoneySubject() { @@ -42,14 +42,14 @@ void MyMoneySubject::detach (MyMoneyObserver* o) m_observers.remove(o); } -void MyMoneySubject::notify(const QString& id) +void MyMoneySubject::notify(const TQString& id) { - QPtrList<MyMoneyObserver> ptrList = m_observers; + TQPtrList<MyMoneyObserver> ptrList = m_observers; MyMoneyObserver* i; for (i = ptrList.first(); i != 0; i = ptrList.next()) { // only call the observer if it did not detach in the meantime - if(m_observers.findRef(i) != -1) { + if(m_observers.tqfindRef(i) != -1) { // qDebug("call observer @ 0x%08lX with '%s'", (unsigned long)i, id.data()); i->update(id); } diff --git a/kmymoney2/mymoney/mymoneysubject.h b/kmymoney2/mymoney/mymoneysubject.h index 74b8290..5b051e4 100644 --- a/kmymoney2/mymoney/mymoneysubject.h +++ b/kmymoney2/mymoney/mymoneysubject.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qptrlist.h> +#include <tqptrlist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -34,7 +34,7 @@ #include <kmymoney/export.h> class MyMoneyObserver; -class QString; +class TQString; /** * This is the base class to be used to construct a @@ -47,13 +47,13 @@ public: virtual ~MyMoneySubject(); virtual void attach(MyMoneyObserver*); virtual void detach(MyMoneyObserver*); - virtual void notify(const QString& id); + virtual void notify(const TQString& id); protected: MyMoneySubject(); private: - QPtrList<MyMoneyObserver> m_observers; + TQPtrList<MyMoneyObserver> m_observers; }; #endif diff --git a/kmymoney2/mymoney/mymoneytransaction.cpp b/kmymoney2/mymoney/mymoneytransaction.cpp index 10b4c08..662a9c8 100644 --- a/kmymoney2/mymoney/mymoneytransaction.cpp +++ b/kmymoney2/mymoney/mymoneytransaction.cpp @@ -29,25 +29,25 @@ MyMoneyTransaction::MyMoneyTransaction() : MyMoneyObject() { m_nextSplitID = 1; - m_entryDate = QDate(); - m_postDate = QDate(); + m_entryDate = TQDate(); + m_postDate = TQDate(); } -MyMoneyTransaction::MyMoneyTransaction(const QString id, const MyMoneyTransaction& transaction) : +MyMoneyTransaction::MyMoneyTransaction(const TQString id, const MyMoneyTransaction& transaction) : MyMoneyObject(id) { *this = transaction; m_id = id; - if(m_entryDate == QDate()) - m_entryDate = QDate::currentDate(); + if(m_entryDate == TQDate()) + m_entryDate = TQDate::tqcurrentDate(); - QValueList<MyMoneySplit>::Iterator it; + TQValueList<MyMoneySplit>::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { (*it).setTransactionId(id); } } -MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool forceId) : +MyMoneyTransaction::MyMoneyTransaction(const TQDomElement& node, const bool forceId) : MyMoneyObject(node, forceId) { if("TRANSACTION" != node.tagName()) @@ -57,17 +57,17 @@ MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool force m_postDate = stringToDate(node.attribute("postdate")); m_entryDate = stringToDate(node.attribute("entrydate")); - m_bankID = QStringEmpty(node.attribute("bankid")); - m_memo = QStringEmpty(node.attribute("memo")); - m_commodity = QStringEmpty(node.attribute("commodity")); + m_bankID = TQStringEmpty(node.attribute("bankid")); + m_memo = TQStringEmpty(node.attribute("memo")); + m_commodity = TQStringEmpty(node.attribute("commodity")); - QDomNode child = node.firstChild(); + TQDomNode child = node.firstChild(); while ( !child.isNull() && child.isElement() ) { - QDomElement c = child.toElement(); + TQDomElement c = child.toElement(); if(c.tagName() == "SPLITS") { // Process any split information found inside the transaction entry. - QDomNodeList nodeList = c.elementsByTagName("SPLIT"); + TQDomNodeList nodeList = c.elementsByTagName("SPLIT"); for(unsigned int i = 0; i < nodeList.count(); ++i) { MyMoneySplit s(nodeList.item(i).toElement()); if(!m_bankID.isEmpty()) @@ -84,7 +84,7 @@ MyMoneyTransaction::MyMoneyTransaction(const QDomElement& node, const bool force } child = child.nextSibling(); } - m_bankID = QString(); + m_bankID = TQString(); } MyMoneyTransaction::~MyMoneyTransaction() @@ -102,9 +102,9 @@ bool MyMoneyTransaction::operator == (const MyMoneyTransaction& right) const (m_postDate == right.m_postDate) ); } -bool MyMoneyTransaction::accountReferenced(const QString& id) const +bool MyMoneyTransaction::accountReferenced(const TQString& id) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).accountId() == id) @@ -119,7 +119,7 @@ void MyMoneyTransaction::addSplit(MyMoneySplit& split) throw new MYMONEYEXCEPTION("Cannot add split with assigned id (" + split.id() + ")"); /* - QValueList<MyMoneySplit>::Iterator it; + TQValueList<MyMoneySplit>::Iterator it; // if the account referenced in this split is already // referenced in another split, we add the amount of @@ -151,9 +151,9 @@ void MyMoneyTransaction::modifySplit(MyMoneySplit& split) // by another split, the values will be added and the // duplicate removed. /* - QValueList<MyMoneySplit>::Iterator it; - QValueList<MyMoneySplit>::Iterator self = m_splits.end(); - QValueList<MyMoneySplit>::Iterator dup = self; + TQValueList<MyMoneySplit>::Iterator it; + TQValueList<MyMoneySplit>::Iterator self = m_splits.end(); + TQValueList<MyMoneySplit>::Iterator dup = self; bool duplicateAccount = false; for(it = m_splits.begin(); it != m_splits.end(); ++it) { @@ -181,19 +181,19 @@ void MyMoneyTransaction::modifySplit(MyMoneySplit& split) if(split.accountId().isEmpty()) throw new MYMONEYEXCEPTION("Cannot modify split that does not contain an account reference"); - QValueList<MyMoneySplit>::Iterator it; + TQValueList<MyMoneySplit>::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(split.id() == (*it).id()) { *it = split; return; } } - throw new MYMONEYEXCEPTION(QString("Invalid split id '%1'").arg(split.id())); + throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id())); } void MyMoneyTransaction::removeSplit(const MyMoneySplit& split) { - QValueList<MyMoneySplit>::Iterator it; + TQValueList<MyMoneySplit>::Iterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(split.id() == (*it).id()) { @@ -202,7 +202,7 @@ void MyMoneyTransaction::removeSplit(const MyMoneySplit& split) } } if(it == m_splits.end()) - throw new MYMONEYEXCEPTION(QString("Invalid split id '%1'").arg(split.id())); + throw new MYMONEYEXCEPTION(TQString("Invalid split id '%1'").tqarg(split.id())); } void MyMoneyTransaction::removeSplits(void) @@ -211,20 +211,20 @@ void MyMoneyTransaction::removeSplits(void) m_nextSplitID = 1; } -const MyMoneySplit& MyMoneyTransaction::splitByPayee(const QString& payeeId) const +const MyMoneySplit& MyMoneyTransaction::splitByPayee(const TQString& payeeId) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).payeeId() == payeeId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for payee '%1'").arg(QString(payeeId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for payee '%1'").tqarg(TQString(payeeId))); } -const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QString& accountId, const bool match) const +const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQString& accountId, const bool match) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if(match == true && (*it).accountId() == accountId) @@ -232,51 +232,51 @@ const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QString& accountId, if(match == false && (*it).accountId() != accountId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for account %1%2").arg(match?"":"!").arg(QString(accountId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%2").tqarg(match?"":"!").tqarg(TQString(accountId))); } -const MyMoneySplit& MyMoneyTransaction::splitByAccount(const QStringList& accountIds, const bool match) const +const MyMoneySplit& MyMoneyTransaction::splitByAccount(const TQStringList& accountIds, const bool match) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { - if(match == true && accountIds.contains((*it).accountId()) ) + if(match == true && accountIds.tqcontains((*it).accountId()) ) return *it; - if(match == false && !accountIds.contains((*it).accountId())) + if(match == false && !accountIds.tqcontains((*it).accountId())) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for account %1%1...%2").arg(match?"":"!").arg(accountIds.front(),accountIds.back())); + throw new MYMONEYEXCEPTION(TQString("Split not found for account %1%1...%2").tqarg(match?"":"!").tqarg(accountIds.front(),accountIds.back())); } -const MyMoneySplit& MyMoneyTransaction::splitById(const QString& splitId) const +const MyMoneySplit& MyMoneyTransaction::splitById(const TQString& splitId) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).id() == splitId) return *it; } - throw new MYMONEYEXCEPTION(QString("Split not found for id '%1'").arg(QString(splitId))); + throw new MYMONEYEXCEPTION(TQString("Split not found for id '%1'").tqarg(TQString(splitId))); } -const QString MyMoneyTransaction::nextSplitID() +const TQString MyMoneyTransaction::nextSplitID() { - QString id; - id = "S" + id.setNum(m_nextSplitID++).rightJustify(SPLIT_ID_SIZE, '0'); + TQString id; + id = "S" + TQString(id.setNum(m_nextSplitID++)).rightJustify(SPLIT_ID_SIZE, '0'); return id; } -const QString MyMoneyTransaction::firstSplitID() +const TQString MyMoneyTransaction::firstSplitID() { - QString id; - id = "S" + id.setNum(1).rightJustify(SPLIT_ID_SIZE, '0'); + TQString id; + id = "S" + TQString(id.setNum(1)).rightJustify(SPLIT_ID_SIZE, '0'); return id; } const MyMoneyMoney MyMoneyTransaction::splitSum(void) const { MyMoneyMoney result(0); - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { result += (*it).value(); @@ -284,14 +284,14 @@ const MyMoneyMoney MyMoneyTransaction::splitSum(void) const return result; } -void MyMoneyTransaction::setPostDate(const QDate& date) { m_postDate = date; } -void MyMoneyTransaction::setEntryDate(const QDate& date) { m_entryDate = date; } -void MyMoneyTransaction::setMemo(const QString& memo) { m_memo = memo; } +void MyMoneyTransaction::setPostDate(const TQDate& date) { m_postDate = date; } +void MyMoneyTransaction::setEntryDate(const TQDate& date) { m_entryDate = date; } +void MyMoneyTransaction::setMemo(const TQString& memo) { m_memo = memo; } bool MyMoneyTransaction::isLoanPayment(void) const { try { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAmortizationSplit()) @@ -307,7 +307,7 @@ const MyMoneySplit& MyMoneyTransaction::amortizationSplit(void) const { static MyMoneySplit nullSplit; - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAmortizationSplit() && (*it).isAutoCalc()) @@ -320,7 +320,7 @@ const MyMoneySplit& MyMoneyTransaction::interestSplit(void) const { static MyMoneySplit nullSplit; - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isInterestSplit() && (*it).isAutoCalc()) @@ -329,12 +329,12 @@ const MyMoneySplit& MyMoneyTransaction::interestSplit(void) const return nullSplit; } -unsigned long MyMoneyTransaction::hash(const QString& txt, unsigned long h) +unsigned long MyMoneyTransaction::hash(const TQString& txt, unsigned long h) { unsigned long g; for(unsigned i=0; i < txt.length(); ++i) { - unsigned short uc = txt[i].unicode(); + unsigned short uc = txt[i].tqunicode(); for(unsigned j = 0; j < 2; ++j) { unsigned char c = uc & 0xff; // if either the cell or the row of the Unicode char is 0, stop processing @@ -358,7 +358,7 @@ bool MyMoneyTransaction::isStockSplit(void) const bool MyMoneyTransaction::isImported(void) const { - return value("Imported").lower() == QString("true"); + return value("Imported").lower() == TQString("true"); } void MyMoneyTransaction::setImported(bool state) @@ -384,7 +384,7 @@ bool MyMoneyTransaction::isDuplicate(const MyMoneyTransaction& r) const for(int i = 0; i < 2; ++i) accHash[i] = valHash[i] = numHash[i] = 0; - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = splits().begin(); it != splits().end(); ++it) { accHash[0] += hash((*it).accountId()); valHash[0] += hash((*it).value().formatMoney("", 4)); @@ -408,9 +408,9 @@ bool MyMoneyTransaction::isDuplicate(const MyMoneyTransaction& r) const return rc; } -void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) const +void MyMoneyTransaction::writeXML(TQDomDocument& document, TQDomElement& tqparent) const { - QDomElement el = document.createElement("TRANSACTION"); + TQDomElement el = document.createElement("TRANSACTION"); writeBaseXML(document, el); @@ -419,8 +419,8 @@ void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) c el.setAttribute("entrydate", dateToString(m_entryDate)); el.setAttribute("commodity", m_commodity); - QDomElement splits = document.createElement("SPLITS"); - QValueList<MyMoneySplit>::ConstIterator it; + TQDomElement splits = document.createElement("SPLITS"); + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { (*it).writeXML(document, splits); } @@ -428,12 +428,12 @@ void MyMoneyTransaction::writeXML(QDomDocument& document, QDomElement& parent) c MyMoneyKeyValueContainer::writeXML(document, el); - parent.appendChild(el); + tqparent.appendChild(el); } -bool MyMoneyTransaction::hasReferenceTo(const QString& id) const +bool MyMoneyTransaction::hasReferenceTo(const TQString& id) const { - QValueList<MyMoneySplit>::const_iterator it; + TQValueList<MyMoneySplit>::const_iterator it; bool rc = (id == m_commodity); for(it = m_splits.begin(); rc == false && it != m_splits.end(); ++it) { rc = (*it).hasReferenceTo(id); @@ -443,7 +443,7 @@ bool MyMoneyTransaction::hasReferenceTo(const QString& id) const bool MyMoneyTransaction::hasAutoCalcSplit(void) const { - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; for(it = m_splits.begin(); it != m_splits.end(); ++it) { if((*it).isAutoCalc()) @@ -452,33 +452,33 @@ bool MyMoneyTransaction::hasAutoCalcSplit(void) const return false; } -QString MyMoneyTransaction::accountSignature(bool includeSplitCount) const +TQString MyMoneyTransaction::accountSignature(bool includeSplitCount) const { - QMap<QString, int> accountList; - QValueList<MyMoneySplit>::const_iterator it_s; + TQMap<TQString, int> accountList; + TQValueList<MyMoneySplit>::const_iterator it_s; for(it_s = m_splits.begin(); it_s != m_splits.end(); ++it_s) { accountList[(*it_s).accountId()] += 1; } - QMap<QString, int>::const_iterator it_a; - QString rc; + TQMap<TQString, int>::const_iterator it_a; + TQString rc; for(it_a = accountList.begin(); it_a != accountList.end(); ++it_a) { if(it_a != accountList.begin()) rc += "-"; rc += it_a.key(); if(includeSplitCount) - rc += QString("*%1").arg(*it_a); + rc += TQString("*%1").tqarg(*it_a); } return rc; } -QString MyMoneyTransaction::uniqueSortKey(void) const +TQString MyMoneyTransaction::uniqueSortKey(void) const { - QString year, month, day, key; - const QDate& postdate = postDate(); - year = year.setNum(postdate.year()).rightJustify(YEAR_SIZE, '0'); - month = month.setNum(postdate.month()).rightJustify(MONTH_SIZE, '0'); - day = day.setNum(postdate.day()).rightJustify(DAY_SIZE, '0'); + TQString year, month, day, key; + const TQDate& postdate = postDate(); + year = TQString(year.setNum(postdate.year())).rightJustify(YEAR_SIZE, '0'); + month = TQString(month.setNum(postdate.month())).rightJustify(MONTH_SIZE, '0'); + day = TQString(day.setNum(postdate.day())).rightJustify(DAY_SIZE, '0'); key = year + "-" + month + "-" + day + "-" + m_id; return key; } diff --git a/kmymoney2/mymoney/mymoneytransaction.h b/kmymoney2/mymoney/mymoneytransaction.h index ce52779..21c28ea 100644 --- a/kmymoney2/mymoney/mymoneytransaction.h +++ b/kmymoney2/mymoney/mymoneytransaction.h @@ -26,10 +26,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qptrlist.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqptrlist.h> +#include <tqstringlist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -43,7 +43,7 @@ /** * This class represents a transaction within the MyMoneyEngine. A transaction * contains none, one or more splits of type MyMoneySplit. They are stored in - * a QValueList<MyMoneySplit> within this object. A transaction containing only + * a TQValueList<MyMoneySplit> within this object. A transaction containing only * a single split with an amount not equal to 0 is an unbalanced transaction. It * is tolerated by the engine, but in general not a good idea as it is financially * wrong. @@ -52,35 +52,35 @@ class KMYMONEY_EXPORT MyMoneyTransaction : public MyMoneyObject, public MyMoneyK { public: MyMoneyTransaction(); - MyMoneyTransaction(const QString id, + MyMoneyTransaction(const TQString id, const MyMoneyTransaction& transaction); /** - * @param node reference to QDomNode - * @param forceId see MyMoneyObject(const QDomElement&, const bool) + * @param node reference to TQDomNode + * @param forceId see MyMoneyObject(const TQDomElement&, const bool) */ - MyMoneyTransaction(const QDomElement& node, const bool forceId = true); + MyMoneyTransaction(const TQDomElement& node, const bool forceId = true); ~MyMoneyTransaction(); public: - friend QDataStream &operator<<(QDataStream &, MyMoneyTransaction &); - friend QDataStream &operator>>(QDataStream &, MyMoneyTransaction &); + friend TQDataStream &operator<<(TQDataStream &, MyMoneyTransaction &); + friend TQDataStream &operator>>(TQDataStream &, MyMoneyTransaction &); // Simple get operations - const QDate& entryDate(void) const { return m_entryDate; }; - const QDate& postDate(void) const { return m_postDate; }; - const QString& memo(void) const { return m_memo; }; - const QValueList<MyMoneySplit>& splits(void) const { return m_splits; }; - QValueList<MyMoneySplit>& splits(void) { return m_splits; }; + const TQDate& entryDate(void) const { return m_entryDate; }; + const TQDate& postDate(void) const { return m_postDate; }; + const TQString& memo(void) const { return m_memo; }; + const TQValueList<MyMoneySplit>& splits(void) const { return m_splits; }; + TQValueList<MyMoneySplit>& splits(void) { return m_splits; }; unsigned int splitCount(void) const { return m_splits.count(); }; - const QString& commodity(void) const { return m_commodity; }; - const QString& bankID(void) const /*__attribute__ ((deprecated))*/ { return m_bankID; }; + const TQString& commodity(void) const { return m_commodity; }; + const TQString& bankID(void) const /*__attribute__ ((deprecated))*/ { return m_bankID; }; // Simple set operations - void setPostDate(const QDate& date); - void setEntryDate(const QDate& date); - void setMemo(const QString& memo); - void setCommodity(const QString& commodityId) { m_commodity = commodityId; }; - void setBankID(const QString& bankID) /*__attribute__ ((deprecated))*/ { m_bankID = bankID; }; + void setPostDate(const TQDate& date); + void setEntryDate(const TQDate& date); + void setMemo(const TQString& memo); + void setCommodity(const TQString& commodityId) { m_commodity = commodityId; }; + void setBankID(const TQString& bankID) /*__attribute__ ((deprecated))*/ { m_bankID = bankID; }; bool operator == (const MyMoneyTransaction&) const; inline bool operator != (const MyMoneyTransaction& r) const { return !(*this == r); }; @@ -100,7 +100,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByAccount(const QString& accountId, const bool match = true) const; + const MyMoneySplit& splitByAccount(const TQString& accountId, const bool match = true) const; /** * This method is essentially the same as the previous method, except that @@ -112,7 +112,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByAccount(const QStringList& accountIds, const bool match = true) const; + const MyMoneySplit& splitByAccount(const TQStringList& accountIds, const bool match = true) const; /** * This method is used to extract a split from a transaction. @@ -121,7 +121,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitById(const QString& splitId) const; + const MyMoneySplit& splitById(const TQString& splitId) const; /** * This method is used to extract a split for a given payeeId @@ -131,7 +131,7 @@ public: * * @return reference to split within the transaction is returned */ - const MyMoneySplit& splitByPayee(const QString& payeeId) const; + const MyMoneySplit& splitByPayee(const TQString& payeeId) const; /** * This method is used to check if the given account is used @@ -139,7 +139,7 @@ public: * * @param id account id that should be checked for usage */ - bool accountReferenced(const QString& id) const; + bool accountReferenced(const TQString& id) const; /** * This method is used to add a split to the transaction. The split @@ -237,11 +237,11 @@ public: * out the split that references the account through which a transaction * was entered. * - * @return QString with ID of the first split of transactions + * @return TQString with ID of the first split of transactions */ - static const QString firstSplitID(void); + static const TQString firstSplitID(void); - void writeXML(QDomDocument& document, QDomElement& parent) const; + void writeXML(TQDomDocument& document, TQDomElement& tqparent) const; /** * This method checks if a reference to the given object exists. It returns, @@ -252,7 +252,7 @@ public: * @retval true This object references object with id @p id. * @retval false This object does not reference the object with id @p id. */ - virtual bool hasReferenceTo(const QString& id) const; + virtual bool hasReferenceTo(const TQString& id) const; /** * Checks whether any split contains an autocalc split. @@ -277,9 +277,9 @@ public: * the number of splits referencing this account. The default for * this parameter is @p false. */ - QString accountSignature(bool includeSplitCount = false) const; + TQString accountSignature(bool includeSplitCount = false) const; - QString uniqueSortKey(void) const; + TQString uniqueSortKey(void) const; /** * This module implements an algorithm used by P.J. Weinberger @@ -293,13 +293,13 @@ public: * @param h initial hash value (default 0) * @return non-unique hash value of the text @p txt */ - static unsigned long hash(const QString& txt, unsigned long h = 0); + static unsigned long hash(const TQString& txt, unsigned long h = 0); private: /** * This method returns the next id to be used for a split */ - const QString nextSplitID(void); + const TQString nextSplitID(void); private: static const int SPLIT_ID_SIZE = 4; @@ -308,22 +308,22 @@ private: * This member contains the date when the transaction was entered * into the engine */ - QDate m_entryDate; + TQDate m_entryDate; /** * This member contains the date the transaction was posted */ - QDate m_postDate; + TQDate m_postDate; /** * This member keeps the memo text associated with this transaction */ - QString m_memo; + TQString m_memo; /** * This member contains the splits for this transaction */ - QValueList<MyMoneySplit> m_splits; + TQValueList<MyMoneySplit> m_splits; /** * This member keeps the unique numbers of splits within this @@ -335,7 +335,7 @@ private: /** * This member keeps the base commodity (e.g. currency) for this transaction */ - QString m_commodity; + TQString m_commodity; /** * This member keeps the bank's unique ID for the transaction, so we can @@ -343,7 +343,7 @@ private: * * Note this is now deprecated! Bank ID's should be set on splits, not transactions. */ - QString m_bankID; + TQString m_bankID; /** constants for unique sort key */ static const int YEAR_SIZE = 4; diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.cpp b/kmymoney2/mymoney/mymoneytransactionfilter.cpp index 317400d..d6f4b6a 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.cpp +++ b/kmymoney2/mymoney/mymoneytransactionfilter.cpp @@ -40,7 +40,7 @@ MyMoneyTransactionFilter::MyMoneyTransactionFilter() m_invertText = false; } -MyMoneyTransactionFilter::MyMoneyTransactionFilter(const QString& id) +MyMoneyTransactionFilter::MyMoneyTransactionFilter(const TQString& id) { m_filterSet.allFilter = 0; m_reportAllSplits = false; @@ -66,8 +66,8 @@ void MyMoneyTransactionFilter::clear(void) m_states.clear(); m_validity.clear(); m_matchingSplits.clear(); - m_fromDate = QDate(); - m_toDate = QDate(); + m_fromDate = TQDate(); + m_toDate = TQDate(); } void MyMoneyTransactionFilter::clearAccountFilter(void) @@ -76,26 +76,26 @@ void MyMoneyTransactionFilter::clearAccountFilter(void) m_accounts.clear(); } -void MyMoneyTransactionFilter::setTextFilter(const QRegExp& text, bool invert) +void MyMoneyTransactionFilter::setTextFilter(const TQRegExp& text, bool invert) { m_filterSet.singleFilter.textFilter = 1; m_invertText = invert; m_text = text; } -void MyMoneyTransactionFilter::addAccount(const QStringList& ids) +void MyMoneyTransactionFilter::addAccount(const TQStringList& ids) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; m_filterSet.singleFilter.accountFilter = 1; for(it = ids.begin(); it != ids.end(); ++it) addAccount(*it); } -void MyMoneyTransactionFilter::addAccount(const QString& id) +void MyMoneyTransactionFilter::addAccount(const TQString& id) { if(!m_accounts.isEmpty() && !id.isEmpty()) { - if(m_accounts.find(id) != 0) + if(m_accounts.tqfind(id) != 0) return; } if(m_accounts.count() >= m_accounts.size()*2) { @@ -106,19 +106,19 @@ void MyMoneyTransactionFilter::addAccount(const QString& id) m_accounts.insert(id, ""); } -void MyMoneyTransactionFilter::addCategory(const QStringList& ids) +void MyMoneyTransactionFilter::addCategory(const TQStringList& ids) { - QStringList::ConstIterator it; + TQStringList::ConstIterator it; m_filterSet.singleFilter.categoryFilter = 1; for(it = ids.begin(); it != ids.end(); ++it) addCategory(*it); } -void MyMoneyTransactionFilter::addCategory(const QString& id) +void MyMoneyTransactionFilter::addCategory(const TQString& id) { if(!m_categories.isEmpty() && !id.isEmpty()) { - if(m_categories.find(id) != 0) + if(m_categories.tqfind(id) != 0) return; } if(m_categories.count() >= m_categories.size()*2) { @@ -129,7 +129,7 @@ void MyMoneyTransactionFilter::addCategory(const QString& id) m_categories.insert(id, ""); } -void MyMoneyTransactionFilter::setDateFilter(const QDate& from, const QDate& to) +void MyMoneyTransactionFilter::setDateFilter(const TQDate& from, const TQDate& to) { m_filterSet.singleFilter.dateFilter = from.isValid() | to.isValid(); m_fromDate = from; @@ -150,10 +150,10 @@ void MyMoneyTransactionFilter::setAmountFilter(const MyMoneyMoney& from, const M } } -void MyMoneyTransactionFilter::addPayee(const QString& id) +void MyMoneyTransactionFilter::addPayee(const TQString& id) { if(!m_payees.isEmpty() && !id.isEmpty()) { - if(m_payees.find(id) != 0) + if(m_payees.tqfind(id) != 0) return; } if(m_payees.count() >= m_payees.size()*2) { @@ -167,11 +167,11 @@ void MyMoneyTransactionFilter::addPayee(const QString& id) void MyMoneyTransactionFilter::addType(const int type) { if(!m_types.isEmpty()) { - if(m_types.find(type) != 0) + if(m_types.tqfind(type) != 0) return; } // we don't have more than 4 or 5 types, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.typeFilter = 1; m_types.insert(type, ""); } @@ -179,11 +179,11 @@ void MyMoneyTransactionFilter::addType(const int type) void MyMoneyTransactionFilter::addState(const int state) { if(!m_states.isEmpty()) { - if(m_states.find(state) != 0) + if(m_states.tqfind(state) != 0) return; } // we don't have more than 4 or 5 states, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.stateFilter = 1; m_states.insert(state, ""); } @@ -191,16 +191,16 @@ void MyMoneyTransactionFilter::addState(const int state) void MyMoneyTransactionFilter::addValidity(const int type) { if(!m_validity.isEmpty()) { - if(m_validity.find(type) != 0) + if(m_validity.tqfind(type) != 0) return; } // we don't have more than 4 or 5 states, so we don't worry about - // the size of the QIntDict object. + // the size of the TQIntDict object. m_filterSet.singleFilter.validityFilter = 1; m_validity.insert(type, ""); } -void MyMoneyTransactionFilter::setNumberFilter(const QString& from, const QString& to) +void MyMoneyTransactionFilter::setNumberFilter(const TQString& from, const TQString& to) { m_filterSet.singleFilter.nrFilter = 1; m_fromNr = from; @@ -217,7 +217,7 @@ void MyMoneyTransactionFilter::setConsiderCategory(const bool check) m_considerCategory = check; } -const QValueList<MyMoneySplit>& MyMoneyTransactionFilter::matchingSplits(void) const +const TQValueList<MyMoneySplit>& MyMoneyTransactionFilter::matchingSplits(void) const { return m_matchingSplits; } @@ -230,18 +230,18 @@ bool MyMoneyTransactionFilter::matchText(const MyMoneySplit * const sp) const MyMoneyFile* file = MyMoneyFile::instance(); const MyMoneyAccount& acc = file->account(sp->accountId()); const MyMoneySecurity& sec = file->security(acc.currencyId()); - if(sp->memo().contains(m_text) - || sp->shares().formatMoney(acc.fraction(sec)).contains(m_text) - || sp->value().formatMoney(acc.fraction(sec)).contains(m_text) - || sp->number().contains(m_text)) + if(sp->memo().tqcontains(m_text) + || sp->shares().formatMoney(acc.fraction(sec)).tqcontains(m_text) + || sp->value().formatMoney(acc.fraction(sec)).tqcontains(m_text) + || sp->number().tqcontains(m_text)) return !m_invertText; - if(acc.name().contains(m_text)) + if(acc.name().tqcontains(m_text)) return !m_invertText; if(!sp->payeeId().isEmpty()) { const MyMoneyPayee& payee = file->payee(sp->payeeId()); - if(payee.name().contains(m_text)) + if(payee.name().tqcontains(m_text)) return !m_invertText; } return m_invertText; @@ -268,7 +268,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneySplit * const sp) const bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) { MyMoneyFile* file = MyMoneyFile::instance(); - QValueList<MyMoneySplit>::ConstIterator it; + TQValueList<MyMoneySplit>::ConstIterator it; m_matchingSplits.clear(); @@ -286,12 +286,12 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the date range if(m_filterSet.singleFilter.dateFilter) { - if(m_fromDate != QDate()) { + if(m_fromDate != TQDate()) { if(transaction.postDate() < m_fromDate) return false; } - if(m_toDate != QDate()) { + if(m_toDate != TQDate()) { if(transaction.postDate() > m_toDate) return false; } @@ -300,7 +300,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // construct a local list of pointers to all splits and // remove the ones that do not match account and/or categories. - QPtrList<MyMoneySplit> matchingSplits; + TQPtrList<MyMoneySplit> matchingSplits; for(it = transaction.splits().begin(); it != transaction.splits().end(); ++it) { matchingSplits.append(&(*it)); } @@ -312,7 +312,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the transaction's validity if(m_filterSet.singleFilter.validityFilter) { if(m_validity.count() > 0) { - if(!m_validity.find(validTransaction(transaction))) + if(!m_validity.tqfind(validTransaction(transaction))) return false; } } @@ -332,7 +332,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check if the split references one of the categories in the list if(m_filterSet.singleFilter.categoryFilter) { if(m_categories.count() > 0) { - if(m_categories.find(sp->accountId())) { + if(m_categories.tqfind(sp->accountId())) { categoryMatched = true; removeSplit = 0; } @@ -347,7 +347,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check if the split references one of the accounts in the list if(m_filterSet.singleFilter.accountFilter) { if(m_accounts.count() > 0) { - if(m_accounts.find(sp->accountId())) { + if(m_accounts.tqfind(sp->accountId())) { accountMatched = true; removeSplit = 0; } @@ -361,7 +361,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) } else { if(m_filterSet.singleFilter.accountFilter) { if(m_accounts.count() > 0) { - if(m_accounts.find(sp->accountId())) { + if(m_accounts.tqfind(sp->accountId())) { accountMatched = true; removeSplit = 0; } @@ -420,7 +420,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the payee list if(!removeSplit && m_filterSet.singleFilter.payeeFilter) { if(m_payees.count() > 0) { - if(sp->payeeId().isEmpty() || !m_payees.find(sp->payeeId())) + if(sp->payeeId().isEmpty() || !m_payees.tqfind(sp->payeeId())) removeSplit = sp; } else if(!sp->payeeId().isEmpty()) removeSplit = sp; @@ -429,7 +429,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the type list if(!removeSplit && m_filterSet.singleFilter.typeFilter) { if(m_types.count() > 0) { - if(!m_types.find(splitType(transaction, *sp))) + if(!m_types.tqfind(splitType(transaction, *sp))) removeSplit = sp; } } @@ -437,7 +437,7 @@ bool MyMoneyTransactionFilter::match(const MyMoneyTransaction& transaction) // check the state list if(!removeSplit && m_filterSet.singleFilter.stateFilter) { if(m_states.count() > 0) { - if(!m_states.find(splitState(*sp))) + if(!m_states.tqfind(splitState(*sp))) removeSplit = sp; } } @@ -512,7 +512,7 @@ int MyMoneyTransactionFilter::splitType(const MyMoneyTransaction& t, const MyMon return allTypes; if(t.splitCount() == 2) { - QString ida, idb; + TQString ida, idb; ida = t.splits()[0].accountId(); idb = t.splits()[1].accountId(); @@ -533,7 +533,7 @@ int MyMoneyTransactionFilter::splitType(const MyMoneyTransaction& t, const MyMon MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransaction(const MyMoneyTransaction& t) const { - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; MyMoneyMoney val; for(it_s = t.splits().begin(); it_s != t.splits().end(); ++it_s) { @@ -542,22 +542,22 @@ MyMoneyTransactionFilter::validityOptionE MyMoneyTransactionFilter::validTransac return (val == MyMoneyMoney(0,1)) ? valid : invalid; } -bool MyMoneyTransactionFilter::includesCategory( const QString& cat ) const +bool MyMoneyTransactionFilter::includesCategory( const TQString& cat ) const { - return (! m_filterSet.singleFilter.categoryFilter) || m_categories.find( cat ); + return (! m_filterSet.singleFilter.categoryFilter) || m_categories.tqfind( cat ); } -bool MyMoneyTransactionFilter::includesAccount( const QString& acc ) const +bool MyMoneyTransactionFilter::includesAccount( const TQString& acc ) const { - return (! m_filterSet.singleFilter.accountFilter) || m_accounts.find( acc ); + return (! m_filterSet.singleFilter.accountFilter) || m_accounts.tqfind( acc ); } -bool MyMoneyTransactionFilter::includesPayee( const QString& pye ) const +bool MyMoneyTransactionFilter::includesPayee( const TQString& pye ) const { - return (! m_filterSet.singleFilter.payeeFilter) || m_payees.find( pye ); + return (! m_filterSet.singleFilter.payeeFilter) || m_payees.tqfind( pye ); } -bool MyMoneyTransactionFilter::dateFilter( QDate& from, QDate& to ) const +bool MyMoneyTransactionFilter::dateFilter( TQDate& from, TQDate& to ) const { from = m_fromDate; to = m_toDate; @@ -571,20 +571,20 @@ bool MyMoneyTransactionFilter::amountFilter( MyMoneyMoney& from, MyMoneyMoney& t return m_filterSet.singleFilter.amountFilter==1; } -bool MyMoneyTransactionFilter::numberFilter( QString& from, QString& to ) const +bool MyMoneyTransactionFilter::numberFilter( TQString& from, TQString& to ) const { from = m_fromNr; to = m_toNr; return m_filterSet.singleFilter.nrFilter==1; } -bool MyMoneyTransactionFilter::payees(QStringList& list) const +bool MyMoneyTransactionFilter::payees(TQStringList& list) const { bool result = m_filterSet.singleFilter.payeeFilter; if ( result ) { - QAsciiDictIterator<char> it_payee( m_payees ); + TQAsciiDictIterator<char> it_payee( m_payees ); while ( it_payee.current() ) { list += it_payee.currentKey(); @@ -594,16 +594,16 @@ bool MyMoneyTransactionFilter::payees(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::accounts(QStringList& list) const +bool MyMoneyTransactionFilter::accounts(TQStringList& list) const { bool result = m_filterSet.singleFilter.accountFilter; if ( result ) { - QAsciiDictIterator<char> it_account( m_accounts ); + TQAsciiDictIterator<char> it_account( m_accounts ); while ( it_account.current() ) { - QString account = it_account.currentKey(); + TQString account = it_account.currentKey(); list += account; ++it_account; } @@ -611,13 +611,13 @@ bool MyMoneyTransactionFilter::accounts(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::categories(QStringList& list) const +bool MyMoneyTransactionFilter::categories(TQStringList& list) const { bool result = m_filterSet.singleFilter.categoryFilter; if ( result ) { - QAsciiDictIterator<char> it_category( m_categories ); + TQAsciiDictIterator<char> it_category( m_categories ); while ( it_category.current() ) { list += it_category.currentKey(); @@ -627,13 +627,13 @@ bool MyMoneyTransactionFilter::categories(QStringList& list) const return result; } -bool MyMoneyTransactionFilter::types(QValueList<int>& list) const +bool MyMoneyTransactionFilter::types(TQValueList<int>& list) const { bool result = m_filterSet.singleFilter.typeFilter; if ( result ) { - QIntDictIterator<char> it_type( m_types ); + TQIntDictIterator<char> it_type( m_types ); while ( it_type.current() ) { list += it_type.currentKey(); @@ -643,13 +643,13 @@ bool MyMoneyTransactionFilter::types(QValueList<int>& list) const return result; } -bool MyMoneyTransactionFilter::states(QValueList<int>& list) const +bool MyMoneyTransactionFilter::states(TQValueList<int>& list) const { bool result = m_filterSet.singleFilter.stateFilter; if ( result ) { - QIntDictIterator<char> it_state( m_states ); + TQIntDictIterator<char> it_state( m_states ); while ( it_state.current() ) { list += it_state.currentKey(); @@ -665,7 +665,7 @@ bool MyMoneyTransactionFilter::firstType(int&i) const if ( result ) { - QIntDictIterator<char> it_type( m_types ); + TQIntDictIterator<char> it_type( m_types ); if ( it_type.current() ) i = it_type.currentKey(); } @@ -678,14 +678,14 @@ bool MyMoneyTransactionFilter::firstState(int&i) const if ( result ) { - QIntDictIterator<char> it_state( m_states ); + TQIntDictIterator<char> it_state( m_states ); if ( it_state.current() ) i = it_state.currentKey(); } return result; } -bool MyMoneyTransactionFilter::textFilter(QRegExp& exp) const +bool MyMoneyTransactionFilter::textFilter(TQRegExp& exp) const { exp = m_text; return m_filterSet.singleFilter.textFilter == 1; @@ -693,7 +693,7 @@ bool MyMoneyTransactionFilter::textFilter(QRegExp& exp) const void MyMoneyTransactionFilter::setDateFilter(dateOptionE range) { - QDate from, to; + TQDate from, to; if ( translateDateRange(range,from,to) ) setDateFilter(from,to); } @@ -707,132 +707,132 @@ void MyMoneyTransactionFilter::setFiscalYearStart(int firstMonth, int firstDay) fiscalYearStartDay = firstDay; } -bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, QDate& start, QDate& end) +bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, TQDate& start, TQDate& end) { bool rc = true; int yr, mon, day; - yr = QDate::currentDate().year(); - mon = QDate::currentDate().month(); - day = QDate::currentDate().day(); - QDate tmp; + yr = TQDate::tqcurrentDate().year(); + mon = TQDate::tqcurrentDate().month(); + day = TQDate::tqcurrentDate().day(); + TQDate tmp; switch(id) { case MyMoneyTransactionFilter::allDates: - start = QDate(); - end = QDate(); + start = TQDate(); + end = TQDate(); break; case MyMoneyTransactionFilter::asOfToday: - start = QDate(); - end = QDate::currentDate(); + start = TQDate(); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::currentMonth: - start = QDate(yr,mon,1); - end = QDate(yr,mon,1).addMonths(1).addDays(-1); + start = TQDate(yr,mon,1); + end = TQDate(yr,mon,1).addMonths(1).addDays(-1); break; case MyMoneyTransactionFilter::currentYear: - start = QDate(yr,1,1); - end = QDate(yr,12,31); + start = TQDate(yr,1,1); + end = TQDate(yr,12,31); break; case MyMoneyTransactionFilter::monthToDate: - start = QDate(yr,mon,1); - end = QDate::currentDate(); + start = TQDate(yr,mon,1); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::yearToDate: - start = QDate(yr,1,1); - end = QDate::currentDate(); + start = TQDate(yr,1,1); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::yearToMonth: - start = QDate(yr,1,1); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,1,1); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::lastMonth: - start = QDate(yr,mon,1).addMonths(-1); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,mon,1).addMonths(-1); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::lastYear: - start = QDate(yr,1,1).addYears(-1); - end = QDate(yr,12,31).addYears(-1); + start = TQDate(yr,1,1).addYears(-1); + end = TQDate(yr,12,31).addYears(-1); break; case MyMoneyTransactionFilter::last7Days: - start = QDate::currentDate().addDays(-7); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addDays(-7); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last30Days: - start = QDate::currentDate().addDays(-30); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addDays(-30); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last3Months: - start = QDate::currentDate().addMonths(-3); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-3); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last6Months: - start = QDate::currentDate().addMonths(-6); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-6); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::last11Months: - start = QDate(yr,mon,1).addMonths(-12); - end = QDate(yr,mon,1).addDays(-1); + start = TQDate(yr,mon,1).addMonths(-12); + end = TQDate(yr,mon,1).addDays(-1); break; case MyMoneyTransactionFilter::last12Months: - start = QDate::currentDate().addMonths(-12); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate().addMonths(-12); + end = TQDate::tqcurrentDate(); break; case MyMoneyTransactionFilter::next7Days: - start = QDate::currentDate(); - end = QDate::currentDate().addDays(7); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addDays(7); break; case MyMoneyTransactionFilter::next30Days: - start = QDate::currentDate(); - end = QDate::currentDate().addDays(30); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addDays(30); break; case MyMoneyTransactionFilter::next3Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(3); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(3); break; case MyMoneyTransactionFilter::next6Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(6); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(6); break; case MyMoneyTransactionFilter::next12Months: - start = QDate::currentDate(); - end = QDate::currentDate().addMonths(12); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate().addMonths(12); break; case MyMoneyTransactionFilter::userDefined: - start = QDate(); - end = QDate(); + start = TQDate(); + end = TQDate(); break; case MyMoneyTransactionFilter::last3ToNext3Months: - start = QDate::currentDate().addMonths(-3); - end = QDate::currentDate().addMonths(3); + start = TQDate::tqcurrentDate().addMonths(-3); + end = TQDate::tqcurrentDate().addMonths(3); break; case MyMoneyTransactionFilter::currentQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1); + start = TQDate(yr, mon - ((mon-1) % 3), 1); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::lastQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1).addMonths(-3); + start = TQDate(yr, mon - ((mon-1) % 3), 1).addMonths(-3); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::nextQuarter: - start = QDate(yr, mon - ((mon-1) % 3), 1).addMonths(3); + start = TQDate(yr, mon - ((mon-1) % 3), 1).addMonths(3); end = start.addMonths(3).addDays(-1); break; case MyMoneyTransactionFilter::currentFiscalYear: - start = QDate(QDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(QDate::currentDate() < start) + start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::tqcurrentDate() < start) start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::lastFiscalYear: - start = QDate(QDate::currentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); - if(QDate::currentDate() < start) + start = TQDate(TQDate::tqcurrentDate().year(), fiscalYearStartMonth, fiscalYearStartDay); + if(TQDate::tqcurrentDate() < start) start = start.addYears(-1); start = start.addYears(-1); end = start.addYears(1).addDays(-1); break; case MyMoneyTransactionFilter::today: - start = QDate::currentDate(); - end = QDate::currentDate(); + start = TQDate::tqcurrentDate(); + end = TQDate::tqcurrentDate(); break; default: qFatal("Unknown date identifier %d in MyMoneyTransactionFilter::translateDateRange()", id); @@ -842,16 +842,16 @@ bool MyMoneyTransactionFilter::translateDateRange(dateOptionE id, QDate& start, return rc; } -void MyMoneyTransactionFilter::removeReference(const QString& id) +void MyMoneyTransactionFilter::removeReference(const TQString& id) { - if(m_accounts.find(id)) { - qDebug("%s", (QString("Remove account '%1' from report").arg(id)).data()); + if(m_accounts.tqfind(id)) { + qDebug("%s", (TQString("Remove account '%1' from report").tqarg(id)).data()); m_accounts.remove(id); - } else if(m_categories.find(id)) { - qDebug("%s", (QString("Remove category '%1' from report").arg(id)).data()); + } else if(m_categories.tqfind(id)) { + qDebug("%s", (TQString("Remove category '%1' from report").tqarg(id)).data()); m_categories.remove(id); - } else if(m_payees.find(id)) { - qDebug("%s", (QString("Remove payee '%1' from report").arg(id)).data()); + } else if(m_payees.tqfind(id)) { + qDebug("%s", (TQString("Remove payee '%1' from report").tqarg(id)).data()); m_payees.remove(id); } } diff --git a/kmymoney2/mymoney/mymoneytransactionfilter.h b/kmymoney2/mymoney/mymoneytransactionfilter.h index edad9cc..50226cf 100644 --- a/kmymoney2/mymoney/mymoneytransactionfilter.h +++ b/kmymoney2/mymoney/mymoneytransactionfilter.h @@ -30,12 +30,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qmap.h> -#include <qasciidict.h> -#include <qintdict.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqmap.h> +#include <tqasciidict.h> +#include <tqintdict.h> +#include <tqregexp.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -160,7 +160,7 @@ public: * * @param id reference to account id */ - MyMoneyTransactionFilter(const QString& id); + MyMoneyTransactionFilter(const TQString& id); ~MyMoneyTransactionFilter(); @@ -190,7 +190,7 @@ public: * @param invert If true, value must not be contained in any of the above mentioned fields * */ - void setTextFilter(const QRegExp& exp, bool invert = false); + void setTextFilter(const TQRegExp& exp, bool invert = false); /** * This method will add the account with id @p id to the list of matching accounts. @@ -198,13 +198,13 @@ public: * * @param id internal ID of the account */ - void addAccount(const QString& id); + void addAccount(const TQString& id); /** * This is a convenience method and behaves exactly like the above * method but for a list of id's. */ - void addAccount(const QStringList& ids); + void addAccount(const TQStringList& ids); /** * This method will add the category with id @p id to the list of matching categories. @@ -212,25 +212,25 @@ public: * * @param id internal ID of the account */ - void addCategory(const QString& id); + void addCategory(const TQString& id); /** * This is a convenience method and behaves exactly like the above * method but for a list of id's. */ - void addCategory(const QStringList& ids); + void addCategory(const TQStringList& ids); /** * This method sets the date filter to match only transactions with posting dates in - * the date range specified by @p from and @p to. If @p from equal QDate() - * all transactions with dates prior to @p to match. If @p to equals QDate() + * the date range specified by @p from and @p to. If @p from equal TQDate() + * all transactions with dates prior to @p to match. If @p to equals TQDate() * all transactions with posting dates past @p from match. If @p from and @p to - * are equal QDate() the filter is not activated and all transactions match. + * are equal TQDate() the filter is not activated and all transactions match. * * @param from from date * @param to to date */ - void setDateFilter(const QDate& from, const QDate& to); + void setDateFilter(const TQDate& from, const TQDate& to); void setDateFilter(dateOptionE range); @@ -251,7 +251,7 @@ public: * * @param id internal id of the payee */ - void addPayee(const QString& id); + void addPayee(const TQString& id); /** */ @@ -276,7 +276,7 @@ public: * * @note @p from and @p to can contain alphanumeric text */ - void setNumberFilter(const QString& from, const QString& to); + void setNumberFilter(const TQString& from, const TQString& to); /** * This method is used to check a specific transaction against the filter. @@ -355,27 +355,27 @@ public: * * @note The constructors set m_reportAllSplits differently. Please * see the documentation of the constructors MyMoneyTransactionFilter() - * and MyMoneyTransactionFilter(const QString&) for details. + * and MyMoneyTransactionFilter(const TQString&) for details. */ - const QValueList<MyMoneySplit>& matchingSplits(void) const; + const TQValueList<MyMoneySplit>& matchingSplits(void) const; /** * This method returns the from date set in the filter. If - * no value has been set up for this filter, then QDate() is + * no value has been set up for this filter, then TQDate() is * returned. * * @return returns m_fromDate */ - const QDate fromDate(void) const { return m_fromDate; }; + const TQDate fromDate(void) const { return m_fromDate; }; /** * This method returns the to date set in the filter. If - * no value has been set up for this filter, then QDate() is + * no value has been set up for this filter, then TQDate() is * returned. * * @return returns m_toDate */ - const QDate toDate(void) const { return m_toDate; }; + const TQDate toDate(void) const { return m_toDate; }; /** * This method is used to return information about the @@ -386,7 +386,7 @@ public: * @param cat id of category in question * @return true if category is in filter set, false otherwise */ - bool includesCategory( const QString& cat ) const; + bool includesCategory( const TQString& cat ) const; /** * This method is used to return information about the @@ -397,7 +397,7 @@ public: * @param acc id of account in question * @return true if account is in filter set, false otherwise */ - bool includesAccount( const QString& acc ) const; + bool includesAccount( const TQString& acc ) const; /** * This method is used to return information about the @@ -408,7 +408,7 @@ public: * @param pye id of payee in question * @return true if payee is in filter set, false otherwise */ - bool includesPayee( const QString& pye ) const; + bool includesPayee( const TQString& pye ) const; /** * This method is used to return information about the @@ -418,7 +418,7 @@ public: * @param to result value for the end of the date range * @return true if an amount filter is set */ - bool dateFilter( QDate& from, QDate& to ) const; + bool dateFilter( TQDate& from, TQDate& to ) const; /** * This method is used to return information about the @@ -438,7 +438,7 @@ public: * @param to result value for the high end of the number range * @return true if a number filter is set */ - bool numberFilter( QString& from, QString& to ) const; + bool numberFilter( TQString& from, TQString& to ) const; /** * This method returns whether a payee filter has been set, @@ -447,7 +447,7 @@ public: * @param list list to append payees into * @return return true if a payee filter has been set */ - bool payees(QStringList& list) const; + bool payees(TQStringList& list) const; /** * This method returns whether an account filter has been set, @@ -456,7 +456,7 @@ public: * @param list list to append accounts into * @return return true if an account filter has been set */ - bool accounts(QStringList& list) const; + bool accounts(TQStringList& list) const; /** * This method returns whether a category filter has been set, @@ -465,7 +465,7 @@ public: * @param list list to append categories into * @return return true if a category filter has been set */ - bool categories(QStringList& list) const; + bool categories(TQStringList& list) const; /** * This method returns whether a type filter has been set, @@ -476,7 +476,7 @@ public: */ bool firstType(int& i) const; - bool types(QValueList<int>& list) const; + bool types(TQValueList<int>& list) const; /** * This method returns whether a state filter has been set, @@ -487,7 +487,7 @@ public: */ bool firstState(int& i) const; - bool states(QValueList<int>& list) const; + bool states(TQValueList<int>& list) const; /** * This method returns whether a text filter has been set, * and if so, it returns the text filter. @@ -495,7 +495,7 @@ public: * @param text regexp to replace with text filter, or blank if none set * @return return true if a text filter has been set */ - bool textFilter(QRegExp& text) const; + bool textFilter(TQRegExp& text) const; /** * This method returns whether the text filter should return @@ -504,15 +504,15 @@ public: bool isInvertingText(void) const {return m_invertText;}; /** - * This method translates a plain-language date range into QDate + * This method translates a plain-language date range into TQDate * start & end * * @param range Plain-language range of dates, e.g. 'CurrentYear' - * @param start QDate will be set to corresponding to the first date in @p range - * @param end QDate will be set to corresponding to the last date in @p range + * @param start TQDate will be set to corresponding to the first date in @p range + * @param end TQDate will be set to corresponding to the last date in @p range * @return return true if a range was successfully set, or false if @p range was invalid */ - static bool translateDateRange(dateOptionE range, QDate& start, QDate& end); + static bool translateDateRange(dateOptionE range, TQDate& start, TQDate& end); static void setFiscalYearStart(int firstMonth, int firstDay); @@ -522,7 +522,7 @@ public: * This member removes all references to object identified by @p id. Used * to remove objects which are about to be removed from the engine. */ - void removeReference(const QString& id); + void removeReference(const TQString& id); private: /** @@ -561,18 +561,18 @@ protected: bool m_reportAllSplits; bool m_considerCategory; - QRegExp m_text; + TQRegExp m_text; bool m_invertText; - QAsciiDict<char> m_accounts; - QAsciiDict<char> m_payees; - QAsciiDict<char> m_categories; - QIntDict<char> m_states; - QIntDict<char> m_types; - QIntDict<char> m_validity; - QString m_fromNr, m_toNr; - QDate m_fromDate, m_toDate; + TQAsciiDict<char> m_accounts; + TQAsciiDict<char> m_payees; + TQAsciiDict<char> m_categories; + TQIntDict<char> m_states; + TQIntDict<char> m_types; + TQIntDict<char> m_validity; + TQString m_fromNr, m_toNr; + TQDate m_fromDate, m_toDate; MyMoneyMoney m_fromAmount, m_toAmount; - QValueList<MyMoneySplit> m_matchingSplits; + TQValueList<MyMoneySplit> m_matchingSplits; }; #endif diff --git a/kmymoney2/mymoney/mymoneytransactiontest.cpp b/kmymoney2/mymoney/mymoneytransactiontest.cpp index 11af6b3..155dfe0 100644 --- a/kmymoney2/mymoney/mymoneytransactiontest.cpp +++ b/kmymoney2/mymoney/mymoneytransactiontest.cpp @@ -31,16 +31,16 @@ void MyMoneyTransactionTest::tearDown () { void MyMoneyTransactionTest::testEmptyConstructor() { CPPUNIT_ASSERT(m->id().isEmpty()); - CPPUNIT_ASSERT(m->entryDate() == QDate()); + CPPUNIT_ASSERT(m->entryDate() == TQDate()); CPPUNIT_ASSERT(m->memo().isEmpty()); CPPUNIT_ASSERT(m->splits().count() == 0); } void MyMoneyTransactionTest::testSetFunctions() { m->setMemo("Memo"); - m->setPostDate(QDate(1,2,3)); + m->setPostDate(TQDate(1,2,3)); - CPPUNIT_ASSERT(m->postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(m->postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(m->memo() == "Memo"); } @@ -49,9 +49,9 @@ void MyMoneyTransactionTest::testConstructor() { MyMoneyTransaction a("ID", *m); CPPUNIT_ASSERT(a.id() == "ID"); - CPPUNIT_ASSERT(a.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(a.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(a.memo() == "Memo"); - CPPUNIT_ASSERT(a.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(a.postDate() == TQDate(1,2,3)); } void MyMoneyTransactionTest::testCopyConstructor() { @@ -62,9 +62,9 @@ void MyMoneyTransactionTest::testCopyConstructor() { MyMoneyTransaction n(a); CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); } @@ -78,9 +78,9 @@ void MyMoneyTransactionTest::testAssignmentConstructor() { n = a; CPPUNIT_ASSERT(n.id() == "ID"); - CPPUNIT_ASSERT(n.entryDate() == QDate::currentDate()); + CPPUNIT_ASSERT(n.entryDate() == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(n.memo() == "Memo"); - CPPUNIT_ASSERT(n.postDate() == QDate(1,2,3)); + CPPUNIT_ASSERT(n.postDate() == TQDate(1,2,3)); CPPUNIT_ASSERT(n.value("Key") == "Value"); } @@ -98,7 +98,7 @@ void MyMoneyTransactionTest::testInequality() { MyMoneyTransaction n(*m); - n.setPostDate(QDate(1,1,1)); + n.setPostDate(TQDate(1,1,1)); CPPUNIT_ASSERT(!(n == *m)); CPPUNIT_ASSERT(n != *m); @@ -259,7 +259,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should fail, as the account is not referenced by // any split in the transaction try { - split = m->splitByAccount(QString("A000003")); + split = m->splitByAccount(TQString("A000003")); CPPUNIT_FAIL("Exception expected"); } catch(MyMoneyException *e) { delete e; @@ -267,7 +267,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should be found try { - split = m->splitByAccount(QString("A000002")); + split = m->splitByAccount(TQString("A000002")); CPPUNIT_ASSERT(split.id() == "S0002"); } catch(MyMoneyException *e) { @@ -277,7 +277,7 @@ void MyMoneyTransactionTest::testExtractSplit() { // this one should be found also try { - split = m->splitByAccount(QString("A000002"), false); + split = m->splitByAccount(TQString("A000002"), false); CPPUNIT_ASSERT(split.id() == "S0001"); } catch(MyMoneyException *e) { CPPUNIT_FAIL("Unexpected exception!"); @@ -373,7 +373,7 @@ void MyMoneyTransactionTest::testModifyDuplicateAccount() { testAddSplits(); MyMoneySplit split; - split = m->splitByAccount(QString("A000002")); + split = m->splitByAccount(TQString("A000002")); split.setAccountId("A000001"); try { m->modifySplit(split); @@ -387,8 +387,8 @@ void MyMoneyTransactionTest::testModifyDuplicateAccount() { } void MyMoneyTransactionTest::testWriteXML() { MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -404,12 +404,12 @@ void MyMoneyTransactionTest::testWriteXML() { s.setBankID("SPID"); t.addSplit(s); - QDomDocument doc("TEST"); - QDomElement el = doc.createElement("TRANSACTION-CONTAINER"); + TQDomDocument doc("TEST"); + TQDomElement el = doc.createElement("TRANSACTION-CONTAINER"); doc.appendChild(el); t.writeXML(doc, el); - QString ref = QString( + TQString ref = TQString( "<!DOCTYPE TEST>\n" "<TRANSACTION-CONTAINER>\n" " <TRANSACTION postdate=\"2001-12-28\" memo=\"Wohnung:Miete\" id=\"T000000000000000001\" commodity=\"EUR\" entrydate=\"2003-09-29\" >\n" @@ -430,7 +430,7 @@ void MyMoneyTransactionTest::testWriteXML() { void MyMoneyTransactionTest::testReadXML() { MyMoneyTransaction t; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<TRANSACTION-CONTAINER>\n" " <TRANSACTION postdate=\"2001-12-28\" memo=\"Wohnung:Miete\" id=\"T000000000000000001\" commodity=\"EUR\" entrydate=\"2003-09-29\" >\n" @@ -444,7 +444,7 @@ void MyMoneyTransactionTest::testReadXML() { "</TRANSACTION-CONTAINER>\n" ); - QString ref_false = QString( + TQString ref_false = TQString( "<!DOCTYPE TEST>\n" "<TRANSACTION-CONTAINER>\n" " <TRANS-ACTION postdate=\"2001-12-28\" memo=\"Wohnung:Miete\" id=\"T000000000000000001\" commodity=\"EUR\" entrydate=\"2003-09-29\" >\n" @@ -458,8 +458,8 @@ void MyMoneyTransactionTest::testReadXML() { "</TRANSACTION-CONTAINER>\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_false); node = doc.documentElement().firstChild().toElement(); @@ -476,8 +476,8 @@ void MyMoneyTransactionTest::testReadXML() { t.setValue("key", "VALUE"); try { t = MyMoneyTransaction(node); - CPPUNIT_ASSERT(t.m_postDate == QDate(2001,12,28)); - CPPUNIT_ASSERT(t.m_entryDate == QDate(2003,9,29)); + CPPUNIT_ASSERT(t.m_postDate == TQDate(2001,12,28)); + CPPUNIT_ASSERT(t.m_entryDate == TQDate(2003,9,29)); CPPUNIT_ASSERT(t.id() == "T000000000000000001"); CPPUNIT_ASSERT(t.m_memo == "Wohnung:Miete"); CPPUNIT_ASSERT(t.m_commodity == "EUR"); @@ -494,7 +494,7 @@ void MyMoneyTransactionTest::testReadXMLEx() { MyMoneyTransaction t; - QString ref_ok = QString( + TQString ref_ok = TQString( "<!DOCTYPE TEST>\n" "<TRANSACTION-CONTAINER>\n" "<TRANSACTION postdate=\"2010-03-05\" memo=\"\" id=\"T000000000000004189\" commodity=\"EUR\" entrydate=\"2010-03-08\" >\n" @@ -523,8 +523,8 @@ void MyMoneyTransactionTest::testReadXMLEx() "</TRANSACTION>\n" "</TRANSACTION-CONTAINER>\n" ); - QDomDocument doc; - QDomElement node; + TQDomDocument doc; + TQDomElement node; doc.setContent(ref_ok); node = doc.documentElement().firstChild().toElement(); @@ -550,8 +550,8 @@ void MyMoneyTransactionTest::testReadXMLEx() void MyMoneyTransactionTest::testHasReferenceTo() { MyMoneyTransaction t; - t.setPostDate(QDate(2001,12,28)); - t.setEntryDate(QDate(2003,9,29)); + t.setPostDate(TQDate(2001,12,28)); + t.setEntryDate(TQDate(2003,9,29)); t.setId("T000000000000000001"); t.setMemo("Wohnung:Miete"); t.setCommodity("EUR"); @@ -616,7 +616,7 @@ void MyMoneyTransactionTest::testModifyMissingAccountId() { testAddSplits(); MyMoneySplit s = m->splits()[0]; - s.setAccountId(QString()); + s.setAccountId(TQString()); try { m->modifySplit(s); diff --git a/kmymoney2/mymoney/mymoneyutils.cpp b/kmymoney2/mymoney/mymoneyutils.cpp index 3739f9a..b55c485 100644 --- a/kmymoney2/mymoney/mymoneyutils.cpp +++ b/kmymoney2/mymoney/mymoneyutils.cpp @@ -29,7 +29,7 @@ #include <cstdarg> #include <cstdlib> -#include <qregexp.h> +#include <tqregexp.h> #ifdef _CHECK_MEMORY @@ -189,7 +189,7 @@ void operator delete(void *p) throw() { if(enable==true) { CheckMemoryTable::Iterator it; - it = chkmem.table.find(p); + it = chkmem.table.tqfind(p); if(it != chkmem.table.end()) { chkmem.table.remove(it); } @@ -201,7 +201,7 @@ void operator delete [] (void *p) throw() { if(enable==true) { CheckMemoryTable::Iterator it; - it = chkmem.table.find(p); + it = chkmem.table.tqfind(p); if(it != chkmem.table.end()) { chkmem.table.remove(it); } @@ -211,13 +211,13 @@ void operator delete [] (void *p) throw() #endif // _CHECK_MEMORY -QString MyMoneyUtils::getFileExtension(QString strFileName) +TQString MyMoneyUtils::getFileExtension(TQString strFileName) { - QString strTemp; + TQString strTemp; if(!strFileName.isEmpty()) { //find last . delminator - int nLoc = strFileName.findRev('.'); + int nLoc = strFileName.tqfindRev('.'); if(nLoc != -1) { strTemp = strFileName.right(strFileName.length() - (nLoc + 1)); @@ -233,27 +233,27 @@ int MyMoneyTracer::m_onoff = 0; MyMoneyTracer::MyMoneyTracer(const char* name) { if(m_onoff) { - QRegExp exp("(.*)::(.*)"); + TQRegExp exp("(.*)::(.*)"); if(exp.search(name) != -1) { m_className = exp.cap(1); m_memberName = exp.cap(2); } else { - m_className = QString(name); - m_memberName = QString(); + m_className = TQString(name); + m_memberName = TQString(); } - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "ENTER: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } m_indentLevel += 2; } -MyMoneyTracer::MyMoneyTracer(const QString& className, const QString& memberName) : +MyMoneyTracer::MyMoneyTracer(const TQString& className, const TQString& memberName) : m_className(className), m_memberName(memberName) { if(m_onoff) { - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "ENTER: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } @@ -264,7 +264,7 @@ MyMoneyTracer::~MyMoneyTracer() { m_indentLevel -= 2; if(m_onoff) { - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1() << "LEAVE: " << m_className.latin1() << "::" << m_memberName.latin1() << std::endl; } @@ -275,7 +275,7 @@ void MyMoneyTracer::printf(const char *format, ...) const if(m_onoff) { va_list args; va_start(args, format); - QString indent; + TQString indent; indent.fill(' ', m_indentLevel); std::cerr << indent.latin1(); @@ -300,38 +300,38 @@ void MyMoneyTracer::off(void) m_onoff = 0; } -QString dateToString(const QDate& date) +TQString dateToString(const TQDate& date) { if(!date.isNull() && date.isValid()) return date.toString(Qt::ISODate); - return QString(); + return TQString(); } -QDate stringToDate(const QString& str) +TQDate stringToDate(const TQString& str) { if(str.length()) { - QDate date = QDate::fromString(str, Qt::ISODate); + TQDate date = TQDate::fromString(str, Qt::ISODate); if(!date.isNull() && date.isValid()) return date; } - return QDate(); + return TQDate(); } -QString QStringEmpty(const QString& val) +TQString TQStringEmpty(const TQString& val) { if(!val.isEmpty()) - return QString(val); + return TQString(val); - return QString(); + return TQString(); } -unsigned long extractId(const QString& txt) +unsigned long extractId(const TQString& txt) { int pos; unsigned long rc = 0; - pos = txt.find(QRegExp("\\d+"), 0); + pos = txt.tqfind(TQRegExp("\\d+"), 0); if(pos != -1) { rc = atol(txt.mid(pos)); } diff --git a/kmymoney2/mymoney/mymoneyutils.h b/kmymoney2/mymoney/mymoneyutils.h index 12bb95e..ce0eb42 100644 --- a/kmymoney2/mymoney/mymoneyutils.h +++ b/kmymoney2/mymoney/mymoneyutils.h @@ -27,9 +27,9 @@ #include <config.h> #endif -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> #include <kmymoney/export.h> #if 0 @@ -51,7 +51,7 @@ typedef std::string String; //typedef for data type to store currency with. typedef long long DLONG; -typedef QString String; +typedef TQString String; #endif // 0 void timetrace(const char *); @@ -65,7 +65,7 @@ public: ~MyMoneyUtils() {} //static function to add the correct file extension at the end of the file name - static QString getFileExtension(QString strFileName); + static TQString getFileExtension(TQString strFileName); }; @@ -75,13 +75,13 @@ public: MyMoneyTracer(const char* prettyName); #define MYMONEYTRACER(a) MyMoneyTracer a(__PRETTY_FUNCTION__) - MyMoneyTracer(const QString& className, const QString& methodName); + MyMoneyTracer(const TQString& className, const TQString& methodName); ~MyMoneyTracer(); /** * This method allows to trace a printf like formatted text * - * @param format format mask + * @param format format tqmask */ void printf(const char *format, ...) const __attribute__ ((format (__printf__, 2, 3))); @@ -90,8 +90,8 @@ public: static void onOff(int onOff); private: - QString m_className; - QString m_memberName; + TQString m_className; + TQString m_memberName; static int m_indentLevel; static int m_onoff; @@ -100,7 +100,7 @@ private: #ifdef _CHECK_MEMORY #include <cstddef> -#include <qmap.h> +#include <tqmap.h> class _CheckMemoryEntry { public: @@ -117,10 +117,10 @@ private: void *m_p; int m_line; size_t m_size; - QString m_file; + TQString m_file; }; -typedef QMap<void *, _CheckMemoryEntry> CheckMemoryTable; +typedef TQMap<void *, _CheckMemoryEntry> CheckMemoryTable; typedef void _CheckMemoryOutFunc(const char *); @@ -170,23 +170,23 @@ KMYMONEY_EXPORT void _CheckMemory_End(); * If the @p date is invalid an empty string will be returned. * * @param date const reference to date to be converted - * @return QString containing the converted date + * @return TQString containing the converted date */ -KMYMONEY_EXPORT QString dateToString(const QDate& date); +KMYMONEY_EXPORT TQString dateToString(const TQDate& date); /** - * This function returns a date as QDate object as specified by + * This function returns a date as TQDate object as specified by * the parameter @p str. @p str must be in Qt::ISODate format. - * If @p str is empty or contains an invalid date, QDate() is + * If @p str is empty or contains an invalid date, TQDate() is * returned. * * @param str date in Qt::ISODate format - * @return QDate object + * @return TQDate object */ -KMYMONEY_EXPORT QDate stringToDate(const QString& str); +KMYMONEY_EXPORT TQDate stringToDate(const TQString& str); -KMYMONEY_EXPORT QString QStringEmpty(const QString&); +KMYMONEY_EXPORT TQString TQStringEmpty(const TQString&); -KMYMONEY_EXPORT unsigned long extractId(const QString& txt); +KMYMONEY_EXPORT unsigned long extractId(const TQString& txt); #endif diff --git a/kmymoney2/mymoney/storage/imymoneyserialize.h b/kmymoney2/mymoney/storage/imymoneyserialize.h index a0c12ca..c900687 100644 --- a/kmymoney2/mymoney/storage/imymoneyserialize.h +++ b/kmymoney2/mymoney/storage/imymoneyserialize.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qvaluelist.h> +#include <tqstring.h> +#include <tqvaluelist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -59,14 +59,14 @@ public: // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; // general set functions virtual void setUser(const MyMoneyPayee& val) = 0; - virtual void setCreationDate(const QDate& val) = 0; + virtual void setCreationDate(const TQDate& val) = 0; virtual void setFileFixVersion(const unsigned int v) = 0; /** * This method is used to get a SQL reader for subsequent database access @@ -86,26 +86,26 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val) = 0; + virtual void setLastModificationDate(const TQDate& val) = 0; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList<MyMoneyAccount>& list) const = 0; + virtual void accountList(TQValueList<MyMoneyAccount>& list) const = 0; /** * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - virtual const QValueList<MyMoneyInstitution> institutionList(void) const = 0; + virtual const TQValueList<MyMoneyInstitution> institutionList(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -113,25 +113,25 @@ public: * that match the filter passed as argument. If the filter is empty, * the whole journal will be returned. * - * @param list reference to QValueList<MyMoneyTransaction> receiving + * @param list reference to TQValueList<MyMoneyTransaction> receiving * the set of transactions * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const = 0; + virtual bool isDuplicateTransaction(const TQString&) const = 0; /** * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyPayee> containing the payee information + * @return TQValueList<MyMoneyPayee> containing the payee information */ - virtual const QValueList<MyMoneyPayee> payeeList(void) const = 0; + virtual const TQValueList<MyMoneyPayee> payeeList(void) const = 0; /** * This method returns a list of the scheduled transactions @@ -139,19 +139,19 @@ public: * list of the transactions, all arguments should be used with their * default arguments. */ - virtual const QValueList<MyMoneySchedule> scheduleList(const QString& = QString(), + virtual const TQValueList<MyMoneySchedule> scheduleList(const TQString& = TQString(), const MyMoneySchedule::typeE = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE = MyMoneySchedule::STYPE_ANY, - const QDate& = QDate(), - const QDate& = QDate(), + const TQDate& = TQDate(), + const TQDate& = TQDate(), const bool = false) const = 0; /** * This method returns a list of security objects that the engine has * knowledge of. */ - virtual const QValueList<MyMoneySecurity> securityList(void) const = 0; + virtual const TQValueList<MyMoneySecurity> securityList(void) const = 0; /** * This method is used to return the standard liability account @@ -194,12 +194,12 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added * * @deprecated This method is only provided as long as we provide @@ -207,7 +207,7 @@ public: * this compatability mode this method will disappear from * this interface! */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -227,7 +227,7 @@ public: /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -244,7 +244,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString with the object. + * as TQString with the object. * * An exception will be thrown upon error conditions. * @@ -262,15 +262,15 @@ public: */ virtual void addTransaction(MyMoneyTransaction& transaction, const bool skipAccountUpdate = false) = 0; - virtual void loadAccounts(const QMap<QString, MyMoneyAccount>& map) = 0; - virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map) = 0; - virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map) = 0; - virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map) = 0; - virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map) = 0; - virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map) = 0; - virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map) = 0; - virtual void loadReports( const QMap<QString, MyMoneyReport>& reports ) = 0; - virtual void loadBudgets( const QMap<QString, MyMoneyBudget>& budgets ) = 0; + virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& map) = 0; + virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map) = 0; + virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map) = 0; + virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map) = 0; + virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map) = 0; + virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map) = 0; + virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map) = 0; + virtual void loadReports( const TQMap<TQString, MyMoneyReport>& reports ) = 0; + virtual void loadBudgets( const TQMap<TQString, MyMoneyBudget>& budgets ) = 0; virtual void loadPrices(const MyMoneyPriceList& list) = 0; virtual unsigned long accountId(void) const = 0; @@ -296,10 +296,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap<QString, QString> containing all key/value pairs of + * @return TQMap<TQString, TQString> containing all key/value pairs of * this container. */ - virtual const QMap<QString, QString> pairs(void) const = 0; + virtual const TQMap<TQString, TQString> pairs(void) const = 0; /** * This method is used to initially store a set of key/value pairs @@ -307,18 +307,18 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap<QString, QString> containing the set of + * @param list const TQMap<TQString, TQString> containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap<QString, QString>& list) = 0; + virtual void setPairs(const TQMap<TQString, TQString>& list) = 0; - virtual const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, + virtual const TQValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to retrieve the list of all currencies @@ -326,9 +326,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList<MyMoneySecurity> currencyList(void) const = 0; + virtual const TQValueList<MyMoneySecurity> currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -336,9 +336,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList<MyMoneyReport> reportList( void ) const = 0; + virtual const TQValueList<MyMoneyReport> reportList( void ) const = 0; /** * This method is used to retrieve the list of all budgets @@ -346,9 +346,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList<MyMoneyBudget> budgetList( void ) const = 0; + virtual const TQValueList<MyMoneyBudget> budgetList( void ) const = 0; /** diff --git a/kmymoney2/mymoney/storage/imymoneystorage.cpp b/kmymoney2/mymoney/storage/imymoneystorage.cpp index dc67726..f70de9c 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.cpp +++ b/kmymoney2/mymoney/storage/imymoneystorage.cpp @@ -25,7 +25,7 @@ bool MyMoneyFileBitArray::testBit(uint index) const { if(index < size()) - return QBitArray::testBit(index); + return TQBitArray::testBit(index); return false; } diff --git a/kmymoney2/mymoney/storage/imymoneystorage.h b/kmymoney2/mymoney/storage/imymoneystorage.h index a4e55dd..a4ff2af 100644 --- a/kmymoney2/mymoney/storage/imymoneystorage.h +++ b/kmymoney2/mymoney/storage/imymoneystorage.h @@ -26,8 +26,8 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qbitarray.h> +#include <tqstring.h> +#include <tqbitarray.h> // ---------------------------------------------------------------------------- // Project Includes @@ -48,15 +48,15 @@ /** * @author Thomas Baumgart * - * A simple replacement for QBitArray that does not bark if testBit() + * A simple replacement for TQBitArray that does not bark if testBit() * is called with an index out of bounds. It silently returns false * in that case, otherwise calls the base classes implementation. */ -class MyMoneyFileBitArray : public QBitArray +class MyMoneyFileBitArray : public TQBitArray { public: - MyMoneyFileBitArray() : QBitArray() {} - MyMoneyFileBitArray(int size) : QBitArray(size) {} + MyMoneyFileBitArray() : TQBitArray() {} + MyMoneyFileBitArray(int size) : TQBitArray(size) {} bool testBit(uint index) const; bool operator[](int index) const { return testBit(index); } bool at(uint index) const { return testBit(index); } @@ -96,15 +96,15 @@ public: #define STD_ACC_ASSET "AStd::Asset" #define STD_ACC_EXPENSE "AStd::Expense" #define STD_ACC_INCOME "AStd::Income" -#define STD_ACC_EQUITY "AStd::Equity" +#define STD_ACC_ETQUITY "AStd::Equity" IMyMoneyStorage(); virtual ~IMyMoneyStorage(); // general get functions virtual const MyMoneyPayee user(void) const = 0; - virtual const QDate creationDate(void) const = 0; - virtual const QDate lastModificationDate(void) const = 0; + virtual const TQDate creationDate(void) const = 0; + virtual const TQDate lastModificationDate(void) const = 0; virtual unsigned int currentFixVersion(void) const = 0; virtual unsigned int fileFixVersion(void) const = 0; @@ -113,9 +113,9 @@ public: virtual void setFileFixVersion(const unsigned int v) = 0; // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value) = 0; - virtual const QString value(const QString& key) const = 0; - virtual void deletePair(const QString& key) = 0; + virtual void setValue(const TQString& key, const TQString& value) = 0; + virtual const TQString value(const TQString& key) const = 0; + virtual void deletePair(const TQString& key) = 0; /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -135,15 +135,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account) = 0; + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account) = 0; /** * This method is used to create a new payee @@ -158,22 +158,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const = 0; + virtual const MyMoneyPayee payee(const TQString& id) const = 0; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const = 0; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const = 0; /** * This method is used to modify an existing payee @@ -197,9 +197,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyPayee> containing the payee information + * @return TQValueList<MyMoneyPayee> containing the payee information */ - virtual const QValueList<MyMoneyPayee> payeeList(void) const = 0; + virtual const TQValueList<MyMoneyPayee> payeeList(void) const = 0; /** * Returns the account addressed by it's id. @@ -210,7 +210,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const = 0; + virtual const MyMoneyAccount account(const TQString& id) const = 0; /** * This method is used to check whether a given @@ -221,23 +221,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const = 0; + virtual bool isStandardAccount(const TQString& id) const = 0; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name) = 0; + virtual void setAccountName(const TQString& id, const TQString& name) = 0; /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -249,7 +249,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -269,7 +269,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const = 0; + virtual bool hasActiveSplits(const TQString& id) const = 0; /** * This method is used to return the actual balance of an account @@ -282,7 +282,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const= 0; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const= 0; /** * This method is used to return the actual balance of an account @@ -295,7 +295,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const = 0; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const = 0; /** * Returns the institution of a given ID @@ -304,7 +304,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const = 0; + virtual const MyMoneyInstitution institution(const TQString& id) const = 0; /** * This method returns an indicator if the storage object has been @@ -334,10 +334,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyInstitution> containing the + * @return TQValueList<MyMoneyInstitution> containing the * institution information */ - virtual const QValueList<MyMoneyInstitution> institutionList(void) const = 0; + virtual const TQValueList<MyMoneyInstitution> institutionList(void) const = 0; /** * Modifies an already existing account in the file global account pool. @@ -370,14 +370,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction) = 0; /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent) = 0; + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent) = 0; /** * This method is used to remove a transaction from the transaction @@ -393,25 +393,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const = 0; + virtual unsigned int transactionCount(const TQString& account = TQString()) const = 0; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap<QString, unsigned long> transactionCountMap(void) const = 0; + virtual const TQMap<TQString, unsigned long> transactionCountMap(void) const = 0; /** * This method is used to pull a list of transactions from the file @@ -424,13 +424,13 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList<MyMoneyTransaction> + * @return set of transactions in form of a TQValueList<MyMoneyTransaction> */ - virtual const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const = 0; + virtual const TQValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const = 0; - virtual void transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const = 0; + virtual void transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const = 0; /** * Deletes an existing account from the file global account pool @@ -459,20 +459,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& id) const = 0; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const = 0; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const = 0; /** * This method returns the number of institutions currently known to file @@ -485,11 +485,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList<MyMoneyAccount>& list) const = 0; + virtual void accountList(TQValueList<MyMoneyAccount>& list) const = 0; /** * This method is used to return the standard liability account @@ -558,22 +558,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const = 0; + virtual const MyMoneySecurity security(const TQString& id) const = 0; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList<MyMoneySecurity> containing objects + * @return TQValueList<MyMoneySecurity> containing objects */ - virtual const QValueList<MyMoneySecurity> securityList(void) const = 0; + virtual const TQValueList<MyMoneySecurity> securityList(void) const = 0; virtual void addPrice(const MyMoneyPrice& price) = 0; virtual void removePrice(const MyMoneyPrice& price) = 0; - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const = 0; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const = 0; /** * This method returns a list of all prices. @@ -620,10 +620,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const = 0; + virtual const MyMoneySchedule schedule(const TQString& id) const = 0; /** * This method is used to extract a list of scheduled transactions @@ -631,7 +631,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -643,27 +643,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList<MyMoneySchedule> list of schedule objects. + * @return const TQValueList<MyMoneySchedule> list of schedule objects. */ - virtual const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(), + virtual const TQValueList<MyMoneySchedule> scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const = 0; - virtual const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, + virtual const TQValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const = 0; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const = 0; /** * This method is used to add a new currency object to the engine. @@ -702,10 +702,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const = 0; + virtual const MyMoneySecurity currency(const TQString& id) const = 0; /** * This method is used to retrieve the list of all currencies @@ -713,9 +713,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList<MyMoneySecurity> currencyList(void) const = 0; + virtual const TQValueList<MyMoneySecurity> currencyList(void) const = 0; /** * This method is used to retrieve the list of all reports @@ -723,9 +723,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList<MyMoneyReport> reportList( void ) const = 0; + virtual const TQValueList<MyMoneyReport> reportList( void ) const = 0; /** * This method is used to add a new report to the engine. @@ -763,10 +763,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const = 0; + virtual const MyMoneyReport report( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyReport object @@ -784,9 +784,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList<MyMoneyBudget> budgetList( void ) const = 0; + virtual const TQValueList<MyMoneyBudget> budgetList( void ) const = 0; /** * This method is used to add a new budget to the engine. @@ -805,11 +805,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const = 0; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const = 0; /** * This method is used to modify an existing MyMoneyBudget @@ -835,10 +835,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const = 0; + virtual MyMoneyBudget budget( const TQString& id ) const = 0; /** * This method is used to remove an existing MyMoneyBudget object diff --git a/kmymoney2/mymoney/storage/imymoneystorageformat.h b/kmymoney2/mymoney/storage/imymoneystorageformat.h index b045898..6a7046f 100644 --- a/kmymoney2/mymoney/storage/imymoneystorageformat.h +++ b/kmymoney2/mymoney/storage/imymoneystorageformat.h @@ -31,9 +31,9 @@ // ---------------------------------------------------------------------------- // QT Includes -class QString; -class QIODevice; -class QProgressDialog; +class TQString; +class TQIODevice; +class TQProgressDialog; // ---------------------------------------------------------------------------- // Project Includes @@ -52,13 +52,13 @@ public: Writing = 1 /**< version to be used when writing a file */ }; - virtual void readFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - // virtual void readStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void readFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + // virtual void readStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void writeFile(QIODevice* qf, IMyMoneySerialize* storage) = 0; - //virtual void writeStream(QDataStream& s, IMyMoneySerialize* storage) = 0; + virtual void writeFile(TQIODevice* qf, IMyMoneySerialize* storage) = 0; + //virtual void writeStream(TQDataStream& s, IMyMoneySerialize* storage) = 0; - virtual void setProgressCallback(void(*callback)(int, int, const QString&)) = 0; + virtual void setProgressCallback(void(*callback)(int, int, const TQString&)) = 0; /** * This member is used to store the file version information * obtained while reading a file. 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); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h index 21bf8d6..1511915 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgr.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgr.h @@ -50,8 +50,8 @@ public: // general get functions virtual const MyMoneyPayee user(void) const; - virtual const QDate creationDate(void) const; - virtual const QDate lastModificationDate(void) const; + virtual const TQDate creationDate(void) const; + virtual const TQDate lastModificationDate(void) const; virtual unsigned int currentFixVersion(void) const; virtual unsigned int fileFixVersion(void) const; @@ -60,9 +60,9 @@ public: virtual void setFileFixVersion(const unsigned int v); // methods provided by MyMoneyKeyValueContainer - virtual void setValue(const QString& key, const QString& value); - virtual const QString value(const QString& key) const; - virtual void deletePair(const QString& key); + virtual void setValue(const TQString& key, const TQString& value); + virtual const TQString value(const TQString& key) const; + virtual void deletePair(const TQString& key); /** * This method is used to duplicate an IMyMoneyStorage object and return @@ -82,15 +82,15 @@ public: /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects that are passed will be modified + * (tqparent) account. The objects that are passed will be modified * accordingly. * * An exception will be thrown upon error conditions. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - virtual void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + virtual void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * This method is used to create a new payee @@ -105,22 +105,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payee(const QString& id) const; + virtual const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee object of payee */ - virtual const MyMoneyPayee payeeByName(const QString& payee) const; + virtual const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -144,9 +144,9 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyPayee> containing the payee information + * @return TQValueList<MyMoneyPayee> containing the payee information */ - virtual const QValueList<MyMoneyPayee> payeeList(void) const; + virtual const TQValueList<MyMoneyPayee> payeeList(void) const; /** * Returns the account addressed by it's id. @@ -157,7 +157,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - virtual const MyMoneyAccount account(const QString& id) const; + virtual const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -168,23 +168,23 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - virtual bool isStandardAccount(const QString& id) const; + virtual bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. - * @param name QString reference to the name to be set + * @param id TQString reference to one of the standard accounts. + * @param name TQString reference to the name to be set * */ - virtual void setAccountName(const QString& id, const QString& name); + virtual void setAccountName(const TQString& id, const TQString& name); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * * An exception will be thrown upon error conditions. * @@ -196,7 +196,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * QString with the object. + * TQString with the object. * * An exception will be thrown upon error conditions. * @@ -216,7 +216,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - virtual bool hasActiveSplits(const QString& id) const; + virtual bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -229,7 +229,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney balance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney balance(const TQString& id, const TQDate& date) const; /** * This method is used to return the actual balance of an account @@ -242,7 +242,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - virtual const MyMoneyMoney totalBalance(const QString& id, const QDate& date) const; + virtual const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date) const; /** * Returns the institution of a given ID @@ -251,7 +251,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - virtual const MyMoneyInstitution institution(const QString& id) const; + virtual const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -284,10 +284,10 @@ public: * This method returns a list of the institutions * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyInstitution> containing the + * @return TQValueList<MyMoneyInstitution> containing the * institution information */ - virtual const QValueList<MyMoneyInstitution> institutionList(void) const; + virtual const TQValueList<MyMoneyInstitution> institutionList(void) const; /** * Modifies an already existing account in the file global account pool. @@ -320,14 +320,14 @@ public: virtual void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + virtual void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -343,25 +343,25 @@ public: * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - virtual unsigned int transactionCount(const QString& account = QString()) const; + virtual unsigned int transactionCount(const TQString& account = TQString()) const; /** - * This method returns a QMap filled with the number of transactions + * This method returns a TQMap filled with the number of transactions * per account. The account id serves as index into the map. If one * needs to have all transactionCounts() for many accounts, this method - * is faster than calling transactionCount(const QString& account) many + * is faster than calling transactionCount(const TQString& account) many * times. * - * @return QMap with numbers of transactions per account + * @return TQMap with numbers of transactions per account */ - virtual const QMap<QString, unsigned long> transactionCountMap(void) const; + virtual const TQMap<TQString, unsigned long> transactionCountMap(void) const; /** * This method is used to pull a list of transactions from the file @@ -374,9 +374,9 @@ public: * * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList<MyMoneyTransaction> + * @return set of transactions in form of a TQValueList<MyMoneyTransaction> */ - virtual const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; + virtual const TQValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but instead of a return value, a @@ -386,7 +386,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; /** * This method is the same as above, but the list contains pairs of @@ -396,7 +396,7 @@ public: * be cleared before filling with results. * @param filter MyMoneyTransactionFilter object with the match criteria */ - virtual void transactionList(QValueList<QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; + virtual void transactionList(TQValueList<TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; /** * Deletes an existing account from the file global account pool @@ -425,20 +425,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return the requested transaction */ - virtual const MyMoneyTransaction transaction(const QString& id) const; + virtual const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return MyMoneyTransaction object */ - virtual const MyMoneyTransaction transaction(const QString& account, const int idx) const; + virtual const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method returns the number of institutions currently known to file @@ -451,11 +451,11 @@ public: /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - virtual void accountList(QValueList<MyMoneyAccount>& list) const; + virtual void accountList(TQValueList<MyMoneyAccount>& list) const; /** * This method is used to return the standard liability account @@ -524,22 +524,22 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneySecurity object */ - virtual const MyMoneySecurity security(const QString& id) const; + virtual const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of the security objects * inside a MyMoneyStorage object * - * @return QValueList<MyMoneySecurity> containing objects + * @return TQValueList<MyMoneySecurity> containing objects */ - virtual const QValueList<MyMoneySecurity> securityList(void) const; + virtual const TQValueList<MyMoneySecurity> securityList(void) const; virtual void addPrice(const MyMoneyPrice& price); virtual void removePrice(const MyMoneyPrice& price); - virtual const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + virtual const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all prices. @@ -586,10 +586,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - virtual const MyMoneySchedule schedule(const QString& id) const; + virtual const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to extract a list of scheduled transactions @@ -597,7 +597,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -609,27 +609,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList<MyMoneySchedule> list of schedule objects. + * @return const TQValueList<MyMoneySchedule> list of schedule objects. */ - virtual const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(), + virtual const TQValueList<MyMoneySchedule> scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - virtual const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, + virtual const TQValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to add a new currency object to the engine. @@ -668,10 +668,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySecurity object + * @param id TQString containing the id of the MyMoneySecurity object * @return MyMoneyCurrency object */ - virtual const MyMoneySecurity currency(const QString& id) const; + virtual const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -679,9 +679,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneySecurity objects representing a currency. + * @return TQValueList of all MyMoneySecurity objects representing a currency. */ - virtual const QValueList<MyMoneySecurity> currencyList(void) const; + virtual const TQValueList<MyMoneySecurity> currencyList(void) const; /** * This method is used to retrieve the list of all reports @@ -689,9 +689,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - virtual const QValueList<MyMoneyReport> reportList( void ) const; + virtual const TQValueList<MyMoneyReport> reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -729,10 +729,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - virtual const MyMoneyReport report( const QString& id ) const; + virtual const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -750,9 +750,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - virtual const QValueList<MyMoneyBudget> budgetList( void ) const; + virtual const TQValueList<MyMoneyBudget> budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -771,11 +771,11 @@ public: * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget object of budget */ - virtual const MyMoneyBudget budgetByName(const QString& budget) const; + virtual const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -801,10 +801,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - virtual MyMoneyBudget budget( const QString& id ) const; + virtual MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -849,7 +849,7 @@ public: virtual void rollbackTransaction(void); // general set functions - virtual void setCreationDate(const QDate& val); + virtual void setCreationDate(const TQDate& val); /** * This method is used to get a SQL reader for subsequent database access @@ -869,25 +869,25 @@ public: * therefor be called as last operation when loading from a * file. * - * @param val QDate of last modification + * @param val TQDate of last modification */ - virtual void setLastModificationDate(const QDate& val); + virtual void setLastModificationDate(const TQDate& val); /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - virtual bool isDuplicateTransaction(const QString&) const; - - virtual void loadAccounts(const QMap<QString, MyMoneyAccount>& map); - virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map); - virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map); - virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map); - virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map); - virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map); - virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map); - virtual void loadReports( const QMap<QString, MyMoneyReport>& reports ); - virtual void loadBudgets( const QMap<QString, MyMoneyBudget>& budgets ); + virtual bool isDuplicateTransaction(const TQString&) const; + + virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& map); + virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map); + virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map); + virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map); + virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map); + virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map); + virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map); + virtual void loadReports( const TQMap<TQString, MyMoneyReport>& reports ); + virtual void loadBudgets( const TQMap<TQString, MyMoneyBudget>& budgets ); virtual void loadPrices(const MyMoneyPriceList& list); virtual unsigned long accountId(void) const; @@ -913,10 +913,10 @@ public: * from the container. It is meant to be used for permanent storage * functionality. See MyMoneyKeyValueContainer::pairs() for details. * - * @return QMap<QString, QString> containing all key/value pairs of + * @return TQMap<TQString, TQString> containing all key/value pairs of * this container. */ - virtual const QMap<QString, QString> pairs(void) const; + virtual const TQMap<TQString, TQString> pairs(void) const; /** * This method is used to initially store a set of key/value pairs @@ -924,12 +924,12 @@ public: * from permanent storage. See MyMoneyKeyValueContainer::setPairs() * for details * - * @param list const QMap<QString, QString> containing the set of + * @param list const TQMap<TQString, TQString> containing the set of * key/value pairs to be loaded into the container. * * @note All existing key/value pairs in the container will be deleted. */ - virtual void setPairs(const QMap<QString, QString>& list); + virtual void setPairs(const TQMap<TQString, TQString>& list); /** * This method recalculates the balances of all accounts @@ -943,7 +943,7 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable contains the current fix level of application @@ -961,7 +961,7 @@ private: * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This contains the interface with SQL reader for database access @@ -978,47 +978,47 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - const QString nextInstitutionID(void); + const TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - const QString nextAccountID(void); + const TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - const QString nextTransactionID(void); + const TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - const QString nextPayeeID(void); + const TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - const QString nextScheduleID(void); + const TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - const QString nextSecurityID(void); + const TQString nextSecurityID(void); - const QString nextReportID(void); + const TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - const QString nextBudgetID(void); + const TQString nextBudgetID(void); - void removeReferences(const QString& id); + void removeReferences(const TQString& id); static const int INSTITUTION_ID_SIZE = 6; static const int ACCOUNT_ID_SIZE = 6; diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp index f6a2bba..ae589cd 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.cpp @@ -60,7 +60,7 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->nextReportID() == 0); CPPUNIT_ASSERT(m->institutionList().count() == 0); - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 0); @@ -70,31 +70,31 @@ void MyMoneyDatabaseMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->payeeList().count() == 0); CPPUNIT_ASSERT(m->scheduleList().count() == 0); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); } void MyMoneyDatabaseMgrTest::testCreateDb() { m->commitTransaction(); // Fetch the list of available drivers - QStringList list = QSqlDatabase::drivers(); - QStringList::Iterator it = list.begin(); + TQStringList list = TQSqlDatabase::drivers(); + TQStringList::Iterator it = list.begin(); if (it == list.end()) { m_canOpen = false; } else { struct passwd * pwd = getpwuid(geteuid()); - QString userName; + TQString userName; if (pwd != 0) { - userName = QString(pwd->pw_name); + userName = TQString(pwd->pw_name); } - //"QMYSQL3" - //"QPSQL7" - //"QSQLITE3" + //"TQMYSQL3" + //"TQPSQL7" + //"TQSQLITE3" m_url = "sql://" + userName + "@localhost/kmm_test_driver?driver=" - //"QPSQL7&mode=single"; - //"QSQLITE3&mode=single"; - //"QMYSQL3&mode=single"; + //"TQPSQL7&mode=single"; + //"TQSQLITE3&mode=single"; + //"TQMYSQL3&mode=single"; + *it + "&mode=single"; KSharedPtr <MyMoneyStorageSql> sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(0 != sql); @@ -118,8 +118,8 @@ void MyMoneyDatabaseMgrTest::testAttachDb() { MyMoneyFile::instance()->detachStorage(); KSharedPtr <MyMoneyStorageSql> sql = m->connectToDatabase(m_url); CPPUNIT_ASSERT(sql); - int openStatus = sql->open(m_url, IO_ReadWrite); - CPPUNIT_ASSERT(0 == openStatus); + int opentqStatus = sql->open(m_url, IO_ReadWrite); + CPPUNIT_ASSERT(0 == opentqStatus); MyMoneyFile::instance()->attachStorage(m); m->startTransaction(); m_dbAttached = true; @@ -202,7 +202,7 @@ void MyMoneyDatabaseMgrTest::testIsStandardAccount() CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ASSET) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EXPENSE) == true); CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_INCOME) == true); - CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_EQUITY) == true); + CPPUNIT_ASSERT(m->isStandardAccount(STD_ACC_ETQUITY) == true); CPPUNIT_ASSERT(m->isStandardAccount("A0002") == false); } @@ -221,7 +221,7 @@ void MyMoneyDatabaseMgrTest::testNewAccount() { m->addAccount(a); CPPUNIT_ASSERT(m->accountId() == 1); - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 1); CPPUNIT_ASSERT((*(accList.begin())).name() == "AccountName"); @@ -274,7 +274,7 @@ void MyMoneyDatabaseMgrTest::testAddNewAccount() { m->setDirty(); CPPUNIT_ASSERT(m->accountId() == 2); - QValueList<MyMoneyAccount> accList; + TQValueList<MyMoneyAccount> accList; m->accountList(accList); CPPUNIT_ASSERT(accList.count() == 2); @@ -421,7 +421,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { try { m->modifyAccount(a); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); } catch (MyMoneyException *e) { delete e; @@ -449,7 +449,7 @@ void MyMoneyDatabaseMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -490,7 +490,7 @@ void MyMoneyDatabaseMgrTest::testModifyInstitution() { } } -void MyMoneyDatabaseMgrTest::testReparentAccount() { +void MyMoneyDatabaseMgrTest::testRetqparentAccount() { testAttachDb(); if (!m_canOpen) { @@ -535,23 +535,23 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); //for (int i = 0; i < 100; ++i) { m->reparentAccount(ex3, ex1); @@ -559,7 +559,7 @@ void MyMoneyDatabaseMgrTest::testReparentAccount() { MyMoneyFile::instance()->preloadCache(); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -575,7 +575,7 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { return; } - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -589,14 +589,14 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -613,35 +613,35 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -652,10 +652,10 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - //QMap<QString, QString>::ConstIterator it_k; + //TQMap<TQString, TQString>::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList<MyMoneyTransaction> transactionList (m->transactionList(f)); - QValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin()); + TQValueList<MyMoneyTransaction> transactionList (m->transactionList(f)); + TQValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin()); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000002"); @@ -671,12 +671,12 @@ void MyMoneyDatabaseMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -717,7 +717,7 @@ void MyMoneyDatabaseMgrTest::testAddBudget() { MyMoneyBudget budget; budget.setName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime)); m->addBudget(budget); @@ -742,7 +742,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { MyMoneyBudget newBudget = oldBudget; newBudget.clearId(); - newBudget.setName(QString("Copy of %1").arg(oldBudget.name())); + newBudget.setName(TQString("Copy of %1").tqarg(oldBudget.name())); m->addBudget(newBudget); CPPUNIT_ASSERT(m->budgetList().count() == 2); @@ -757,7 +757,7 @@ void MyMoneyDatabaseMgrTest::testCopyBudget() { CPPUNIT_ASSERT(testBudget.budgetStart() == newBudget.budgetStart()); CPPUNIT_ASSERT(testBudget.name() == newBudget.name()); - } catch (QString& s) { + } catch (TQString& s) { std::cout << "Error in testCopyBudget(): " << s << std::endl; CPPUNIT_ASSERT(false); } @@ -773,7 +773,7 @@ void MyMoneyDatabaseMgrTest::testModifyBudget() { MyMoneyBudget budget = m->budgetByName("TestBudget"); - budget.setBudgetStart(QDate::currentDate(Qt::LocalTime).addDays(-1)); + budget.setBudgetStart(TQDate::tqcurrentDate(TQt::LocalTime).addDays(-1)); m->modifyBudget(budget); @@ -815,9 +815,9 @@ void MyMoneyDatabaseMgrTest::testBalance() { testAddTransactions(); - CPPUNIT_ASSERT(m->balance("A000001", QDate()).isZero()); - CPPUNIT_ASSERT(m->balance("A000002", QDate()) == MyMoneyMoney(1200)); - CPPUNIT_ASSERT(m->balance("A000003", QDate()) == MyMoneyMoney(400)); + CPPUNIT_ASSERT(m->balance("A000001", TQDate()).isZero()); + CPPUNIT_ASSERT(m->balance("A000002", TQDate()) == MyMoneyMoney(1200)); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()) == MyMoneyMoney(400)); //Add a transaction to zero account A000003 MyMoneyTransaction t1; MyMoneySplit s; @@ -828,31 +828,31 @@ void MyMoneyDatabaseMgrTest::testBalance() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2007,5,10)); + t1.setPostDate(TQDate(2007,5,10)); m->addTransaction(t1); - //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000003", QDate()).isZero()); + //qDebug ("Balance of A000003 is 0 = %s", m->balance("A000003", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000003", TQDate()).isZero()); - //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", QDate()).toString().ascii()); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + //qDebug ("Balance of A000001 is 1600 = %s", m->balance("A000001", TQDate()).toString().ascii()); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", QDate(2002,5,9)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); + //qDebug ("Balance of A000006 is -11600 = %s", m->balance("A000006", TQDate(2002,5,9)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); - //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); + //qDebug ("Balance of A000005 is -100000 = %s", m->balance("A000005", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); - //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", QDate(2002,5,10)).toString().ascii()); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + //qDebug ("Balance of A000006 is 88400 = %s", m->balance("A000006", TQDate(2002,5,10)).toString().ascii()); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneyDatabaseMgrTest::testModifyTransaction() { @@ -884,30 +884,30 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { t.modifySplit(s); try { - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(10000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-11600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(10000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-11600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); } catch (MyMoneyException *e) { delete e; CPPUNIT_FAIL("Unexpected exception"); } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); - CPPUNIT_ASSERT(m->balance("A000004", QDate()) == MyMoneyMoney(11000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate()) == MyMoneyMoney(100000-12600)); - CPPUNIT_ASSERT(m->totalBalance("A000001", QDate()) == MyMoneyMoney(1600)); + CPPUNIT_ASSERT(m->balance("A000004", TQDate()) == MyMoneyMoney(11000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate()) == MyMoneyMoney(100000-12600)); + CPPUNIT_ASSERT(m->totalBalance("A000001", TQDate()) == MyMoneyMoney(1600)); - //QMap<QString, QString>::ConstIterator it_k; + //TQMap<TQString, TQString>::ConstIterator it_k; MyMoneyTransactionFilter f; - QValueList<MyMoneyTransaction> transactionList (m->transactionList(f)); - QValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin()); + TQValueList<MyMoneyTransaction> transactionList (m->transactionList(f)); + TQValueList<MyMoneyTransaction>::ConstIterator it_t (transactionList.begin()); //it_k = m->m_transactionKeys.begin(); //CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); CPPUNIT_ASSERT((*it_t).id() == "T000000000000000001"); @@ -923,12 +923,12 @@ void MyMoneyDatabaseMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -1004,7 +1004,7 @@ void MyMoneyDatabaseMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 1); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); CPPUNIT_ASSERT(m->accountCount() == 6); @@ -1045,7 +1045,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { } testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -1066,7 +1066,7 @@ void MyMoneyDatabaseMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); a = m->account("A000006"); CPPUNIT_ASSERT(a.institutionId().isEmpty()); @@ -1109,7 +1109,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { testAddTransactions(); - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -1117,7 +1117,7 @@ void MyMoneyDatabaseMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1355,7 +1355,7 @@ void MyMoneyDatabaseMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1474,7 +1474,7 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); try { CPPUNIT_ASSERT(m->scheduleList().count() == 0); @@ -1488,11 +1488,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1511,8 +1511,8 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1534,11 +1534,11 @@ void MyMoneyDatabaseMgrTest::testAddSchedule() { // MyMoneySchedule::TYPE_DEPOSIT, // MyMoneySchedule::OCCUR_DAILY, 1, // MyMoneySchedule::STYPE_MANUALDEPOSIT, -// QDate(), -// QDate(), +// TQDate(), +// TQDate(), // true, // false); -// t1.setPostDate(QDate(2003,7,10)); +// t1.setPostDate(TQDate(2003,7,10)); // schedule.setTransaction(t1); // m->addSchedule(schedule); @@ -1648,11 +1648,11 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { } // put some accounts in the db, so the tests don't break - testReparentAccount(); + testRetqparentAccount(); - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; MyMoneySplit s1, s2; @@ -1664,8 +1664,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1682,8 +1682,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1700,8 +1700,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1717,8 +1717,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1736,7 +1736,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList<MyMoneySchedule> list; + TQValueList<MyMoneySchedule> list; // no filter list = m->scheduleList(); @@ -1783,7 +1783,7 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1804,8 +1804,8 @@ void MyMoneyDatabaseMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1978,7 +1978,7 @@ void MyMoneyDatabaseMgrTest::testAccountList() return; } - QValueList<MyMoneyAccount> accounts; + TQValueList<MyMoneyAccount> accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); diff --git a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h index 8ab4b64..d883032 100644 --- a/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneydatabasemgrtest.h @@ -40,7 +40,7 @@ class MyMoneyDatabaseMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -103,7 +103,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testAddBudget(); diff --git a/kmymoney2/mymoney/storage/mymoneymap.h b/kmymoney2/mymoney/storage/mymoneymap.h index fa5cda8..7582112 100644 --- a/kmymoney2/mymoney/storage/mymoneymap.h +++ b/kmymoney2/mymoney/storage/mymoneymap.h @@ -1,6 +1,6 @@ #include <stdint.h> -#include <qmap.h> -#include <qptrstack.h> +#include <tqmap.h> +#include <tqptrstack.h> #include <kmymoney/mymoneyexception.h> #ifndef MYMONEYMAP_H @@ -11,7 +11,7 @@ /** * @author Thomas Baumgart * - * This template class adds transaction security to the QMap<> class. + * This template class adds transaction security to the TQMap<> class. * The interface is very simple. Before you perform any changes, * you have to call the startTransaction() method. Then you can use * the insert(), modify() and remove() methods to modify the map. @@ -25,12 +25,12 @@ * someone is interested. */ template <class Key, class T> -class MyMoneyMap : protected QMap<Key, T> +class MyMoneyMap : protected TQMap<Key, T> { public: - // typedef QMapConstIterator<Key, T> const_iterator; + // typedef TQMapConstIterator<Key, T> const_iterator; - MyMoneyMap() : QMap<Key, T>() {} + MyMoneyMap() : TQMap<Key, T>() {} virtual ~MyMoneyMap() {} void startTransaction(unsigned long* id = 0) @@ -78,7 +78,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to modify element in container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to update object"); #endif @@ -92,7 +92,7 @@ public: throw new MYMONEYEXCEPTION("No transaction started to remove element from container"); #if 0 - // had to take this out, because we use QPair in one instance as key + // had to take this out, because we use TQPair in one instance as key if(key.isEmpty()) throw new MYMONEYEXCEPTION("No key to remove object"); #endif @@ -100,59 +100,59 @@ public: m_stack.push(new MyMoneyMapRemove(this, key)); } - MyMoneyMap<Key, T>& operator= (const QMap<Key, T>& m) + MyMoneyMap<Key, T>& operator= (const TQMap<Key, T>& m) { if(m_stack.count() != 0) { throw new MYMONEYEXCEPTION("Cannot assign whole container during transaction"); } - QMap<Key, T>::operator=(m); + TQMap<Key, T>::operator=(m); return *this; } - inline QValueList<T> values(void) const + inline TQValueList<T> values(void) const { - return QMap<Key,T>::values(); + return TQMap<Key,T>::values(); } - inline QValueList<Key> keys(void) const + inline TQValueList<Key> keys(void) const { - return QMap<Key,T>::keys(); + return TQMap<Key,T>::keys(); } const T& operator[] ( const Key& k ) const - { QT_CHECK_INVALID_MAP_ELEMENT; return QMap<Key,T>::operator[](k); } + { TQT_CHECK_INVALID_MAP_ELEMENT; return TQMap<Key,T>::operator[](k); } - inline Q_TYPENAME QMap<Key, T>::const_iterator find(const Key& k) const + inline TQ_TYPENAME TQMap<Key, T>::const_iterator tqfind(const Key& k) const { - return QMap<Key,T>::find(k); + return TQMap<Key,T>::tqfind(k); } - inline Q_TYPENAME QMap<Key, T>::const_iterator begin(void) const + inline TQ_TYPENAME TQMap<Key, T>::const_iterator begin(void) const { - return QMap<Key,T>::begin(); + return TQMap<Key,T>::begin(); } - inline Q_TYPENAME QMap<Key, T>::const_iterator end(void) const + inline TQ_TYPENAME TQMap<Key, T>::const_iterator end(void) const { - return QMap<Key,T>::end(); + return TQMap<Key,T>::end(); } - inline bool contains(const Key& k) const + inline bool tqcontains(const Key& k) const { - return find(k) != end(); + return tqfind(k) != end(); } - inline void map(QMap<Key, T>& that) const + inline void map(TQMap<Key, T>& that) const { - //QMap<Key, T>* ptr = dynamic_cast<QMap<Key, T>* >(this); + //TQMap<Key, T>* ptr = dynamic_cast<TQMap<Key, T>* >(this); //that = *ptr; - that = *(dynamic_cast<QMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this))); + that = *(dynamic_cast<TQMap<Key, T>* >(const_cast<MyMoneyMap<Key, T>* >(this))); } inline size_t count(void) const { - return QMap<Key, T>::count(); + return TQMap<Key, T>::count(); } #if MY_OWN_DEBUG @@ -173,10 +173,10 @@ private: class MyMoneyMapAction { public: - MyMoneyMapAction(QMap<Key, T>* container) : + MyMoneyMapAction(TQMap<Key, T>* container) : m_container(container) {} - MyMoneyMapAction(QMap<Key, T>* container, const Key& key, const T& obj) : + MyMoneyMapAction(TQMap<Key, T>* container, const Key& key, const T& obj) : m_container(container), m_obj(obj), m_key(key) {} @@ -185,7 +185,7 @@ private: virtual void undo(void) = 0; protected: - QMap<Key, T>* m_container; + TQMap<Key, T>* m_container; T m_obj; Key m_key; }; @@ -193,7 +193,7 @@ private: class MyMoneyMapStart : public MyMoneyMapAction { public: - MyMoneyMapStart(QMap<Key, T>* container, unsigned long* id) : + MyMoneyMapStart(TQMap<Key, T>* container, unsigned long* id) : MyMoneyMapAction(container), m_idPtr(id) { @@ -215,7 +215,7 @@ private: class MyMoneyMapInsert : public MyMoneyMapAction { public: - MyMoneyMapInsert(QMap<Key, T>* container, const Key& key, const T& obj) : + MyMoneyMapInsert(TQMap<Key, T>* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, obj) { (*container)[key] = obj; @@ -233,7 +233,7 @@ private: class MyMoneyMapRemove : public MyMoneyMapAction { public: - MyMoneyMapRemove(QMap<Key, T>* container, const Key& key) : + MyMoneyMapRemove(TQMap<Key, T>* container, const Key& key) : MyMoneyMapAction(container, key, (*container)[key]) { container->remove(key); @@ -249,7 +249,7 @@ private: class MyMoneyMapModify : public MyMoneyMapAction { public: - MyMoneyMapModify(QMap<Key, T>* container, const Key& key, const T& obj) : + MyMoneyMapModify(TQMap<Key, T>* container, const Key& key, const T& obj) : MyMoneyMapAction(container, key, (*container)[key]) { (*container)[key] = obj; @@ -263,7 +263,7 @@ private: }; protected: - QPtrStack<MyMoneyMapAction> m_stack; + TQPtrStack<MyMoneyMapAction> m_stack; }; #if MY_OWN_DEBUG @@ -271,15 +271,15 @@ protected: #include <kmymoney/mymoneytransaction.h> main() { - MyMoneyMap<QString, MyMoneyAccount> container; - MyMoneyMap<QString, MyMoneyTransaction> ct; + MyMoneyMap<TQString, MyMoneyAccount> container; + MyMoneyMap<TQString, MyMoneyTransaction> ct; MyMoneyAccount acc; acc.setName("Test"); // this should not be possible // container["a"] = acc; - QValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount> list; list = container.values(); MyMoneyAccount b; @@ -298,7 +298,7 @@ main() container.dump(); container.startTransaction(); - container.remove(QString("001")); + container.remove(TQString("001")); container.dump(); container.rollbackTransaction(); container.dump(); @@ -306,8 +306,8 @@ main() b = container["001"]; printf("b.name() = %s\n", b.name().data()); - QMap<QString, MyMoneyAccount>::ConstIterator it; - it = container.find("001"); + TQMap<TQString, MyMoneyAccount>::ConstIterator it; + it = container.tqfind("001"); it = container.begin(); } catch(MyMoneyException *e) { @@ -315,7 +315,7 @@ main() delete e; } - QMap<QString, MyMoneyAccount> map; + TQMap<TQString, MyMoneyAccount> map; map["005"] = b; container = map; diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.cpp b/kmymoney2/mymoney/storage/mymoneymaptest.cpp index 5104fad..123fcc8 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.cpp +++ b/kmymoney2/mymoney/storage/mymoneymaptest.cpp @@ -24,7 +24,7 @@ MyMoneyMapTest::MyMoneyMapTest() void MyMoneyMapTest::setUp() { - m = new MyMoneyMap<QString, QString>; + m = new MyMoneyMap<TQString, TQString>; } void MyMoneyMapTest::tearDown() diff --git a/kmymoney2/mymoney/storage/mymoneymaptest.h b/kmymoney2/mymoney/storage/mymoneymaptest.h index c089a3f..af2389c 100644 --- a/kmymoney2/mymoney/storage/mymoneymaptest.h +++ b/kmymoney2/mymoney/storage/mymoneymaptest.h @@ -34,7 +34,7 @@ class MyMoneyMapTest : public CppUnit::TestFixture { CPPUNIT_TEST_SUITE_END(); protected: - MyMoneyMap<QString, QString> *m; + MyMoneyMap<TQString, TQString> *m; public: MyMoneyMapTest(); 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) { diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h index f200bef..ddc2030 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgr.h @@ -20,8 +20,8 @@ * * ***************************************************************************/ -#ifndef MYMONEYSEQACCESSMGR_H -#define MYMONEYSEQACCESSMGR_H +#ifndef MYMONEYSETQACCESSMGR_H +#define MYMONEYSETQACCESSMGR_H // ---------------------------------------------------------------------------- // QT Includes @@ -50,7 +50,7 @@ * will be created containing the new balance value. * * @see MyMoneySeqAccessMgr::balance() and - * MyMoneySeqAccessMgr::invalidateBalanceCache() for a usage example + * MyMoneySeqAccessMgr::tqinvalidateBalanceCache() for a usage example */ class MyMoneyBalanceCacheItem { public: @@ -85,8 +85,8 @@ public: // general get functions const MyMoneyPayee user(void) const { return m_user; }; - const QDate creationDate(void) const { return m_creationDate; }; - const QDate lastModificationDate(void) const { return m_lastModificationDate; }; + const TQDate creationDate(void) const { return m_creationDate; }; + const TQDate lastModificationDate(void) const { return m_lastModificationDate; }; unsigned int currentFixVersion(void) const { return m_currentFixVersion; }; unsigned int fileFixVersion(void) const { return m_fileFixVersion; }; @@ -94,8 +94,8 @@ public: // general set functions void setUser(const MyMoneyPayee& user) { m_user = user; touch(); }; - void setCreationDate(const QDate& val) { m_creationDate = val; touch(); }; - void setLastModificationDate(const QDate& val) { m_lastModificationDate = val; m_dirty = false; }; + void setCreationDate(const TQDate& val) { m_creationDate = val; touch(); }; + void setLastModificationDate(const TQDate& val) { m_lastModificationDate = val; m_dirty = false; }; void setFileFixVersion(const unsigned int v) { m_fileFixVersion = v; }; /** * This method is used to get a SQL reader for subsequent database access @@ -122,7 +122,7 @@ public: * @return reference to MyMoneyAccount object. An exception is thrown * if the id is unknown */ - const MyMoneyAccount account(const QString& id) const; + const MyMoneyAccount account(const TQString& id) const; /** * This method is used to check whether a given @@ -131,26 +131,26 @@ public: * @param id account id * @return true if account-id is one of the standards, false otherwise */ - bool isStandardAccount(const QString& id) const; + bool isStandardAccount(const TQString& id) const; /** * This method is used to set the name for the specified standard account * within the storage area. An exception will be thrown, if an error * occurs * - * @param id QString reference to one of the standard accounts. Possible + * @param id TQString reference to one of the standard accounts. Possible * values are: * * @li STD_ACC_LIABILITY * @li STD_ACC_ASSET * @li STD_ACC_EXPENSE * @li STD_ACC_INCOME - * @li STD_ACC_EQUITY + * @li STD_ACC_ETQUITY * - * @param name QString reference to the name to be set + * @param name TQString reference to the name to be set * */ - void setAccountName(const QString& id, const QString& name); + void setAccountName(const TQString& id, const TQString& name); /** * This method is used to create a new account @@ -174,22 +174,22 @@ public: * This method is used to retrieve information about a payee * An exception will be thrown upon error conditions. * - * @param id QString reference to id of payee + * @param id TQString reference to id of payee * * @return MyMoneyPayee object of payee */ - const MyMoneyPayee payee(const QString& id) const; + const MyMoneyPayee payee(const TQString& id) const; /** * This method is used to retrieve the id to a corresponding * name of a payee/receiver. * An exception will be thrown upon error conditions. * - * @param payee QString reference to name of payee + * @param payee TQString reference to name of payee * * @return MyMoneyPayee reference to object of payee */ - const MyMoneyPayee payeeByName(const QString& payee) const; + const MyMoneyPayee payeeByName(const TQString& payee) const; /** * This method is used to modify an existing payee @@ -213,24 +213,24 @@ public: * This method returns a list of the payees * inside a MyMoneyStorage object * - * @return QValueList<MyMoneyPayee> containing the payee information + * @return TQValueList<MyMoneyPayee> containing the payee information */ - const QValueList<MyMoneyPayee> payeeList(void) const; + const TQValueList<MyMoneyPayee> payeeList(void) const; /** * This method is used to add one account as sub-ordinate to another - * (parent) account. The objects passed as arguments will be modified + * (tqparent) account. The objects passed as arguments will be modified * accordingly. * - * @param parent parent account the account should be added to + * @param tqparent tqparent account the account should be added to * @param account the account to be added */ - void addAccount(MyMoneyAccount& parent, MyMoneyAccount& account); + void addAccount(MyMoneyAccount& tqparent, MyMoneyAccount& account); /** * Adds an institution to the storage. A * respective institution-ID will be generated within this record. - * The ID is stored as QString in the object passed as argument. + * The ID is stored as TQString in the object passed as argument. * An exception will be thrown upon error conditions. * * @param institution The complete institution information in a @@ -241,7 +241,7 @@ public: /** * Adds a transaction to the file-global transaction pool. A respective * transaction-ID will be generated within this record. The ID is stored - * as QString in the transaction object. The accounts of the referenced splits + * as TQString in the transaction object. The accounts of the referenced splits * will be updated to have a reference to the transaction just added. * * @param transaction reference to the transaction @@ -286,14 +286,14 @@ public: void modifyTransaction(const MyMoneyTransaction& transaction); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent); /** * This method is used to remove a transaction from the transaction @@ -328,20 +328,20 @@ public: * transaction pool through an id. In case of an invalid id, an * exception will be thrown. * - * @param id id of transaction as QString. + * @param id id of transaction as TQString. * @return reference to the requested transaction */ - const MyMoneyTransaction transaction(const QString& id) const; + const MyMoneyTransaction transaction(const TQString& id) const; /** * This method is used to extract a transaction from the file global * transaction pool through an index into an account. * - * @param account id of the account as QString + * @param account id of the account as TQString * @param idx number of transaction in this account * @return reference to MyMoneyTransaction object */ - const MyMoneyTransaction transaction(const QString& account, const int idx) const; + const MyMoneyTransaction transaction(const TQString& account, const int idx) const; /** * This method is used to determince, if the account with the @@ -350,7 +350,7 @@ public: * @param id id of the account to be checked for * @return true if account is referenced, false otherwise */ - bool hasActiveSplits(const QString& id) const; + bool hasActiveSplits(const TQString& id) const; /** * This method is used to return the actual balance of an account @@ -363,7 +363,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney balance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney balance(const TQString& id, const TQDate& date = TQDate()) const; /** * This method is used to return the actual balance of an account @@ -376,7 +376,7 @@ public: * @param date return balance for specific date * @return balance of the account as MyMoneyMoney object */ - const MyMoneyMoney totalBalance(const QString& id, const QDate& date = QDate()) const; + const MyMoneyMoney totalBalance(const TQString& id, const TQDate& date = TQDate()) const; /** * Returns the institution of a given ID @@ -385,7 +385,7 @@ public: * @return MyMoneyInstitution object filled with data. If the institution * could not be found, an exception will be thrown */ - const MyMoneyInstitution institution(const QString& id) const; + const MyMoneyInstitution institution(const TQString& id) const; /** * This method returns an indicator if the storage object has been @@ -407,18 +407,18 @@ public: * This method returns a list of the institutions * inside a MyMoneyFile object * - * @return QMap containing the institution information + * @return TQMap containing the institution information */ - const QValueList<MyMoneyInstitution> institutionList(void) const; + const TQValueList<MyMoneyInstitution> institutionList(void) const; /** * This method returns a list of accounts inside the storage object. * - * @param list reference to QValueList receiving the account objects + * @param list reference to TQValueList receiving the account objects * * @note The standard accounts will not be returned */ - void accountList(QValueList<MyMoneyAccount>& list) const; + void accountList(TQValueList<MyMoneyAccount>& list) const; /** * This method is used to pull a list of transactions from the file @@ -434,9 +434,9 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList<MyMoneyTransaction> + * @return set of transactions in form of a TQValueList<MyMoneyTransaction> */ - void transactionList(QValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList<MyMoneyTransaction>& list, MyMoneyTransactionFilter& filter) const; /** * This method is used to pull a list of transactions from the file @@ -452,35 +452,35 @@ public: * @param list reference to list * @param filter MyMoneyTransactionFilter object with the match criteria * - * @return set of transactions in form of a QValueList<QPair<MyMoneyTransaction,MyMoneySplit> > + * @return set of transactions in form of a TQValueList<TQPair<MyMoneyTransaction,MyMoneySplit> > */ - void transactionList(QValueList< QPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; + void transactionList(TQValueList< TQPair<MyMoneyTransaction, MyMoneySplit> >& list, MyMoneyTransactionFilter& filter) const; /** * Compatibility interface for the previous method. */ - const QValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; + const TQValueList<MyMoneyTransaction> transactionList(MyMoneyTransactionFilter& filter) const; /** * This method returns whether a given transaction is already in memory, to avoid * reloading it from the database */ - bool isDuplicateTransaction(const QString& id) const { return m_transactionKeys.contains(id); } + bool isDuplicateTransaction(const TQString& id) const { return m_transactionKeys.tqcontains(id); } /** * This method returns the number of transactions currently known to file * in the range 0..MAXUINT * - * @param account QString reference to account id. If account is empty + * @param account TQString reference to account id. If account is empty + all transactions (the journal) will be counted. If account * is not empty it returns the number of transactions * that have splits in this account. * * @return number of transactions in journal/account */ - unsigned int transactionCount(const QString& account = QString()) const; + unsigned int transactionCount(const TQString& account = TQString()) const; - const QMap<QString, unsigned long> transactionCountMap(void) const; + const TQMap<TQString, unsigned long> transactionCountMap(void) const; /** * This method returns the number of institutions currently known to file @@ -526,15 +526,15 @@ public: * This method is used to return the standard equity account * @return MyMoneyAccount equity account(group) */ - const MyMoneyAccount equity(void) const { return account(STD_ACC_EQUITY); }; + const MyMoneyAccount equity(void) const { return account(STD_ACC_ETQUITY); }; - virtual void loadAccounts(const QMap<QString, MyMoneyAccount>& acc); - virtual void loadTransactions(const QMap<QString, MyMoneyTransaction>& map); - virtual void loadInstitutions(const QMap<QString, MyMoneyInstitution>& map); - virtual void loadPayees(const QMap<QString, MyMoneyPayee>& map); - virtual void loadSchedules(const QMap<QString, MyMoneySchedule>& map); - virtual void loadSecurities(const QMap<QString, MyMoneySecurity>& map); - virtual void loadCurrencies(const QMap<QString, MyMoneySecurity>& map); + virtual void loadAccounts(const TQMap<TQString, MyMoneyAccount>& acc); + virtual void loadTransactions(const TQMap<TQString, MyMoneyTransaction>& map); + virtual void loadInstitutions(const TQMap<TQString, MyMoneyInstitution>& map); + virtual void loadPayees(const TQMap<TQString, MyMoneyPayee>& map); + virtual void loadSchedules(const TQMap<TQString, MyMoneySchedule>& map); + virtual void loadSecurities(const TQMap<TQString, MyMoneySecurity>& map); + virtual void loadCurrencies(const TQMap<TQString, MyMoneySecurity>& map); virtual void loadPrices(const MyMoneyPriceList& list); virtual void loadAccountId(const unsigned long id); @@ -560,34 +560,34 @@ public: * This method is used to extract a value from * KeyValueContainer. For details see MyMoneyKeyValueContainer::value(). * - * @param key const reference to QString containing the key - * @return QString containing the value + * @param key const reference to TQString containing the key + * @return TQString containing the value */ - const QString value(const QString& key) const; + const TQString value(const TQString& key) const; /** * This method is used to set a value in the * KeyValueContainer. For details see MyMoneyKeyValueContainer::setValue(). * - * @param key const reference to QString containing the key - * @param val const reference to QString containing the value + * @param key const reference to TQString containing the key + * @param val const reference to TQString containing the value */ - void setValue(const QString& key, const QString& val); + void setValue(const TQString& key, const TQString& val); /** * This method is used to delete a key-value-pair from the * KeyValueContainer identified by the parameter * @p key. For details see MyMoneyKeyValueContainer::deletePair(). * - * @param key const reference to QString containing the key + * @param key const reference to TQString containing the key */ - void deletePair(const QString& key); + void deletePair(const TQString& key); // documented in IMyMoneySerialize base class - const QMap<QString, QString> pairs(void) const; + const TQMap<TQString, TQString> pairs(void) const; // documented in IMyMoneySerialize base class - void setPairs(const QMap<QString, QString>& list); + void setPairs(const TQMap<TQString, TQString>& list); /** * This method is used to add a scheduled transaction to the engine. @@ -627,10 +627,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySchedule schedule(const QString& id) const; + const MyMoneySchedule schedule(const TQString& id) const; /** * This method is used to create a new security object. The ID will be created @@ -669,17 +669,17 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity security(const QString& id) const; + const MyMoneySecurity security(const TQString& id) const; /** * This method returns a list of security objects that the engine has * knowledge of. */ - const QValueList<MyMoneySecurity> securityList(void) const; + const TQValueList<MyMoneySecurity> securityList(void) const; /** * This method is used to add a new currency object to the engine. @@ -718,10 +718,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneySchedule object + * @param id TQString containing the id of the MyMoneySchedule object * @return MyMoneySchedule object */ - const MyMoneySecurity currency(const QString& id) const; + const MyMoneySecurity currency(const TQString& id) const; /** * This method is used to retrieve the list of all currencies @@ -729,9 +729,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyCurrency objects. + * @return TQValueList of all MyMoneyCurrency objects. */ - const QValueList<MyMoneySecurity> currencyList(void) const; + const TQValueList<MyMoneySecurity> currencyList(void) const; /** * This method is used to extract a list of scheduled transactions @@ -739,7 +739,7 @@ public: * * @param accountId only search for scheduled transactions that reference * accound @p accountId. If accountId is the empty string, - * this filter is off. Default is @p QString(). + * this filter is off. Default is @p TQString(). * @param type only schedules of type @p type are searched for. * See MyMoneySchedule::typeE for details. * Default is MyMoneySchedule::TYPE_ANY @@ -751,27 +751,27 @@ public: * See MyMoneySchedule::paymentTypeE for details. * Default is MyMoneySchedule::STYPE_ANY * @param startDate only schedules with payment dates after @p startDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param endDate only schedules with payment dates ending prior to @p endDate - * are searched for. Default is all dates (QDate()). + * are searched for. Default is all dates (TQDate()). * @param overdue if true, only those schedules that are overdue are * searched for. Default is false (all schedules will be returned). * - * @return const QValueList<MyMoneySchedule> list of schedule objects. + * @return const TQValueList<MyMoneySchedule> list of schedule objects. */ - const QValueList<MyMoneySchedule> scheduleList(const QString& accountId = QString(), + const TQValueList<MyMoneySchedule> scheduleList(const TQString& accountId = TQString(), const MyMoneySchedule::typeE type = MyMoneySchedule::TYPE_ANY, const MyMoneySchedule::occurenceE occurence = MyMoneySchedule::OCCUR_ANY, const MyMoneySchedule::paymentTypeE paymentType = MyMoneySchedule::STYPE_ANY, - const QDate& startDate = QDate(), - const QDate& endDate = QDate(), + const TQDate& startDate = TQDate(), + const TQDate& endDate = TQDate(), const bool overdue = false) const; - const QValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, + const TQValueList<MyMoneySchedule> scheduleListEx( int scheduleTypes, int scheduleOcurrences, int schedulePaymentTypes, - QDate startDate, - const QStringList& accounts=QStringList()) const; + TQDate startDate, + const TQStringList& accounts=TQStringList()) const; /** * This method is used to retrieve the list of all reports @@ -779,9 +779,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyReport objects. + * @return TQValueList of all MyMoneyReport objects. */ - const QValueList<MyMoneyReport> reportList( void ) const; + const TQValueList<MyMoneyReport> reportList( void ) const; /** * This method is used to add a new report to the engine. @@ -803,7 +803,7 @@ public: * * @param reports reference to the map of MyMoneyReport objects */ - void loadReports( const QMap<QString, MyMoneyReport>& reports ); + void loadReports( const TQMap<TQString, MyMoneyReport>& reports ); /** * This method is used to modify an existing MyMoneyReport @@ -829,10 +829,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyReport object + * @param id TQString containing the id of the MyMoneyReport object * @return MyMoneyReport object */ - const MyMoneyReport report( const QString& id ) const; + const MyMoneyReport report( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyReport object @@ -850,9 +850,9 @@ public: * * An exception will be thrown upon erronous situations. * - * @return QValueList of all MyMoneyBudget objects. + * @return TQValueList of all MyMoneyBudget objects. */ - const QValueList<MyMoneyBudget> budgetList( void ) const; + const TQValueList<MyMoneyBudget> budgetList( void ) const; /** * This method is used to add a new budget to the engine. @@ -874,18 +874,18 @@ public: * * @param budgets reference to the map of MyMoneyBudget object */ - void loadBudgets(const QMap<QString, MyMoneyBudget>& budgets); + void loadBudgets(const TQMap<TQString, MyMoneyBudget>& budgets); /** * This method is used to retrieve the id to a corresponding * name of a budget * An exception will be thrown upon error conditions. * - * @param budget QString reference to name of budget + * @param budget TQString reference to name of budget * * @return MyMoneyBudget reference to object of budget */ - const MyMoneyBudget budgetByName(const QString& budget) const; + const MyMoneyBudget budgetByName(const TQString& budget) const; /** * This method is used to modify an existing MyMoneyBudget @@ -911,10 +911,10 @@ public: * * An exception will be thrown upon erronous situations. * - * @param id QString containing the id of the MyMoneyBudget object + * @param id TQString containing the id of the MyMoneyBudget object * @return MyMoneyBudget object */ - MyMoneyBudget budget( const QString& id ) const; + MyMoneyBudget budget( const TQString& id ) const; /** * This method is used to remove an existing MyMoneyBudget object @@ -939,9 +939,9 @@ public: /** * This method retrieves a price from the price list. - * If @p date is inValid, QDate::currentDate() is assumed. + * If @p date is inValid, TQDate::tqcurrentDate() is assumed. */ - const MyMoneyPrice price(const QString& fromId, const QString& toId, const QDate& date, const bool exactDate) const; + const MyMoneyPrice price(const TQString& fromId, const TQString& toId, const TQDate& date, const bool exactDate) const; /** * This method returns a list of all price entries. @@ -958,7 +958,7 @@ public: * by another engine object. * * @param obj const reference to object to be checked - * @param skipCheck QBitArray with ReferenceCheckBits set for which + * @param skipCheck TQBitArray with ReferenceCheckBits set for which * the check should be skipped * * @retval false @p object is not referenced @@ -977,7 +977,7 @@ public: virtual void rollbackTransaction(void); protected: - void removeReferences(const QString& id); + void removeReferences(const TQString& id); private: @@ -997,12 +997,12 @@ private: void touch(void); /** - * This method is used to invalidate the cached balance for - * the selected account and all it's parents. + * This method is used to tqinvalidate the cached balance for + * the selected account and all it's tqparents. * * @param id id of the account in question */ - void invalidateBalanceCache(const QString& id); + void tqinvalidateBalanceCache(const TQString& id); /** * This member variable keeps the User information. @@ -1065,50 +1065,50 @@ private: * The member variable m_institutionList is the container for the * institutions known within this file. */ - MyMoneyMap<QString, MyMoneyInstitution> m_institutionList; + MyMoneyMap<TQString, MyMoneyInstitution> m_institutionList; /** * The member variable m_accountList is the container for the accounts * known within this file. */ - MyMoneyMap<QString, MyMoneyAccount> m_accountList; + MyMoneyMap<TQString, MyMoneyAccount> m_accountList; /** * The member variable m_balanceCache is the container for the * accounts actual balance */ - mutable QMap<QString, MyMoneyBalanceCacheItem> m_balanceCache; + mutable TQMap<TQString, MyMoneyBalanceCacheItem> m_balanceCache; /** * This member keeps the date for which the m_balanceCache member * is valid. In case the whole cache is invalid it is set to - * QDate(). + * TQDate(). */ - mutable QDate m_balanceCacheDate; + mutable TQDate m_balanceCacheDate; /** * The member variable m_transactionList is the container for all * transactions within this file. * @see m_transactionKeys */ - MyMoneyMap<QString, MyMoneyTransaction> m_transactionList; + MyMoneyMap<TQString, MyMoneyTransaction> m_transactionList; /** * The member variable m_transactionKeys is used to convert * transaction id's into the corresponding key used in m_transactionList. * @see m_transactionList; */ - MyMoneyMap<QString, QString> m_transactionKeys; + MyMoneyMap<TQString, TQString> m_transactionKeys; /** * A list containing all the payees that have been used */ - MyMoneyMap<QString, MyMoneyPayee> m_payeeList; + MyMoneyMap<TQString, MyMoneyPayee> m_payeeList; /** * A list containing all the scheduled transactions */ - MyMoneyMap<QString, MyMoneySchedule> m_scheduleList; + MyMoneyMap<TQString, MyMoneySchedule> m_scheduleList; /** * A list containing all the security information objects. Each object @@ -1117,19 +1117,19 @@ private: * to determine the cost basis for sales, as well as the source of * information for reports in a security account. */ - MyMoneyMap<QString, MyMoneySecurity> m_securitiesList; + MyMoneyMap<TQString, MyMoneySecurity> m_securitiesList; /** * A list containing all the currency information objects. */ - MyMoneyMap<QString, MyMoneySecurity> m_currencyList; + MyMoneyMap<TQString, MyMoneySecurity> m_currencyList; - MyMoneyMap<QString, MyMoneyReport> m_reportList; + MyMoneyMap<TQString, MyMoneyReport> m_reportList; /** * A list containing all the budget information objects. */ - MyMoneyMap<QString, MyMoneyBudget> m_budgetList; + MyMoneyMap<TQString, MyMoneyBudget> m_budgetList; MyMoneyMap<MyMoneySecurityPair, MyMoneyPriceEntries> m_priceList; @@ -1143,13 +1143,13 @@ private: * object. It is set during the constructor and can only be modified using * the stream read operator. */ - QDate m_creationDate; + TQDate m_creationDate; /** * This member variable keeps the date of the last modification of * the MyMoneySeqAccessMgr object. */ - QDate m_lastModificationDate; + TQDate m_lastModificationDate; /** * This member variable contains the current fix level of application @@ -1165,58 +1165,58 @@ private: * This method is used to get the next valid ID for a institution * @return id for a institution */ - QString nextInstitutionID(void); + TQString nextInstitutionID(void); /** * This method is used to get the next valid ID for an account * @return id for an account */ - QString nextAccountID(void); + TQString nextAccountID(void); /** * This method is used to get the next valid ID for a transaction * @return id for a transaction */ - QString nextTransactionID(void); + TQString nextTransactionID(void); /** * This method is used to get the next valid ID for a payee * @return id for a payee */ - QString nextPayeeID(void); + TQString nextPayeeID(void); /** * This method is used to get the next valid ID for a scheduled transaction * @return id for a scheduled transaction */ - QString nextScheduleID(void); + TQString nextScheduleID(void); /** * This method is used to get the next valid ID for an security object. * @return id for an security object */ - QString nextSecurityID(void); + TQString nextSecurityID(void); - QString nextReportID(void); + TQString nextReportID(void); /** * This method is used to get the next valid ID for a budget object. * @return id for an budget object */ - QString nextBudgetID(void); + TQString nextBudgetID(void); /** - * This method re-parents an existing account + * This method re-tqparents an existing account * * An exception will be thrown upon error conditions. * - * @param account MyMoneyAccount reference to account to be re-parented - * @param parent MyMoneyAccount reference to new parent account + * @param account MyMoneyAccount reference to account to be re-tqparented + * @param tqparent MyMoneyAccount reference to new tqparent account * @param sendNotification if true, notifications with the ids * of all modified objects are send */ - void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& parent, const bool sendNotification); + void reparentAccount(MyMoneyAccount &account, MyMoneyAccount& tqparent, const bool sendNotification); /** * This method will close a database and log the use roff */ diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp index 09bf791..9decdce 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.cpp @@ -63,7 +63,7 @@ void MyMoneySeqAccessMgrTest::testEmptyConstructor() CPPUNIT_ASSERT(m->m_scheduleList.count() == 0); CPPUNIT_ASSERT(m->m_dirty == false); - CPPUNIT_ASSERT(m->m_creationDate == QDate::currentDate()); + CPPUNIT_ASSERT(m->m_creationDate == TQDate::tqcurrentDate()); CPPUNIT_ASSERT(m->liability().name() == "Liability"); CPPUNIT_ASSERT(m->asset().name() == "Asset"); @@ -354,7 +354,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { m->commitTransaction(); m->startTransaction(); MyMoneyAccount b = m->account("A000001"); - CPPUNIT_ASSERT(b.parentAccountId() == a.parentAccountId()); + CPPUNIT_ASSERT(b.tqparentAccountId() == a.tqparentAccountId()); CPPUNIT_ASSERT(b.name() == "New account name"); CPPUNIT_ASSERT(m->dirty() == true); } catch (MyMoneyException *e) { @@ -383,7 +383,7 @@ void MyMoneySeqAccessMgrTest::testModifyAccount() { delete e; } - // use different parent + // use different tqparent a.setParentAccountId("A000002"); try { m->modifyAccount(c); @@ -422,7 +422,7 @@ void MyMoneySeqAccessMgrTest::testModifyInstitution() { } } -void MyMoneySeqAccessMgrTest::testReparentAccount() { +void MyMoneySeqAccessMgrTest::testRetqparentAccount() { // this one adds some accounts to the database MyMoneyAccount ex1; ex1.setAccountType(MyMoneyAccount::Expense); @@ -460,27 +460,27 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { CPPUNIT_ASSERT(in.id() == "A000005"); CPPUNIT_ASSERT(ch.id() == "A000006"); - MyMoneyAccount parent = m->expense(); + MyMoneyAccount tqparent = m->expense(); - m->addAccount(parent, ex1); + m->addAccount(tqparent, ex1); m->addAccount(ex1, ex2); - m->addAccount(parent, ex3); - m->addAccount(parent, ex4); + m->addAccount(tqparent, ex3); + m->addAccount(tqparent, ex4); - parent = m->income(); - m->addAccount(parent, in); + tqparent = m->income(); + m->addAccount(tqparent, in); - parent = m->asset(); - m->addAccount(parent, ch); + tqparent = m->asset(); + m->addAccount(tqparent, ch); CPPUNIT_ASSERT(m->expense().accountCount() == 3); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 1); - CPPUNIT_ASSERT(ex3.parentAccountId() == STD_ACC_EXPENSE); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == STD_ACC_EXPENSE); m->reparentAccount(ex3, ex1); CPPUNIT_ASSERT(m->expense().accountCount() == 2); CPPUNIT_ASSERT(m->account(ex1.id()).accountCount() == 2); - CPPUNIT_ASSERT(ex3.parentAccountId() == ex1.id()); + CPPUNIT_ASSERT(ex3.tqparentAccountId() == ex1.id()); } catch (MyMoneyException *e) { std::cout << std::endl << e->what() << std::endl; delete e; @@ -489,7 +489,7 @@ void MyMoneySeqAccessMgrTest::testReparentAccount() { } void MyMoneySeqAccessMgrTest::testAddTransactions() { - testReparentAccount(); + testRetqparentAccount(); MyMoneyAccount ch; MyMoneyTransaction t1, t2; @@ -503,14 +503,14 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000005"); // Salary s.setShares(-100000); s.setValue(-100000); CPPUNIT_ASSERT(s.id().isEmpty()); t1.addSplit(s); - t1.setPostDate(QDate(2002,5,10)); + t1.setPostDate(TQDate(2002,5,10)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -530,35 +530,35 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { try { // I spent some money, not so great - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000004"); // Grosseries s.setShares(10000); s.setValue(10000); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000002"); // 16% sales tax s.setShares(1200); s.setValue(1200); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000003"); // 7% sales tax s.setShares(400); s.setValue(400); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - s.setId(QString()); // enable re-usage of split variable + s.setId(TQString()); // enable re-usage of split variable s.setAccountId("A000006"); // Checkings account s.setShares(-11600); s.setValue(-11600); CPPUNIT_ASSERT(s.id().isEmpty()); t2.addSplit(s); - t2.setPostDate(QDate(2002,5,9)); + t2.setPostDate(TQDate(2002,5,9)); } catch (MyMoneyException *e) { unexpectedException(e); } @@ -572,8 +572,8 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { CPPUNIT_ASSERT(t2.splitCount() == 4); CPPUNIT_ASSERT(m->transactionCount() == 2); - 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->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); @@ -591,12 +591,12 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000002"); ++it; @@ -607,7 +607,7 @@ void MyMoneySeqAccessMgrTest::testAddTransactions() { /* removed with MyMoneyAccount::Transaction CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList<MyMoneyAccount::Transaction>::ConstIterator it_l; + TQValueList<MyMoneyAccount::Transaction>::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000002"); CPPUNIT_ASSERT((*it_l).balance() == -11600); @@ -642,9 +642,9 @@ void MyMoneySeqAccessMgrTest::testBalance() { CPPUNIT_ASSERT(m->balance("A000002") == MyMoneyMoney(1200)); CPPUNIT_ASSERT(m->balance("A000003") == MyMoneyMoney(400)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,9)) == MyMoneyMoney(-11600)); - CPPUNIT_ASSERT(m->balance("A000005", QDate(2002,5,10)) == MyMoneyMoney(-100000)); - CPPUNIT_ASSERT(m->balance("A000006", QDate(2002,5,10)) == MyMoneyMoney(88400)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,9)) == MyMoneyMoney(-11600)); + CPPUNIT_ASSERT(m->balance("A000005", TQDate(2002,5,10)) == MyMoneyMoney(-100000)); + CPPUNIT_ASSERT(m->balance("A000006", TQDate(2002,5,10)) == MyMoneyMoney(88400)); } void MyMoneySeqAccessMgrTest::testModifyTransaction() { @@ -682,15 +682,15 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { } // now modify the date - t.setPostDate(QDate(2002,5,11)); + t.setPostDate(TQDate(2002,5,11)); try { m->modifyTransaction(t); CPPUNIT_ASSERT(m->balance("A000004") == MyMoneyMoney(11000)); CPPUNIT_ASSERT(m->balance("A000006") == MyMoneyMoney(100000-12600)); CPPUNIT_ASSERT(m->totalBalance("A000001") == MyMoneyMoney(1600)); - 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->m_transactionKeys.begin(); it_t = m->m_transactionList.begin(); CPPUNIT_ASSERT((*it_k) == "2002-05-10-T000000000000000001"); @@ -707,12 +707,12 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { ch = m->account("A000006"); // check that the account's transaction list is updated - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.size() == 2); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; it = list.begin(); CPPUNIT_ASSERT((*it).id() == "T000000000000000001"); ++it; @@ -723,7 +723,7 @@ void MyMoneySeqAccessMgrTest::testModifyTransaction() { /* removed with MyMoneyAccount::Transaction // CPPUNIT_ASSERT(ch.transactionCount() == 2); - QValueList<MyMoneyAccount::Transaction>::ConstIterator it_l; + TQValueList<MyMoneyAccount::Transaction>::ConstIterator it_l; it_l = ch.transactionList().begin(); CPPUNIT_ASSERT((*it_l).transactionID() == "T000000000000000001"); CPPUNIT_ASSERT((*it_l).balance() == 100000); @@ -792,7 +792,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUnusedAccount() { CPPUNIT_ASSERT(i.accountCount() == 0); CPPUNIT_ASSERT(m->accountCount() == 7); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->removeAccount(a); m->commitTransaction(); @@ -822,7 +822,7 @@ void MyMoneySeqAccessMgrTest::testRemoveUsedAccount() { void MyMoneySeqAccessMgrTest::testRemoveInstitution() { testModifyInstitution(); - testReparentAccount(); + testRetqparentAccount(); MyMoneyInstitution i; MyMoneyAccount a; @@ -843,7 +843,7 @@ void MyMoneySeqAccessMgrTest::testRemoveInstitution() { // now remove the institution and see if the account survived ;-) try { m->removeInstitution(i); - a.setInstitutionId(QString()); + a.setInstitutionId(TQString()); m->modifyAccount(a); m->commitTransaction(); m->startTransaction(); @@ -881,7 +881,7 @@ void MyMoneySeqAccessMgrTest::testRemoveTransaction() { void MyMoneySeqAccessMgrTest::testTransactionList() { testAddTransactions(); - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; MyMoneyTransactionFilter filter("A000006"); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 2); @@ -889,7 +889,7 @@ void MyMoneySeqAccessMgrTest::testTransactionList() { CPPUNIT_ASSERT((*(list.at(1))).id() == "T000000000000000001"); filter.clear(); - filter.addAccount(QString("A000003")); + filter.addAccount(TQString("A000003")); list = m->transactionList(filter); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT((*(list.at(0))).id() == "T000000000000000002"); @@ -1091,7 +1091,7 @@ void MyMoneySeqAccessMgrTest::testPayeeName() { testAddPayee(); MyMoneyPayee p; - QString name("THB"); + TQString name("THB"); // OK case try { @@ -1193,11 +1193,11 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); - t1.setPostDate(QDate(2003,7,10)); + t1.setPostDate(TQDate(2003,7,10)); schedule.setTransaction(t1); m->addSchedule(schedule); @@ -1215,8 +1215,8 @@ void MyMoneySeqAccessMgrTest::testAddSchedule() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_MANUALDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), true, false); m->addSchedule(schedule); @@ -1302,9 +1302,9 @@ void MyMoneySeqAccessMgrTest::testRemoveSchedule() { } void MyMoneySeqAccessMgrTest::testScheduleList() { - QDate testDate = QDate::currentDate(); - QDate notOverdue = testDate.addDays(2); - QDate overdue = testDate.addDays(-2); + TQDate testDate = TQDate::tqcurrentDate(); + TQDate notOverdue = testDate.addDays(2); + TQDate overdue = testDate.addDays(-2); MyMoneyTransaction t1; @@ -1317,8 +1317,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_ONCE, 1, MyMoneySchedule::STYPE_DIRECTDEBIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t1.setPostDate(notOverdue); @@ -1335,8 +1335,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_DEPOSIT, MyMoneySchedule::OCCUR_DAILY, 1, MyMoneySchedule::STYPE_DIRECTDEPOSIT, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t2.setPostDate(notOverdue.addDays(1)); @@ -1353,8 +1353,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule::TYPE_TRANSFER, MyMoneySchedule::OCCUR_WEEKLY, 1, MyMoneySchedule::STYPE_OTHER, - QDate(), - QDate(), + TQDate(), + TQDate(), false, false); t3.setPostDate(notOverdue.addDays(2)); @@ -1370,8 +1370,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { MyMoneySchedule schedule4("Schedule 4", MyMoneySchedule::TYPE_BILL, MyMoneySchedule::OCCUR_WEEKLY, 1, - MyMoneySchedule::STYPE_WRITECHEQUE, - QDate(), + MyMoneySchedule::STYPE_WRITECHETQUE, + TQDate(), notOverdue.addDays(31), false, false); @@ -1389,7 +1389,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { CPPUNIT_FAIL("Unexpected exception"); } - QValueList<MyMoneySchedule> list; + TQValueList<MyMoneySchedule> list; // no filter list = m->scheduleList(); @@ -1436,7 +1436,7 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), + TQDate(), notOverdue.addDays(1)); CPPUNIT_ASSERT(list.count() == 3); CPPUNIT_ASSERT(list[0].name() == "Schedule 1"); @@ -1457,8 +1457,8 @@ void MyMoneySeqAccessMgrTest::testScheduleList() { list = m->scheduleList("", MyMoneySchedule::TYPE_ANY, MyMoneySchedule::OCCUR_ANY, MyMoneySchedule::STYPE_ANY, - QDate(), - QDate(), + TQDate(), + TQDate(), true); CPPUNIT_ASSERT(list.count() == 1); CPPUNIT_ASSERT(list[0].name() == "Schedule 4"); @@ -1606,7 +1606,7 @@ void MyMoneySeqAccessMgrTest::testCurrencyList() void MyMoneySeqAccessMgrTest::testAccountList() { - QValueList<MyMoneyAccount> accounts; + TQValueList<MyMoneyAccount> accounts; m->accountList(accounts); CPPUNIT_ASSERT(accounts.count() == 0); testAddNewAccount(); @@ -1628,7 +1628,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() m->rollbackTransaction(); // account loader - QMap<QString, MyMoneyAccount> amap; + TQMap<TQString, MyMoneyAccount> amap; MyMoneyAccount acc("A0000176", MyMoneyAccount()); amap[acc.id()] = acc; m->loadAccounts(amap); @@ -1637,7 +1637,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextAccountID == 176); // transaction loader - QMap<QString, MyMoneyTransaction> tmap; + TQMap<TQString, MyMoneyTransaction> tmap; MyMoneyTransaction t("T000000108", MyMoneyTransaction()); tmap[t.id()] = t; m->loadTransactions(tmap); @@ -1646,7 +1646,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextTransactionID == 108); // institution loader - QMap<QString, MyMoneyInstitution> imap; + TQMap<TQString, MyMoneyInstitution> imap; MyMoneyInstitution inst("I000028", MyMoneyInstitution()); imap[inst.id()] = inst; m->loadInstitutions(imap); @@ -1655,7 +1655,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextInstitutionID == 28); // payee loader - QMap<QString, MyMoneyPayee> pmap; + TQMap<TQString, MyMoneyPayee> pmap; MyMoneyPayee p("P1234", MyMoneyPayee()); pmap[p.id()] = p; m->loadPayees(pmap); @@ -1664,7 +1664,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextPayeeID == 1234); // security loader - QMap<QString, MyMoneySecurity> smap; + TQMap<TQString, MyMoneySecurity> smap; MyMoneySecurity s("S54321", MyMoneySecurity()); smap[s.id()] = s; m->loadSecurities(smap); @@ -1673,7 +1673,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextSecurityID == 54321); // schedule loader - QMap<QString, MyMoneySchedule> schmap; + TQMap<TQString, MyMoneySchedule> schmap; MyMoneySchedule sch("SCH6789", MyMoneySchedule()); schmap[sch.id()] = sch; m->loadSchedules(schmap); @@ -1682,7 +1682,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextScheduleID == 6789); // report loader - QMap<QString, MyMoneyReport> rmap; + TQMap<TQString, MyMoneyReport> rmap; MyMoneyReport r("R1298", MyMoneyReport()); rmap[r.id()] = r; m->loadReports(rmap); @@ -1691,7 +1691,7 @@ void MyMoneySeqAccessMgrTest::testLoaderFunctions() CPPUNIT_ASSERT(m->m_nextReportID == 1298); // budget loader - QMap<QString, MyMoneyBudget> bmap; + TQMap<TQString, MyMoneyBudget> bmap; MyMoneyBudget b("B89765", MyMoneyBudget()); bmap[b.id()] = b; m->loadBudgets(bmap); diff --git a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h index b9fa763..57f1cd6 100644 --- a/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h +++ b/kmymoney2/mymoney/storage/mymoneyseqaccessmgrtest.h @@ -14,8 +14,8 @@ * * ***************************************************************************/ -#ifndef __MYMONEYSEQACCESSMGRTEST_H__ -#define __MYMONEYSEQACCESSMGRTEST_H__ +#ifndef __MYMONEYSETQACCESSMGRTEST_H__ +#define __MYMONEYSETQACCESSMGRTEST_H__ #include <cppunit/TestCaller.h> #include <cppunit/TestCase.h> @@ -38,7 +38,7 @@ class MyMoneySeqAccessMgrTest : public CppUnit::TestFixture { CPPUNIT_TEST(testIsStandardAccount); CPPUNIT_TEST(testNewAccount); CPPUNIT_TEST(testAddNewAccount); - CPPUNIT_TEST(testReparentAccount); + CPPUNIT_TEST(testRetqparentAccount); CPPUNIT_TEST(testAddInstitution); CPPUNIT_TEST(testInstitution); CPPUNIT_TEST(testAccount2Institution); @@ -94,7 +94,7 @@ public: void testAccount2Institution(); void testModifyAccount(); void testModifyInstitution(); - void testReparentAccount(); + void testRetqparentAccount(); void testAddTransactions(); void testTransactionCount(); void testBalance(); diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp index 31f051e..bb0ab60 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.cpp +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.cpp @@ -26,9 +26,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qfile.h> -#include <qdom.h> -#include <qmap.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqmap.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -42,8 +42,8 @@ #include "../mymoneyreport.h" #include "../mymoneyinstitution.h" -QStringList MyMoneyStorageANON::zKvpNoModify = QStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); -QStringList MyMoneyStorageANON::zKvpXNumber = QStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); +TQStringList MyMoneyStorageANON::zKvpNoModify = TQStringList::split(",","kmm-baseCurrency,PreferredAccount,Tax,fixed-interest,interest-calculation,payee,schedule,term,kmm-online-source,kmm-brokerage-account,lastStatementDate,kmm-sort-reconcile,kmm-sort-std,kmm-iconpos,mm-closed,payee,schedule,term,lastImportedTransactionDate,VatAccount,VatRate,kmm-matched-tx,Imported"); +TQStringList MyMoneyStorageANON::zKvpXNumber = TQStringList::split(",","final-payment,loan-amount,periodic-payment,lastStatementBalance"); MyMoneyStorageANON::MyMoneyStorageANON() : @@ -54,7 +54,7 @@ MyMoneyStorageANON::MyMoneyStorageANON() : int msec; do { - msec = QTime::currentTime().msec(); + msec = TQTime::currentTime().msec(); } while(msec == 0); m_factor = MyMoneyMoney(msec, 10).reduce(); } @@ -63,29 +63,29 @@ MyMoneyStorageANON::~MyMoneyStorageANON() { } -void MyMoneyStorageANON::readFile(QIODevice* , IMyMoneySerialize* ) +void MyMoneyStorageANON::readFile(TQIODevice* , IMyMoneySerialize* ) { throw new MYMONEYEXCEPTION("Cannot read a file through MyMoneyStorageANON!!"); } -void MyMoneyStorageANON::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageANON::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); - userInfo.setAttribute(QString("name"), hideString(user.name())); - userInfo.setAttribute(QString("email"), hideString(user.email())); + userInfo.setAttribute(TQString("name"), hideString(user.name())); + userInfo.setAttribute(TQString("email"), hideString(user.email())); - QDomElement address = m_doc->createElement("ADDRESS"); - address.setAttribute(QString("street"), hideString(user.address())); - address.setAttribute(QString("city"), hideString(user.city())); - address.setAttribute(QString("county"), hideString(user.state())); - address.setAttribute(QString("zipcode"), hideString(user.postcode())); - address.setAttribute(QString("telephone"), hideString(user.telephone())); + TQDomElement address = m_doc->createElement("ADDRESS"); + address.setAttribute(TQString("street"), hideString(user.address())); + address.setAttribute(TQString("city"), hideString(user.city())); + address.setAttribute(TQString("county"), hideString(user.state())); + address.setAttribute(TQString("zipcode"), hideString(user.postcode())); + address.setAttribute(TQString("telephone"), hideString(user.telephone())); userInfo.appendChild(address); } -void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMoneyInstitution& _i) +void MyMoneyStorageANON::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& _i) { MyMoneyInstitution i(_i); @@ -103,7 +103,7 @@ void MyMoneyStorageANON::writeInstitution(QDomElement& institution, const MyMone } -void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) +void MyMoneyStorageANON::writePayee(TQDomElement& payee, const MyMoneyPayee& _p) { MyMoneyPayee p(_p); @@ -117,15 +117,15 @@ void MyMoneyStorageANON::writePayee(QDomElement& payee, const MyMoneyPayee& _p) p.setTelephone(hideString(p.telephone())); p.setNotes(hideString(p.notes())); bool ignoreCase; - QStringList keys; + TQStringList keys; MyMoneyPayee::payeeMatchType matchType = p.matchData(ignoreCase, keys); - QRegExp exp("[A-Za-z]"); - p.setMatchData(matchType, ignoreCase, QStringList::split(";", keys.join(";").replace(exp, "x"))); + TQRegExp exp("[A-Za-z]"); + p.setMatchData(matchType, ignoreCase, TQStringList::split(";", keys.join(";").tqreplace(exp, "x"))); MyMoneyStorageXML::writePayee(payee, p); } -void MyMoneyStorageANON::writeAccount(QDomElement& account, const MyMoneyAccount& _p) +void MyMoneyStorageANON::writeAccount(TQDomElement& account, const MyMoneyAccount& _p) { MyMoneyAccount p(_p); @@ -149,10 +149,10 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) tn.setBankID(hideString(tx.bankID())); // hide split data - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneySplit s = (*it_s); - s.setMemo(QString("%1/%2").arg(tn.id()).arg(s.id())); + s.setMemo(TQString("%1/%2").tqarg(tn.id()).tqarg(s.id())); if(s.value() != MyMoneyMoney::autoCalc) { s.setValue((s.value() * m_factor)); @@ -175,14 +175,14 @@ void MyMoneyStorageANON::fakeTransaction(MyMoneyTransaction& tx) void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) { - QMap<QString, QString> pairs; - QMap<QString, QString>::const_iterator it; + TQMap<TQString, TQString> pairs; + TQMap<TQString, TQString>::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { - if ( zKvpXNumber.contains( it.key() ) || it.key().left(3)=="ir-" ) + if ( zKvpXNumber.tqcontains( it.key() ) || it.key().left(3)=="ir-" ) pairs[it.key()] = hideNumber(MyMoneyMoney(it.data())).toString(); - else if ( zKvpNoModify.contains( it.key() ) ) + else if ( zKvpNoModify.tqcontains( it.key() ) ) pairs[it.key()] = it.data(); else pairs[it.key()] = hideString(it.data()); @@ -190,7 +190,7 @@ void MyMoneyStorageANON::fakeKeyValuePair(MyMoneyKeyValueContainer& kvp) kvp.setPairs(pairs); } -void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx) +void MyMoneyStorageANON::writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx) { MyMoneyTransaction tn = tx; @@ -199,7 +199,7 @@ void MyMoneyStorageANON::writeTransaction(QDomElement& transactions, const MyMon MyMoneyStorageXML::writeTransaction(transactions, tn); } -void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& sx) +void MyMoneyStorageANON::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& sx) { MyMoneySchedule sn = sx; MyMoneyTransaction tn = sn.transaction(); @@ -212,7 +212,7 @@ void MyMoneyStorageANON::writeSchedule(QDomElement& scheduledTx, const MyMoneySc MyMoneyStorageXML::writeSchedule(scheduledTx, sn); } -void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageANON::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { MyMoneySecurity s = security; s.setName(security.id()); @@ -221,9 +221,9 @@ void MyMoneyStorageANON::writeSecurity(QDomElement& securityElement, const MyMon MyMoneyStorageXML::writeSecurity(securityElement, s); } -QString MyMoneyStorageANON::hideString(const QString& _in) const +TQString MyMoneyStorageANON::hideString(const TQString& _in) const { - return QString(_in).fill('x'); + return TQString(_in).fill('x'); } MyMoneyMoney MyMoneyStorageANON::hideNumber(const MyMoneyMoney& _in) const @@ -257,8 +257,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bn.setBudgetStart(bx.budgetStart()); bn = MyMoneyBudget(bx.id(), bn); - QValueList<MyMoneyBudget::AccountGroup> list = bx.getaccounts(); - QValueList<MyMoneyBudget::AccountGroup>::iterator it; + TQValueList<MyMoneyBudget::AccountGroup> list = bx.getaccounts(); + TQValueList<MyMoneyBudget::AccountGroup>::iterator it; for(it = list.begin(); it != list.end(); ++it) { // only add the account if there is a budget entered if(!(*it).balance().isZero()) { @@ -266,8 +266,8 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) account.setId((*it).id()); account.setBudgetLevel((*it).budgetLevel()); account.setBudgetSubaccounts((*it).budgetSubaccounts()); - QMap<QDate, MyMoneyBudget::PeriodGroup> plist = (*it).getPeriods(); - QMap<QDate, MyMoneyBudget::PeriodGroup>::const_iterator it_p; + TQMap<TQDate, MyMoneyBudget::PeriodGroup> plist = (*it).getPeriods(); + TQMap<TQDate, MyMoneyBudget::PeriodGroup>::const_iterator it_p; for(it_p = plist.begin(); it_p != plist.end(); ++it_p) { MyMoneyBudget::PeriodGroup pGroup; pGroup.setAmount((*it_p).amount() * m_factor ); @@ -281,7 +281,7 @@ void MyMoneyStorageANON::fakeBudget(MyMoneyBudget& bx) bx = bn; } -void MyMoneyStorageANON::writeBudget(QDomElement& budgets, const MyMoneyBudget& b) +void MyMoneyStorageANON::writeBudget(TQDomElement& budgets, const MyMoneyBudget& b) { MyMoneyBudget bn = b; diff --git a/kmymoney2/mymoney/storage/mymoneystorageanon.h b/kmymoney2/mymoney/storage/mymoneystorageanon.h index 4b7ab95..5919220 100644 --- a/kmymoney2/mymoney/storage/mymoneystorageanon.h +++ b/kmymoney2/mymoney/storage/mymoneystorageanon.h @@ -27,9 +27,9 @@ // ---------------------------------------------------------------------------- // QT Includes -// #include <qdom.h> -// #include <qdatastream.h> -// class QIODevice; +// #include <tqdom.h> +// #include <tqdatastream.h> +// class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -70,38 +70,38 @@ public: virtual ~MyMoneyStorageANON(); protected: - void writeUserInformation(QDomElement& userInfo); + void writeUserInformation(TQDomElement& userInfo); - void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); + void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); - void writePayee(QDomElement& payees, const MyMoneyPayee& p); + void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - void writeBudget(QDomElement& budgets, const MyMoneyBudget& b); + void writeBudget(TQDomElement& budgets, const MyMoneyBudget& b); - void readFile(QIODevice* s, IMyMoneySerialize* storage); + void readFile(TQIODevice* s, IMyMoneySerialize* storage); - void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: /** * The list of key-value pairs to not modify */ - static QStringList zKvpNoModify; + static TQStringList zKvpNoModify; /** * The list of key-value pairs which are numbers to be hidden */ - static QStringList zKvpXNumber; + static TQStringList zKvpXNumber; - QString hideString(const QString&) const; + TQString hideString(const TQString&) const; MyMoneyMoney hideNumber(const MyMoneyMoney&) const; void fakeTransaction(MyMoneyTransaction& tn); void fakeBudget(MyMoneyBudget& bn); diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp index e0d0083..77fa395 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.cpp @@ -23,10 +23,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> // ---------------------------------------------------------------------------- // Project Includes @@ -45,14 +45,14 @@ MyMoneyStorageDump::~MyMoneyStorageDump() { } -void MyMoneyStorageDump::readStream(QDataStream& /* s */, IMyMoneySerialize* /* storage */) +void MyMoneyStorageDump::readStream(TQDataStream& /* s */, IMyMoneySerialize* /* storage */) { qDebug("Reading not supported by MyMoneyStorageDump!!"); } -void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storage) +void MyMoneyStorageDump::writeStream(TQDataStream& _s, IMyMoneySerialize* _storage) { - QTextStream s(_s.device()); + TQTextStream s(_s.device()); IMyMoneyStorage* storage = dynamic_cast<IMyMoneyStorage *> (_storage); MyMoneyPayee user = storage->user(); @@ -72,18 +72,18 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Internal-Info\n"; s << "-------------\n"; - QValueList<MyMoneyAccount> list_a; + TQValueList<MyMoneyAccount> list_a; storage->accountList(list_a); s << "accounts = " << list_a.count() <<", next id = " << _storage->accountId() << "\n"; MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> list_t; + TQValueList<MyMoneyTransaction> list_t; storage->transactionList(list_t, filter); - QValueList<MyMoneyTransaction>::ConstIterator it_t; + TQValueList<MyMoneyTransaction>::ConstIterator it_t; s << "transactions = " << list_t.count() << ", next id = " << _storage->transactionId() << "\n"; - QMap<int,int> xferCount; + TQMap<int,int> xferCount; for(it_t = list_t.begin(); it_t != list_t.end(); ++it_t) { - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; int accountCount = 0; for(it_s = (*it_t).splits().begin(); it_s != (*it_t).splits().end(); ++it_s) { MyMoneyAccount acc = storage->account((*it_s).accountId()); @@ -94,7 +94,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag if(accountCount > 1) xferCount[accountCount] = xferCount[accountCount] + 1; } - QMap<int,int>::ConstIterator it_cnt; + TQMap<int,int>::ConstIterator it_cnt; for(it_cnt = xferCount.begin(); it_cnt != xferCount.end(); ++it_cnt) { s << " " << *it_cnt << " of them references " << it_cnt.key() << " accounts\n"; } @@ -107,8 +107,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Institutions\n"; s << "------------\n"; - QValueList<MyMoneyInstitution> list_i = storage->institutionList(); - QValueList<MyMoneyInstitution>::ConstIterator it_i; + TQValueList<MyMoneyInstitution> list_i = storage->institutionList(); + TQValueList<MyMoneyInstitution>::ConstIterator it_i; for(it_i = list_i.begin(); it_i != list_i.end(); ++it_i) { s << " ID = " << (*it_i).id() << "\n"; s << " Name = " << (*it_i).name() << "\n"; @@ -119,8 +119,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Payees" << "\n"; s << "------" << "\n"; - QValueList<MyMoneyPayee> list_p = storage->payeeList(); - QValueList<MyMoneyPayee>::ConstIterator it_p; + TQValueList<MyMoneyPayee> list_p = storage->payeeList(); + TQValueList<MyMoneyPayee>::ConstIterator it_p; for(it_p = list_p.begin(); it_p != list_p.end(); ++it_p) { s << " ID = " << (*it_p).id() << "\n"; s << " Name = " << (*it_p).name() << "\n"; @@ -144,7 +144,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag list_a.push_front(storage->income()); list_a.push_front(storage->liability()); list_a.push_front(storage->asset()); - QValueList<MyMoneyAccount>::ConstIterator it_a; + TQValueList<MyMoneyAccount>::ConstIterator it_a; for(it_a = list_a.begin(); it_a != list_a.end(); ++it_a) { s << " ID = " << (*it_a).id() << "\n"; s << " Name = " << (*it_a).name() << "\n"; @@ -160,10 +160,10 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " Currency = " << storage->currency((*it_a).currencyId()).name() << "\n"; } } - s << " Parent = " << (*it_a).parentAccountId(); - if(!(*it_a).parentAccountId().isEmpty()) { - MyMoneyAccount parent = storage->account((*it_a).parentAccountId()); - s << " (" << parent.name() << ")"; + s << " Parent = " << (*it_a).tqparentAccountId(); + if(!(*it_a).tqparentAccountId().isEmpty()) { + MyMoneyAccount tqparent = storage->account((*it_a).tqparentAccountId()); + s << " (" << tqparent.name() << ")"; } else { s << "n/a"; } @@ -186,8 +186,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag dumpKVP(" KVP: ", s, *it_a); dumpKVP(" OnlineBankingSettings: ", s, (*it_a).onlineBankingSettings()); - QStringList list_s = (*it_a).accountList(); - QStringList::ConstIterator it_s; + TQStringList list_s = (*it_a).accountList(); + TQStringList::ConstIterator it_s; if(list_s.count() > 0) { s << " Children =" << "\n"; } @@ -203,8 +203,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Currencies" << "\n"; s << "----------" << "\n"; - QValueList<MyMoneyCurrency> list_c = storage->currencyList(); - QValueList<MyMoneyCurrency>::ConstIterator it_c; + TQValueList<MyMoneyCurrency> list_c = storage->currencyList(); + TQValueList<MyMoneyCurrency>::ConstIterator it_c; for(it_c = list_c.begin(); it_c != list_c.end(); ++it_c) { s << " Name = " << (*it_c).name() << "\n"; s << " ID = " << (*it_c).id() << "\n"; @@ -221,8 +221,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Securities" << "\n"; s << "----------" << "\n"; - QValueList<MyMoneySecurity> list_e = storage->securityList(); - QValueList<MyMoneySecurity>::ConstIterator it_e; + TQValueList<MyMoneySecurity> list_e = storage->securityList(); + TQValueList<MyMoneySecurity>::ConstIterator it_e; for(it_e = list_e.begin(); it_e != list_e.end(); ++it_e) { s << " Name = " << (*it_e).name() << "\n"; s << " ID = " << (*it_e).id() << "\n"; @@ -244,8 +244,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " smallest account fraction = " << (*it_e).smallestAccountFraction() << "\n"; s << " KVP: " << "\n"; - QMap<QString, QString>kvp = (*it_e).pairs(); - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString>kvp = (*it_e).pairs(); + TQMap<TQString, TQString>::Iterator it; for(it = kvp.begin(); it != kvp.end(); ++it) { s << " '" << it.key() << "' = '" << it.data() << "'\n"; } @@ -264,7 +264,7 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag MyMoneyPriceEntries::ConstIterator it_pre; for(it_pre = (*it_pr).begin(); it_pre != (*it_pr).end(); ++it_pre) { s << " Date = " << (*it_pre).date().toString() << "\n"; - s << " Price = " << (*it_pre).rate(QString()).formatMoney("", 8) << "\n"; + s << " Price = " << (*it_pre).rate(TQString()).formatMoney("", 8) << "\n"; s << " Source = " << (*it_pre).source() << "\n"; s << " From = " << (*it_pre).from() << "\n"; s << " To = " << (*it_pre).to() << "\n"; @@ -285,8 +285,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Schedules" << "\n"; s << "---------" << "\n"; - QValueList<MyMoneySchedule> list_s = storage->scheduleList(); - QValueList<MyMoneySchedule>::ConstIterator it_s; + TQValueList<MyMoneySchedule> list_s = storage->scheduleList(); + TQValueList<MyMoneySchedule>::ConstIterator it_s; for(it_s = list_s.begin(); it_s != list_s.end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Name = " << (*it_s).name() << "\n"; @@ -314,8 +314,8 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << " = overdue!" << "\n"; } - QValueList<QDate> list_d; - QValueList<QDate>::ConstIterator it_d; + TQValueList<TQDate> list_d; + TQValueList<TQDate>::ConstIterator it_d; list_d = (*it_s).recordedPayments(); if(list_d.count() > 0) { @@ -332,26 +332,26 @@ void MyMoneyStorageDump::writeStream(QDataStream& _s, IMyMoneySerialize* _storag s << "Reports" << "\n"; s << "-------" << "\n"; - QValueList<MyMoneyReport> list_r = storage->reportList(); - QValueList<MyMoneyReport>::ConstIterator it_r; + TQValueList<MyMoneyReport> list_r = storage->reportList(); + TQValueList<MyMoneyReport>::ConstIterator it_r; for(it_r = list_r.begin(); it_r != list_r.end(); ++it_r) { s << " ID = " << (*it_r).id() << "\n"; s << " Name = " << (*it_r).name() << "\n"; } } -void MyMoneyStorageDump::dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) +void MyMoneyStorageDump::dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent) { - QString ind; + TQString ind; ind.fill(' ', indent); s << ind << headline << "\n"; - QMap<QString, QString>::const_iterator it; + TQMap<TQString, TQString>::const_iterator it; for(it = kvp.pairs().begin(); it != kvp.pairs().end(); ++it) { s << ind << " '" << it.key() << "' = '" << it.data() << "'\n"; } } -void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) +void MyMoneyStorageDump::dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t) { s << " ID = " << it_t.id() << "\n"; s << " Postdate = " << it_t.postDate().toString(Qt::ISODate) << "\n"; @@ -363,7 +363,7 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << " Splits\n"; s << " ------\n"; - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = it_t.splits().begin(); it_s != it_t.splits().end(); ++it_s) { s << " ID = " << (*it_s).id() << "\n"; s << " Transaction = " << (*it_s).transactionId() << "\n"; @@ -403,11 +403,11 @@ void MyMoneyStorageDump::dumpTransaction(QTextStream& s, IMyMoneyStorage* storag s << "\n"; } -#define i18n QString +#define i18n TQString -const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const +const TQString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE flag) const { - QString rc; + TQString rc; switch(flag) { case MyMoneySplit::NotReconciled: @@ -430,7 +430,7 @@ const QString MyMoneyStorageDump::reconcileToString(MyMoneySplit::reconcileFlagE } #if 0 -void MyMoneyStorageDump::dumpPriceHistory(QTextStream& s, const equity_price_history history) +void MyMoneyStorageDump::dumpPriceHistory(TQTextStream& s, const equity_price_history history) { if(history.count() != 0) { s << " Price History:\n"; diff --git a/kmymoney2/mymoney/storage/mymoneystoragedump.h b/kmymoney2/mymoney/storage/mymoneystoragedump.h index e399cde..3f7f33a 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragedump.h +++ b/kmymoney2/mymoney/storage/mymoneystoragedump.h @@ -26,7 +26,7 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qdatastream.h> +#include <tqdatastream.h> // ---------------------------------------------------------------------------- // Project Includes @@ -44,13 +44,13 @@ public: MyMoneyStorageDump(); ~MyMoneyStorageDump(); - void readStream(QDataStream& s, IMyMoneySerialize* storage); - void writeStream(QDataStream& s, IMyMoneySerialize* storage); + void readStream(TQDataStream& s, IMyMoneySerialize* storage); + void writeStream(TQDataStream& s, IMyMoneySerialize* storage); private: - void dumpTransaction(QTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); - void dumpKVP(const QString& headline, QTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); - const QString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; + void dumpTransaction(TQTextStream& s, IMyMoneyStorage* storage, const MyMoneyTransaction& it_t); + void dumpKVP(const TQString& headline, TQTextStream& s, const MyMoneyKeyValueContainer &kvp, int indent = 0); + const TQString reconcileToString(MyMoneySplit::reconcileFlagE flag) const; }; #endif diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp index 97b4c55..34c9573 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.cpp @@ -22,12 +22,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qstring.h> -#include <qdatetime.h> -#include <qvaluelist.h> -#include <qstringlist.h> -#include <qiodevice.h> -#include <qsqldriver.h> +#include <tqstring.h> +#include <tqdatetime.h> +#include <tqvaluelist.h> +#include <tqstringlist.h> +#include <tqiodevice.h> +#include <tqsqldriver.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -52,60 +52,52 @@ //***************** THE CURRENT VERSION OF THE DATABASE LAYOUT **************** unsigned int MyMoneyDbDef::m_currentVersion = 6; -// subclass QSqlQuery for performance tracing +// subclass TQSqlQuery for performance tracing MyMoneySqlQuery::MyMoneySqlQuery (MyMoneyStorageSql* db) - : QSqlQuery (static_cast<QSqlDatabase*>(db)) { + : TQSqlQuery (static_cast<TQSqlDatabase*>(db)) { m_db = db; } bool MyMoneySqlQuery::exec () { - TRACE(QString("start sql - %1").arg(lastQuery())); - bool rc = QSqlQuery::exec(); - QString msg("end sql\n%1\n***Query returned %2, row count %3"); - TRACE (msg.arg(QSqlQuery::executedQuery()).arg(rc).arg(numRowsAffected())); - //DBG (QString("%1\n***Query returned %2, row count %3").arg(QSqlQuery::executedQuery()).arg(rc).arg(size())); + TRACE(TQString("start sql - %1").tqarg(lastQuery())); + bool rc = TQSqlQuery::exec(); + TQString msg("end sql\n%1\n***Query returned %2, row count %3"); + TRACE (msg.tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(numRowsAffected())); + //DBG (TQString("%1\n***Query returned %2, row count %3").tqarg(TQSqlQuery::executedQuery()).tqarg(rc).tqarg(size())); return (rc); } -bool MyMoneySqlQuery::prepare ( const QString & query ) { +bool MyMoneySqlQuery::prepare ( const TQString & query ) { if (m_db->isSqlite3()) { - QString newQuery = query; - return (QSqlQuery::prepare (newQuery.replace("FOR UPDATE", ""))); + TQString newQuery = query; + return (TQSqlQuery::prepare (newQuery.tqreplace("FOR UPDATE", ""))); } - return (QSqlQuery::prepare (query)); + return (TQSqlQuery::prepare (query)); } //***************************************************************************** MyMoneyDbDrivers::MyMoneyDbDrivers () { - m_driverMap["QDB2"] = QString("IBM DB2"); - m_driverMap["QIBASE"] = QString("Borland Interbase"); - m_driverMap["QMYSQL3"] = QString("MySQL"); - m_driverMap["QOCI8"] = QString("Oracle Call Interface, version 8 and 9"); - m_driverMap["QODBC3"] = QString("Open Database Connectivity"); - m_driverMap["QPSQL7"] = QString("PostgreSQL v6.x and v7.x"); - m_driverMap["QTDS7"] = QString("Sybase Adaptive Server and Microsoft SQL Server"); -#if QT_VERSION < 0x040000 - m_driverMap["QSQLITE3"] = QString("SQLite Version 3"); -#else - m_driverMap["QSQLITE"] = QString("SQLite Version 3"); -#endif -} - -databaseTypeE MyMoneyDbDrivers::driverToType (const QString& driver) const { - if (driver == "QDB2") return(Db2); - else if (driver == "QIBASE") return(Interbase); - else if (driver == "QMYSQL3") return(Mysql); - else if (driver == "QOCI8") return(Oracle8); - else if (driver == "QODBC3") return(ODBC3); - else if (driver == "QPSQL7") return(Postgresql); - else if (driver == "QTDS7") return(Sybase); -#if QT_VERSION < 0x040000 - else if (driver == "QSQLITE3") return(Sqlite3); -#else - else if (driver == "QSQLITE") return(Sqlite3); -#endif - else throw new MYMONEYEXCEPTION (QString("Unknown database driver type").arg(driver)); + m_driverMap["TQDB2"] = TQString("IBM DB2"); + m_driverMap["TQIBASE"] = TQString("Borland Interbase"); + m_driverMap["TQMYSQL3"] = TQString("MySQL"); + m_driverMap["TQOCI8"] = TQString("Oracle Call Interface, version 8 and 9"); + m_driverMap["TQODBC3"] = TQString("Open Database Connectivity"); + m_driverMap["TQPSQL7"] = TQString("PostgreSQL v6.x and v7.x"); + m_driverMap["TQTDS7"] = TQString("Sybase Adaptive Server and Microsoft SQL Server"); + m_driverMap["TQSQLITE3"] = TQString("SQLite Version 3"); +} + +databaseTypeE MyMoneyDbDrivers::driverToType (const TQString& driver) const { + if (driver == "TQDB2") return(Db2); + else if (driver == "TQIBASE") return(Interbase); + else if (driver == "TQMYSQL3") return(Mysql); + else if (driver == "TQOCI8") return(Oracle8); + else if (driver == "TQODBC3") return(ODBC3); + else if (driver == "TQPSQL7") return(Postgresql); + else if (driver == "TQTDS7") return(Sybase); + else if (driver == "TQSQLITE3") return(Sqlite3); + else throw new MYMONEYEXCEPTION (TQString("Unknown database driver type").tqarg(driver)); } bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { @@ -122,11 +114,11 @@ bool MyMoneyDbDrivers::isTested (databaseTypeE dbType) const { //************************ Constructor/Destructor ***************************** MyMoneyStorageSql::MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& url) - : QSqlDatabase (url.queryItem("driver"), QString("kmmdatabase")) { + : TQSqlDatabase (url.queryItem("driver"), TQString("kmmdatabase")) { DBG("*** Entering MyMoneyStorageSql::MyMoneyStorageSql"); m_dbVersion = 0; m_progressCallback = 0; - m_displayStatus = false; + m_displaytqStatus = false; m_storage = storage; m_storagePtr = dynamic_cast<IMyMoneyStorage*>(storage); m_newDatabase = false; @@ -140,15 +132,15 @@ int MyMoneyStorageSql::open(const KURL& url, int openMode, bool clear) { DBG("*** Entering MyMoneyStorageSql::open"); try { int rc = 0; - QString driverName = url.queryItem("driver"); + TQString driverName = url.queryItem("driver"); m_dbType = m_drivers.driverToType(driverName); //get the input options - QStringList options = QStringList::split(',', url.queryItem("options")); - m_loadAll = options.contains("loadAll")/*|| m_mode == 0*/; - m_override = options.contains("override"); + TQStringList options = TQStringList::split(',', url.queryItem("options")); + m_loadAll = options.tqcontains("loadAll")/*|| m_mode == 0*/; + m_override = options.tqcontains("override"); // create the database connection - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash setDatabaseName(dbName); setHostName(url.host()); setUserName(url.user()); @@ -156,7 +148,7 @@ try { switch (openMode) { case IO_ReadOnly: // OpenDatabase menu entry (or open last file) case IO_ReadWrite: // Save menu entry with database open - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening database"); rc = 1; } else { @@ -167,11 +159,11 @@ try { // Try to open the database. // If that fails, try to create the database, then try to open it again. m_newDatabase = true; - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { if (createDatabase(url) != 0) { rc = 1; } else { - if (!QSqlDatabase::open()) { + if (!TQSqlDatabase::open()) { buildError(MyMoneySqlQuery(), __func__, "opening new database"); rc = 1; } else { @@ -190,7 +182,7 @@ try { } break; default: - qFatal("%s", QString("%1 - unknown open mode %2").arg(__func__).arg(openMode).data()); + qFatal("%s", TQString("%1 - unknown open mode %2").tqarg(__func__).tqarg(openMode).data()); } if (rc != 0) return (rc); // bypass logon check if we are creating a database @@ -198,21 +190,21 @@ try { // check if the database is locked, if not lock it readFileInfo(); if (!m_logonUser.isEmpty() && (!m_override)) { - m_error = QString - (i18n("Database apparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) - .arg(m_logonUser) - .arg(m_logonAt.date().toString(Qt::ISODate)) - .arg(m_logonAt.time().toString("hh.mm.ss")); + m_error = TQString + (i18n("Database aptqparently in use\nOpened by %1 on %2 at %3.\nOpen anyway?")) + .tqarg(m_logonUser) + .tqarg(m_logonAt.date().toString(Qt::ISODate)) + .tqarg(m_logonAt.time().toString("hh.mm.ss")); qDebug("%s", m_error.data()); close(false); rc = -1; } else { m_logonUser = url.user() + "@" + url.host(); - m_logonAt = QDateTime::currentDateTime(); + m_logonAt = TQDateTime::tqcurrentDateTime(); writeFileInfo(); } return(rc); -} catch (QString& s) { +} catch (TQString& s) { qDebug("%s",s.data()); return (1); } @@ -220,15 +212,15 @@ try { void MyMoneyStorageSql::close(bool logoff) { DBG("*** Entering MyMoneyStorageSql::close"); - if (QSqlDatabase::open()) { + if (TQSqlDatabase::open()) { if (logoff) { startCommitUnit(__func__); - m_logonUser = QString(); + m_logonUser = TQString(); writeFileInfo(); endCommitUnit(__func__); } - QSqlDatabase::close(); - QSqlDatabase::removeDatabase(this); + TQSqlDatabase::close(); + TQSqlDatabase::removeDatabase(this); } } @@ -237,32 +229,32 @@ int MyMoneyStorageSql::createDatabase (const KURL& url) { if (m_dbType == Sqlite3) return(0); // not needed for sqlite if (!m_dbType == Mysql) { m_error = - QString(i18n("Cannot currently create database for driver %1; please create manually")).arg(driverName()); + TQString(i18n("Cannot currently create database for driver %1; please create manually")).tqarg(driverName()); return (1); } // create the database (only works for mysql at present) - QString dbName = url.path().right(url.path().length() - 1); // remove separator slash - QSqlDatabase *maindb = QSqlDatabase::addDatabase(driverName()); + TQString dbName = url.path().right(url.path().length() - 1); // remove separator slash + TQSqlDatabase *maindb = TQSqlDatabase::addDatabase(driverName()); maindb->setDatabaseName ("mysql"); maindb->setHostName (url.host()); maindb->setUserName (url.user()); maindb->setPassword (url.pass()); maindb->open(); - QSqlQuery qm(maindb); - QString qs = QString("CREATE DATABASE %1;").arg(dbName); + TQSqlQuery qm(maindb); + TQString qs = TQString("CREATE DATABASE %1;").tqarg(dbName); qm.prepare (qs); if (!qm.exec()) { - buildError (qm, __func__, QString(i18n("Error in create database %1; do you have create permissions?")).arg(dbName)); + buildError (qm, __func__, TQString(i18n("Error in create database %1; do you have create permissions?")).tqarg(dbName)); return (1); } - QSqlDatabase::removeDatabase (maindb); + TQSqlDatabase::removeDatabase (maindb); return (0); } int MyMoneyStorageSql::upgradeDb() { DBG("*** Entering MyMoneyStorageSql::upgradeDb"); - //signalProgress(0, 1, QObject::tr("Upgrading database...")); + //signalProgress(0, 1, TQObject::tr("Upgrading database...")); MyMoneySqlQuery q(this); q.prepare ("SELECT version FROM kmmFileInfo;"); if (!q.exec() || !q.next()) { @@ -272,7 +264,7 @@ int MyMoneyStorageSql::upgradeDb() { } else { m_dbVersion = m_db.currentVersion(); m_storage->setFileFixVersion(m_storage->currentFixVersion()); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("UPDATE kmmFileInfo SET version = :version, \ fixLevel = :fixLevel;"); q.bindValue(":version", m_dbVersion); @@ -286,8 +278,8 @@ int MyMoneyStorageSql::upgradeDb() { } // prior to dbv6, 'version' format was 'dbversion.fixLevel+1' // as of dbv6, these are separate fields - QString version = q.value(0).toString(); - if (version.contains('.')) { + TQString version = q.value(0).toString(); + if (version.tqcontains('.')) { m_dbVersion = q.value(0).toString().section('.', 0, 0).toUInt(); m_storage->setFileFixVersion(q.value(0).toString().section('.', 1, 1).toUInt() - 1); } else { @@ -333,8 +325,8 @@ int MyMoneyStorageSql::upgradeDb() { } } // write updated version to DB - //setVersion(QString("%1.%2").arg(m_dbVersion).arg(m_minorVersion)); - q.prepare (QString("UPDATE kmmFileInfo SET version = :version;")); + //setVersion(TQString("%1.%2").tqarg(m_dbVersion).tqarg(m_minorVersion)); + q.prepare (TQString("UPDATE kmmFileInfo SET version = :version;")); q.bindValue(":version", m_dbVersion); if (!q.exec()) { buildError (q, __func__, "Error updating db version"); @@ -346,8 +338,8 @@ int MyMoneyStorageSql::upgradeDb() { // SF bug 2779291 // check whether a column appears in a table already; if not, add it bool MyMoneyStorageSql::addColumn - (const QString& table, const QString& col, - const QString& after) + (const TQString& table, const TQString& col, + const TQString& after) { MyMoneyDbTable t = m_db.m_tables[table]; MyMoneyDbTable::field_iterator ft; @@ -363,20 +355,20 @@ bool MyMoneyStorageSql::addColumn bool MyMoneyStorageSql::addColumn (const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after){ + const TQString& after){ if ((m_dbType == Sqlite3) && (!after.isEmpty())) qFatal("sqlite doesn't support 'AFTER'; use sqliteAlterTable"); - if (record(t.name()).contains(c.name())) + if (record(t.name()).tqcontains(c.name())) return (true); - QSqlQuery q(this); - QString afterString = ";"; + TQSqlQuery q(this); + TQString afterString = ";"; if (!after.isEmpty()) - afterString = QString("AFTER %1;").arg(after); + afterString = TQString("AFTER %1;").tqarg(after); q.prepare("ALTER TABLE " + t.name() + " ADD COLUMN " + c.generateDDL(m_dbType) + afterString); if (!q.exec()) { buildError (q, __func__, - QString("Error adding column %1 to table %2").arg(c.name()).arg(t.name())); + TQString("Error adding column %1 to table %2").tqarg(c.name()).tqarg(t.name())); return (false); } return (true); @@ -384,23 +376,23 @@ bool MyMoneyStorageSql::addColumn // analogous to above bool MyMoneyStorageSql::dropColumn - (const QString& table, const QString& col) + (const TQString& table, const TQString& col) { return (dropColumn(m_db.m_tables[table], col)); } bool MyMoneyStorageSql::dropColumn - (const MyMoneyDbTable& t, const QString& col){ + (const MyMoneyDbTable& t, const TQString& col){ if (m_dbType == Sqlite3) qFatal("sqlite doesn't support 'DROP COLUMN'; use sqliteAlterTable"); - if (!record(t.name()).contains(col)) + if (!record(t.name()).tqcontains(col)) return (true); - QSqlQuery q(this); + TQSqlQuery q(this); q.prepare("ALTER TABLE " + t.name() + " DROP COLUMN " + col + ";"); if (!q.exec()) { buildError (q, __func__, - QString("Error dropping column %1 from table %2").arg(col).arg(t.name())); + TQString("Error dropping column %1 from table %2").tqarg(col).tqarg(t.name())); return (false); } return (true); @@ -434,9 +426,9 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error priming kmmSplits.postDate"); return (1); } - QMap<QString, QDateTime> tids; + TQMap<TQString, TQDateTime> tids; while (q.next()) tids[q.value(0).toString()] = q.value(1).toDateTime(); - QMap<QString, QDateTime>::ConstIterator it; + TQMap<TQString, TQDateTime>::ConstIterator it; for (it = tids.begin(); it != tids.end(); ++it) { q.prepare ("UPDATE kmmSplits SET postDate=:postDate WHERE transactionId = :id;"); q.bindValue(":postDate", it.data().toString(Qt::ISODate)); @@ -447,7 +439,7 @@ int MyMoneyStorageSql::upgradeToV1() { } } // add index to kmmKeyValuePairs to (kvpType,kvpId) - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; q.prepare (MyMoneyDbIndex("kmmKeyValuePairs", "kmmKVPtype_id", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -519,18 +511,18 @@ int MyMoneyStorageSql::upgradeToV1() { buildError (q, __func__, "Error retrieving splits for transaction counting"); return(1); } - QString lastAcc, lastTx; + TQString lastAcc, lastTx; while (q.next()) { - QString thisAcc = q.value(0).toCString(); - QString thisTx = q.value(1).toCString(); + TQString thisAcc = q.value(0).toCString(); + TQString thisTx = q.value(1).toCString(); if ((thisAcc != lastAcc) || (thisTx != lastTx)) ++m_transactionCountMap[thisAcc]; lastAcc = thisAcc; lastTx = thisTx; } - QMap<QString, unsigned long>::ConstIterator itm; + TQMap<TQString, unsigned long>::ConstIterator itm; q.prepare("UPDATE kmmAccounts SET transactionCount = :txCount WHERE id = :id;"); for (itm = m_transactionCountMap.begin(); itm != m_transactionCountMap.end(); ++itm) { - q.bindValue (":txCount", QString::number(itm.data())); + q.bindValue (":txCount", TQString::number(itm.data())); q.bindValue (":id", itm.key()); if (!q.exec()) { buildError(q, __func__, "Error updating transaction count"); @@ -606,7 +598,7 @@ int MyMoneyStorageSql::upgradeToV4() { DBG("*** Entering MyMoneyStorageSql::upgradeToV4"); startCommitUnit(__func__); MyMoneySqlQuery q(this); - QStringList list; + TQStringList list; list << "transactionId" << "splitId"; q.prepare (MyMoneyDbIndex("kmmSplits", "kmmTx_Split", list, false).generateDDL(m_dbType) + ";"); if (!q.exec()) { @@ -664,8 +656,8 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); // upgrade Mysql to InnoDB transaction-safe engine if (m_dbType == Mysql) { - for (QMapConstIterator<QString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - q.prepare(QString("ALTER TABLE %1 ENGINE = InnoDB;").arg(tt.data().name())); + for (TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + q.prepare(TQString("ALTER TABLE %1 ENGINE = InnoDB;").tqarg(tt.data().name())); if (!q.exec()) { buildError (q, __func__, "Error updating to InnoDB"); return (1); @@ -678,7 +670,7 @@ int MyMoneyStorageSql::upgradeToV6() { return(1); // read and write reports to get ids inserted readFileInfo(); - QMap<QString, MyMoneyReport> reportList = + TQMap<TQString, MyMoneyReport> reportList = fetchReports(); // the V5 database allowed lots of duplicate reports with no // way to distinguish between them. The fetchReports call @@ -690,7 +682,7 @@ int MyMoneyStorageSql::upgradeToV6() { return (1); } unsigned long long hiReportId = 0; - QMap<QString, MyMoneyReport>::const_iterator it_r; + TQMap<TQString, MyMoneyReport>::const_iterator it_r; for(it_r = reportList.begin(); it_r != reportList.end(); ++it_r) { MyMoneyReport r = *it_r; hiReportId = calcHighId(hiReportId, r.id()); @@ -719,22 +711,22 @@ int MyMoneyStorageSql::upgradeToV6() { statement. It should enable us to drop a primary key, and drop columns */ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::sqliteAlterTable"); - QString tempTableName = t.name(); - tempTableName.replace("kmm", "tmp"); - QSqlQuery q(this); - q.prepare (QString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); + TQString tempTableName = t.name(); + tempTableName.tqreplace("kmm", "tmp"); + TQSqlQuery q(this); + q.prepare (TQString("ALTER TABLE " + t.name() + " RENAME TO " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error renaming table"); return false; } createTable(t); - q.prepare (QString("INSERT INTO " + t.name() + " (" + t.columnList() + + q.prepare (TQString("INSERT INTO " + t.name() + " (" + t.columnList() + ") SELECT " + t.columnList() + " FROM " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error inserting into new table"); return false; } - q.prepare (QString("DROP TABLE " + tempTableName + ";")); + q.prepare (TQString("DROP TABLE " + tempTableName + ";")); if (!q.exec()) { buildError (q, __func__, "Error dropping old table"); return false; @@ -742,10 +734,10 @@ bool MyMoneyStorageSql::sqliteAlterTable(const MyMoneyDbTable& t) { return true; } -long unsigned MyMoneyStorageSql::getRecCount (const QString& table) const { +long unsigned MyMoneyStorageSql::getRecCount (const TQString& table) const { DBG("*** Entering MyMoneyStorageSql::getRecCount"); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - q.prepare(QString("SELECT COUNT(*) FROM %1;").arg(table)); + q.prepare(TQString("SELECT COUNT(*) FROM %1;").tqarg(table)); if ((!q.exec()) || (!q.next())) { buildError (q, __func__, "error retrieving record count"); qFatal("Error retrieving record count"); // definitely shouldn't happen @@ -758,20 +750,20 @@ int MyMoneyStorageSql::createTables () { // check tables, create if required // convert everything to lower case, since SQL standard is case insensitive // table and column names (when not delimited), but some DBMSs disagree. - QStringList lowerTables = tables(QSql::AllTables); - for (QStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { + TQStringList lowerTables = tables(TQSql::AllTables); + for (TQStringList::iterator i = lowerTables.begin(); i != lowerTables.end(); ++i) { (*i) = (*i).lower(); } - for (QMapConstIterator<QString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) createTable (tt.data()); + for (TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); tt != m_db.tableEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) createTable (tt.data()); } MyMoneySqlQuery q(this); - for (QMapConstIterator<QString, MyMoneyDbView> tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { - if (!lowerTables.contains(tt.key().lower())) { + for (TQMapConstIterator<TQString, MyMoneyDbView> tt = m_db.viewBegin(); tt != m_db.viewEnd(); ++tt) { + if (!lowerTables.tqcontains(tt.key().lower())) { q.prepare (tt.data().createString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating view %1").arg(tt.key()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating view %1").tqarg(tt.key()))); } } @@ -784,22 +776,22 @@ int MyMoneyStorageSql::createTables () { void MyMoneyStorageSql::createTable (const MyMoneyDbTable& t) { DBG("*** Entering MyMoneyStorageSql::createTable"); // create the tables - QStringList ql = QStringList::split('\n', t.generateCreateSQL(m_dbType)); + TQStringList ql = TQStringList::split('\n', t.generateCreateSQL(m_dbType)); MyMoneySqlQuery q(this); for (unsigned int i = 0; i < ql.count(); ++i) { q.prepare (ql[i]); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("creating table/index %1").arg(t.name()))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("creating table/index %1").tqarg(t.name()))); } } int MyMoneyStorageSql::isEmpty () { DBG("*** Entering MyMoneyStorageSql::isEmpty"); // check all tables are empty - QMapConstIterator<QString, MyMoneyDbTable> tt = m_db.tableBegin(); + TQMapConstIterator<TQString, MyMoneyDbTable> tt = m_db.tableBegin(); int recordCount = 0; MyMoneySqlQuery q(this); while ((tt != m_db.tableEnd()) && (recordCount == 0)) { - q.prepare (QString("select count(*) from %1;").arg((*tt).name())); + q.prepare (TQString("select count(*) from %1;").tqarg((*tt).name())); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "getting record count")); if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving record count")); recordCount += q.value(0).toInt(); @@ -816,11 +808,11 @@ int MyMoneyStorageSql::isEmpty () { void MyMoneyStorageSql::clean() { DBG("*** Entering MyMoneyStorageSql::clean"); // delete all existing records - QMapConstIterator<QString, MyMoneyDbTable> it = m_db.tableBegin(); + TQMapConstIterator<TQString, MyMoneyDbTable> it = m_db.tableBegin(); MyMoneySqlQuery q(this); while (it != m_db.tableEnd()) { - q.prepare(QString("DELETE from %1;").arg(it.key())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("cleaning database"))); + q.prepare(TQString("DELETE from %1;").tqarg(it.key())); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("cleaning database"))); ++it; } } @@ -829,15 +821,15 @@ void MyMoneyStorageSql::clean() { bool MyMoneyStorageSql::readFile(void) { DBG("*** Entering MyMoneyStorageSql::readFile"); - m_displayStatus = true; + m_displaytqStatus = true; try { readFileInfo(); readInstitutions(); if (m_loadAll) { readPayees(); } else { - QValueList<QString> user; - user.append(QString("USER")); + TQValueList<TQString> user; + user.append(TQString("USER")); readPayees(user); } //TRACE("done payees"); @@ -868,10 +860,10 @@ bool MyMoneyStorageSql::readFile(void) { // FIXME?? if (m_mode == 0) m_storage = NULL; // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; //MyMoneySqlQuery::traceOn(); return true; - } catch (QString& s) { + } catch (TQString& s) { return false; } } @@ -884,7 +876,7 @@ bool MyMoneyStorageSql::writeFile(void) { = m_securities = m_prices = m_currencies = m_schedules = m_reports = m_kvps = m_budgets = 0; m_hiIdInstitutions = m_hiIdPayees = m_hiIdAccounts = m_hiIdTransactions = m_hiIdSchedules = m_hiIdSecurities = m_hiIdReports = m_hiIdBudgets = 0; - m_displayStatus = true; + m_displaytqStatus = true; try{ startCommitUnit(__func__); writeInstitutions (); @@ -905,14 +897,14 @@ bool MyMoneyStorageSql::writeFile(void) { endCommitUnit(__func__); // make sure the progress bar is not shown any longer signalProgress(-1, -1); - m_displayStatus = false; + m_displaytqStatus = false; return true; -} catch (QString& s) { +} catch (TQString& s) { return false; } } // --------------- SQL Transaction (commit unit) handling ----------------------------------- -void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::startCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::startCommitUnit"); if (m_commitUnitStack.isEmpty()) { if (!transaction()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "starting commit unit")); @@ -920,16 +912,16 @@ void MyMoneyStorageSql::startCommitUnit (const QString& callingFunction) { m_commitUnitStack.push(callingFunction); } -bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { +bool MyMoneyStorageSql::endCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::endCommitUnit"); // for now, we don't know if there were any changes made to the data so // we expect the data to have changed. This assumption causes some unnecessary - // repaints of the UI here and there, but for now it's ok. If we can determine + // tqrepaints of the UI here and there, but for now it's ok. If we can determine // that the commit() really changes the data, we can return that information // as value of this method. bool rc = true; if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); m_commitUnitStack.pop(); if (m_commitUnitStack.isEmpty()) { if (!commit()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "ending commit unit")); @@ -937,10 +929,10 @@ bool MyMoneyStorageSql::endCommitUnit (const QString& callingFunction) { return rc; } -void MyMoneyStorageSql::cancelCommitUnit (const QString& callingFunction) { +void MyMoneyStorageSql::cancelCommitUnit (const TQString& callingFunction) { DBG("*** Entering MyMoneyStorageSql::cancelCommitUnit"); if (callingFunction != m_commitUnitStack.top()) - qDebug("%s", QString("%1 - %2 s/be %3").arg(__func__).arg(callingFunction).arg(m_commitUnitStack.top()).data()); + qDebug("%s", TQString("%1 - %2 s/be %3").tqarg(__func__).tqarg(callingFunction).tqarg(m_commitUnitStack.top()).data()); if (m_commitUnitStack.isEmpty()) return; m_commitUnitStack.clear(); if (!rollback()) throw new MYMONEYEXCEPTION(buildError (MyMoneySqlQuery(), __func__, "cancelling commit unit")); @@ -967,20 +959,20 @@ void MyMoneyStorageSql::writeInstitutions() { // one way would be to build the lists when reading the db // unfortunately this object does not persist between read and write // it would also be nice if we could tell which objects had been updated since we read them in - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmInstitutions;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Institution list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList<MyMoneyInstitution> list = m_storage->institutionList(); - QValueList<MyMoneyInstitution>::ConstIterator it; + const TQValueList<MyMoneyInstitution> list = m_storage->institutionList(); + TQValueList<MyMoneyInstitution>::ConstIterator it; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmInstitutions"].updateString()); q2.prepare (m_db.m_tables["kmmInstitutions"].insertString()); signalProgress(0, list.count(), "Writing Institutions..."); for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeInstitution(*it, q); } else { @@ -990,7 +982,7 @@ void MyMoneyStorageSql::writeInstitutions() { } if (!dbList.isEmpty()) { - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmInstitutions WHERE id = :id"); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1030,7 +1022,7 @@ void MyMoneyStorageSql::removeInstitution(const MyMoneyInstitution& inst) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmInstitutions"].deleteString()); q.bindValue(":id", inst.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Institution"))); --m_institutions; writeFileInfo(); endCommitUnit(__func__); @@ -1046,7 +1038,7 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql q.bindValue(":addressCity", i.city()); q.bindValue(":addressZipcode", i.postcode()); q.bindValue(":telephone", i.telephone()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Institution"))); writeKeyValuePairs("OFXSETTINGS", i.id(), i.pairs()); m_hiIdInstitutions = calcHighId(m_hiIdInstitutions, i.id()); } @@ -1055,22 +1047,22 @@ void MyMoneyStorageSql::writeInstitution(const MyMoneyInstitution& i, MyMoneySql void MyMoneyStorageSql::writePayees() { DBG("*** Entering MyMoneyStorageSql::writePayees"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmPayees;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Payee list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList<MyMoneyPayee> list = m_storage->payeeList(); - MyMoneyPayee user(QString("USER"), m_storage->user()); + TQValueList<MyMoneyPayee> list = m_storage->payeeList(); + MyMoneyPayee user(TQString("USER"), m_storage->user()); list.prepend(user); signalProgress(0, list.count(), "Writing Payees..."); MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmPayees"].updateString()); q2.prepare (m_db.m_tables["kmmPayees"].insertString()); - QValueList<MyMoneyPayee>::ConstIterator it; + TQValueList<MyMoneyPayee>::ConstIterator it; for(it = list.begin(); it != list.end(); ++it) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writePayee(*it, q); } else { @@ -1080,7 +1072,7 @@ void MyMoneyStorageSql::writePayees() { } if (!dbList.isEmpty()) { - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); q.prepare(m_db.m_tables["kmmPayees"].deleteString()); while (it != dbList.end()) { q.bindValue(":id", (*it)); @@ -1128,7 +1120,7 @@ void MyMoneyStorageSql::removePayee(const MyMoneyPayee& payee) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmPayees"].deleteString()); q.bindValue(":id", payee.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Payee"))); --m_payees; writeFileInfo(); endCommitUnit(__func__); @@ -1152,13 +1144,13 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo q.bindValue(":notes", p.notes()); q.bindValue(":defaultAccountId", p.defaultAccountId()); bool ignoreCase; - QString matchKeys; + TQString matchKeys; MyMoneyPayee::payeeMatchType type = p.matchData(ignoreCase, matchKeys); q.bindValue(":matchData", static_cast<unsigned int>(type)); if (ignoreCase) q.bindValue(":matchIgnoreCase", "Y"); else q.bindValue(":matchIgnoreCase", "N"); q.bindValue(":matchKeys", matchKeys); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Payee"))); if (!isUserInfo) m_hiIdPayees = calcHighId(m_hiIdPayees, p.id()); } @@ -1166,15 +1158,15 @@ void MyMoneyStorageSql::writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bo void MyMoneyStorageSql::writeAccounts() { DBG("*** Entering MyMoneyStorageSql::writeAccounts"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmAccounts;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Account list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount> list; m_storage->accountList(list); - QValueList<MyMoneyAccount>::ConstIterator it; + TQValueList<MyMoneyAccount>::ConstIterator it; signalProgress(0, list.count(), "Writing Accounts..."); if (dbList.isEmpty()) { // new table, insert standard accounts q.prepare (m_db.m_tables["kmmAccounts"].insertString()); @@ -1216,7 +1208,7 @@ void MyMoneyStorageSql::writeAccounts() { 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); writeAccount(asset, q); ++m_accounts; writeAccount(expense, q); ++m_accounts; @@ -1232,7 +1224,7 @@ void MyMoneyStorageSql::writeAccounts() { // Update the accounts that exist; insert the ones that do not. for(it = list.begin(); it != list.end(); ++it, ++i) { m_transactionCountMap[(*it).id()] = m_storagePtr->transactionCount((*it).id()); - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeAccount(*it, q); } else { @@ -1243,7 +1235,7 @@ void MyMoneyStorageSql::writeAccounts() { // Delete the accounts that are in the db but no longer in memory. if (!dbList.isEmpty()) { - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); q.prepare("DELETE FROM kmmAccounts WHERE id = :id"); while (it != dbList.end()) { if (!m_storagePtr->isStandardAccount(*it)) { @@ -1288,7 +1280,7 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmAccounts"].deleteString()); q.bindValue(":id", acc.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Account"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Account"))); --m_accounts; writeFileInfo(); endCommitUnit(__func__); @@ -1296,20 +1288,20 @@ void MyMoneyStorageSql::removeAccount(const MyMoneyAccount& acc) { void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeAccount"); - //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), QDate()); + //MyMoneyMoney balance = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":id", acc.id()); q.bindValue(":institutionId", acc.institutionId()); - q.bindValue(":parentId", acc.parentAccountId()); - if (acc.lastReconciliationDate() == QDate()) + q.bindValue(":tqparentId", acc.tqparentAccountId()); + if (acc.lastReconciliationDate() == TQDate()) q.bindValue(":lastReconciled", acc.lastReconciliationDate()); else - q.bindValue(":lastReconciled", acc.lastReconciliationDate().toString(Qt::ISODate)); + q.bindValue(":lastReconciled", TQString(acc.lastReconciliationDate().toString(Qt::ISODate))); q.bindValue(":lastModified", acc.lastModified()); - if (acc.openingDate() == QDate()) + if (acc.openingDate() == TQDate()) q.bindValue(":openingDate", acc.openingDate()); else - q.bindValue(":openingDate", acc.openingDate().toString(Qt::ISODate)); + q.bindValue(":openingDate", TQString(acc.openingDate().toString(Qt::ISODate))); q.bindValue(":accountNumber", acc.number()); q.bindValue(":accountType", acc.accountType()); @@ -1330,7 +1322,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& //FIXME: Using exceptions for branching always feels like a kludge. // Look for a better way. TRY - MyMoneyMoney bal = m_storagePtr->balance(acc.id(), QDate()); + MyMoneyMoney bal = m_storagePtr->balance(acc.id(), TQDate()); q.bindValue(":balance", bal.toString()); q.bindValue(":balanceFormatted", bal.formatMoney("", -1, false)); @@ -1341,8 +1333,8 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& acc.balance().formatMoney("", -1, false)); ECATCH - q.bindValue(":transactionCount", Q_ULLONG(m_transactionCountMap[acc.id()])); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Account"))); + q.bindValue(":transactionCount", TQ_ULLONG(m_transactionCountMap[acc.id()])); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Account"))); //Add in Key-Value Pairs for accounts. //MMAccount inherits from KVPContainer AND has a KVPContainer member @@ -1356,7 +1348,7 @@ void MyMoneyStorageSql::writeAccount(const MyMoneyAccount& acc, MyMoneySqlQuery& void MyMoneyStorageSql::writeTransactions() { DBG("*** Entering MyMoneyStorageSql::writeTransactions"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmTransactions WHERE txType = 'N';"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Transaction list")); @@ -1364,16 +1356,16 @@ void MyMoneyStorageSql::writeTransactions() { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; m_storage->transactionList(list, filter); signalProgress(0, list.count(), "Writing Transactions..."); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; int i = 0; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmTransactions"].updateString()); q2.prepare (m_db.m_tables["kmmTransactions"].insertString()); for(it = list.begin(); it != list.end(); ++it, ++i) { - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeTransaction((*it).id(), *it, q, "N"); } else { @@ -1383,7 +1375,7 @@ void MyMoneyStorageSql::writeTransactions() { } if (!dbList.isEmpty()) { - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteTransaction(*it); ++it; @@ -1400,7 +1392,7 @@ void MyMoneyStorageSql::addTransaction (const MyMoneyTransaction& tx) { writeTransaction(tx.id(), tx, q, "N"); ++m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1421,14 +1413,14 @@ void MyMoneyStorageSql::modifyTransaction (const MyMoneyTransaction& tx) { q.bindValue(":txId", tx.id()); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "retrieving old splits")); while (q.next()) { - QString id = q.value(0).toCString(); + TQString id = q.value(0).toCString(); --m_transactionCountMap[id]; } // add the transaction and splits q.prepare (m_db.m_tables["kmmTransactions"].updateString()); writeTransaction(tx.id(), tx, q, "N"); // for each split account, update lastMod date, balance, txCount - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { //MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); MyMoneyAccount acc = MyMoneyFile::instance()->account((*it_s).accountId()); @@ -1448,7 +1440,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { --m_transactions; // for each split account, update lastMod date, balance, txCount - QValueList<MyMoneySplit>::ConstIterator it_s; + TQValueList<MyMoneySplit>::ConstIterator it_s; for(it_s = tx.splits().begin(); it_s != tx.splits().end(); ++it_s) { MyMoneyAccount acc = m_storagePtr->account((*it_s).accountId()); --m_transactionCountMap[acc.id()]; @@ -1459,7 +1451,7 @@ void MyMoneyStorageSql::removeTransaction(const MyMoneyTransaction& tx) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteTransaction(const QString& id) { +void MyMoneyStorageSql::deleteTransaction(const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteTransaction"); MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmSplits WHERE transactionId = :transactionId;"); @@ -1477,19 +1469,19 @@ void MyMoneyStorageSql::deleteTransaction(const QString& id) { if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Transaction")); } -void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type) { +void MyMoneyStorageSql::writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type) { DBG("*** Entering MyMoneyStorageSql::writeTransaction"); q.bindValue(":id", txId); q.bindValue(":txType", type); - q.bindValue(":postDate", tx.postDate().toString(Qt::ISODate)); + q.bindValue(":postDate", TQString(tx.postDate().toString(Qt::ISODate))); q.bindValue(":memo", tx.memo()); - q.bindValue(":entryDate", tx.entryDate().toString(Qt::ISODate)); + q.bindValue(":entryDate", TQString(tx.entryDate().toString(Qt::ISODate))); q.bindValue(":currencyId", tx.commodity()); q.bindValue(":bankId", tx.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Transaction"))); m_txPostDate = tx.postDate(); // FIXME: TEMP till Tom puts date in split object - QValueList<MyMoneySplit> splitList = tx.splits(); + TQValueList<MyMoneySplit> splitList = tx.splits(); writeSplits(txId, type, splitList); //Add in Key-Value Pairs for transactions. @@ -1498,23 +1490,23 @@ void MyMoneyStorageSql::writeTransaction(const QString& txId, const MyMoneyTrans m_hiIdTransactions = calcHighId(m_hiIdTransactions, tx.id()); } -void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, const QValueList<MyMoneySplit>& splitList) { +void MyMoneyStorageSql::writeSplits(const TQString& txId, const TQString& type, const TQValueList<MyMoneySplit>& splitList) { DBG("*** Entering MyMoneyStorageSql::writeSplits"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<unsigned int> dbList; + TQValueList<unsigned int> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT splitId FROM kmmSplits where transactionId = :id;"); q.bindValue(":id", txId); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Split list")); while (q.next()) dbList.append(q.value(0).toUInt()); - QValueList<MyMoneySplit>::const_iterator it; + TQValueList<MyMoneySplit>::const_iterator it; unsigned int i; MyMoneySqlQuery q2(this); q.prepare (m_db.m_tables["kmmSplits"].updateString()); q2.prepare (m_db.m_tables["kmmSplits"].insertString()); for(it = splitList.begin(), i = 0; it != splitList.end(); ++it, ++i) { - if (dbList.contains(i)) { + if (dbList.tqcontains(i)) { dbList.remove (i); writeSplit(txId, (*it), type, i, q); } else { @@ -1525,7 +1517,7 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSplits WHERE transactionId = :txId AND splitId = :splitId"); - QValueList<unsigned int>::const_iterator it = dbList.begin(); + TQValueList<unsigned int>::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":txId", txId); q.bindValue(":splitId", *it); @@ -1535,62 +1527,62 @@ void MyMoneyStorageSql::writeSplits(const QString& txId, const QString& type, co } } -void MyMoneyStorageSql::writeSplit(const QString& txId, const MyMoneySplit& split, - const QString& type, const int splitId, MyMoneySqlQuery& q) { +void MyMoneyStorageSql::writeSplit(const TQString& txId, const MyMoneySplit& split, + const TQString& type, const int splitId, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeSplit"); q.bindValue(":transactionId", txId); q.bindValue(":txType", type); q.bindValue(":splitId", splitId); q.bindValue(":payeeId", split.payeeId()); - if (split.reconcileDate() == QDate()) + if (split.reconcileDate() == TQDate()) q.bindValue(":reconcileDate", split.reconcileDate()); else - q.bindValue(":reconcileDate", split.reconcileDate().toString(Qt::ISODate)); + q.bindValue(":reconcileDate", TQString(split.reconcileDate().toString(Qt::ISODate))); q.bindValue(":action", split.action()); q.bindValue(":reconcileFlag", split.reconcileFlag()); q.bindValue(":value", split.value().toString()); q.bindValue(":valueFormatted", split.value() .formatMoney("", -1, false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); q.bindValue(":shares", split.shares().toString()); MyMoneyAccount acc = m_storagePtr->account(split.accountId()); MyMoneySecurity sec = m_storagePtr->security(acc.currencyId()); q.bindValue(":sharesFormatted", split.shares(). formatMoney("", MyMoneyMoney::denomToPrec(sec.smallestAccountFraction()), false). - replace(QChar(','), QChar('.'))); + tqreplace(TQChar(','), TQChar('.'))); MyMoneyMoney price = split.actualPrice(); if (!price.isZero()) { q.bindValue(":price", price.toString()); q.bindValue(":priceFormatted", price.formatMoney ("", KMyMoneySettings::pricePrecision(), false) - .replace(QChar(','), QChar('.'))); + .tqreplace(TQChar(','), TQChar('.'))); } else { - q.bindValue(":price", QString()); - q.bindValue(":priceFormatted", QString()); + q.bindValue(":price", TQString()); + q.bindValue(":priceFormatted", TQString()); } q.bindValue(":memo", split.memo()); q.bindValue(":accountId", split.accountId()); q.bindValue(":checkNumber", split.number()); q.bindValue(":postDate", m_txPostDate.toString(Qt::ISODate)); // FIXME: when Tom puts date into split object q.bindValue(":bankId", split.bankID()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Split"))); - deleteKeyValuePairs("SPLIT", txId + QString::number(splitId)); - writeKeyValuePairs("SPLIT", txId + QString::number(splitId), split.pairs()); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Split"))); + deleteKeyValuePairs("SPLIT", txId + TQString::number(splitId)); + writeKeyValuePairs("SPLIT", txId + TQString::number(splitId), split.pairs()); } // **** Schedules **** void MyMoneyStorageSql::writeSchedules() { DBG("*** Entering MyMoneyStorageSql::writeSchedules"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); q.prepare("SELECT id FROM kmmSchedules;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Schedule list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList<MyMoneySchedule> list = m_storage->scheduleList(); - QValueList<MyMoneySchedule>::ConstIterator it; + const TQValueList<MyMoneySchedule> list = m_storage->scheduleList(); + TQValueList<MyMoneySchedule>::ConstIterator it; MyMoneySqlQuery q2(this); //TODO: find a way to prepare the queries outside of the loop. writeSchedule() // modifies the query passed to it, so they have to be re-prepared every pass. @@ -1599,7 +1591,7 @@ void MyMoneyStorageSql::writeSchedules() { q.prepare (m_db.m_tables["kmmSchedules"].updateString()); q2.prepare (m_db.m_tables["kmmSchedules"].insertString()); bool insert = true; - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); insert = false; writeSchedule(*it, q, insert); @@ -1610,7 +1602,7 @@ void MyMoneyStorageSql::writeSchedules() { } if (!dbList.isEmpty()) { - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { deleteSchedule(*it); ++it; @@ -1648,7 +1640,7 @@ void MyMoneyStorageSql::removeSchedule(const MyMoneySchedule& sched) { endCommitUnit(__func__); } -void MyMoneyStorageSql::deleteSchedule (const QString& id) { +void MyMoneyStorageSql::deleteSchedule (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::deleteSchedule"); deleteTransaction(id); MyMoneySqlQuery q(this); @@ -1673,8 +1665,8 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":occurenceString", sch.occurenceToString()); q.bindValue(":paymentType", sch.paymentType()); q.bindValue(":paymentTypeString", MyMoneySchedule::paymentMethodToString(sch.paymentType())); - q.bindValue(":startDate", sch.startDate().toString(Qt::ISODate)); - q.bindValue(":endDate", sch.endDate().toString(Qt::ISODate)); + q.bindValue(":startDate", TQString(sch.startDate().toString(Qt::ISODate))); + q.bindValue(":endDate", TQString(sch.endDate().toString(Qt::ISODate))); if (sch.isFixed()) { q.bindValue(":fixed", "Y"); } else { @@ -1686,24 +1678,24 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer q.bindValue(":autoEnter", "N"); } q.bindValue(":lastPayment", sch.lastPayment()); - q.bindValue(":nextPaymentDue", sch.nextDueDate().toString(Qt::ISODate)); + q.bindValue(":nextPaymentDue", TQString(sch.nextDueDate().toString(Qt::ISODate))); q.bindValue(":weekendOption", sch.weekendOption()); q.bindValue(":weekendOptionString", MyMoneySchedule::weekendOptionToString(sch.weekendOption())); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedules"))); //store the payment history for this scheduled task. //easiest way is to delete all and re-insert; it's not a high use table q.prepare("DELETE FROM kmmSchedulePaymentHistory WHERE schedId = :id;"); q.bindValue(":id", sch.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Schedule Payment History"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Schedule Payment History"))); q.prepare (m_db.m_tables["kmmSchedulePaymentHistory"].insertString()); - QValueList<QDate> payments = sch.recordedPayments(); - QValueList<QDate>::ConstIterator it; + TQValueList<TQDate> payments = sch.recordedPayments(); + TQValueList<TQDate>::ConstIterator it; for (it=payments.begin(); it!=payments.end(); ++it) { q.bindValue(":schedId", sch.id()); - q.bindValue(":payDate", (*it).toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Schedule Payment History"))); + q.bindValue(":payDate", TQString((*it).toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Schedule Payment History"))); } //store the transaction data for this task. @@ -1726,19 +1718,19 @@ void MyMoneyStorageSql::writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuer void MyMoneyStorageSql::writeSecurities() { DBG("*** Entering MyMoneyStorageSql::writeSecurities"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmSecurities;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building security list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList<MyMoneySecurity> securityList = m_storage->securityList(); + const TQValueList<MyMoneySecurity> securityList = m_storage->securityList(); signalProgress(0, securityList.count(), "Writing Securities..."); q.prepare (m_db.m_tables["kmmSecurities"].updateString()); q2.prepare (m_db.m_tables["kmmSecurities"].insertString()); - for(QValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeSecurity((*it), q); } else { @@ -1750,7 +1742,7 @@ void MyMoneyStorageSql::writeSecurities() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmSecurities WHERE id = :id"); q2.prepare("DELETE FROM kmmPrices WHERE fromId = :id OR toId = :id"); - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Security")); @@ -1792,7 +1784,7 @@ void MyMoneyStorageSql::removeSecurity(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmSecurities"].deleteString()); q.bindValue(":id", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Security"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Security"))); --m_securities; writeFileInfo(); endCommitUnit(__func__); @@ -1808,7 +1800,7 @@ void MyMoneyStorageSql::writeSecurity(const MyMoneySecurity& security, MyMoneySq q.bindValue(":smallestAccountFraction", security.smallestAccountFraction()); q.bindValue(":tradingCurrency", security.tradingCurrency()); q.bindValue(":tradingMarket", security.tradingMarket()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString ("writing Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString ("writing Securities"))); //Add in Key-Value Pairs for security writeKeyValuePairs("SECURITY", security.id(), security.pairs()); @@ -1822,7 +1814,7 @@ void MyMoneyStorageSql::writePrices() { // easiest way is to delete all and re-insert MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmPrices"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Prices"))); m_prices = 0; const MyMoneyPriceList list = m_storage->priceList(); @@ -1849,13 +1841,13 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { startCommitUnit(__func__); bool newRecord = false; MyMoneySqlQuery q(this); - QString s = m_db.m_tables["kmmPrices"].selectAllString(false); + TQString s = m_db.m_tables["kmmPrices"].selectAllString(false); s += " WHERE fromId = :fromId AND toId = :toId AND priceDate = :priceDate;"; q.prepare (s); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("finding Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("finding Price"))); if (q.next()) { q.prepare(m_db.m_tables["kmmPrices"].updateString()); } else { @@ -1865,12 +1857,12 @@ void MyMoneyStorageSql::addPrice(const MyMoneyPrice& p) { } q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); q.bindValue(":priceFormatted", - p.rate(QString()).formatMoney("", KMyMoneySettings::pricePrecision())); + p.rate(TQString()).formatMoney("", KMyMoneySettings::pricePrecision())); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Price"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Price"))); if (newRecord) writeFileInfo(); endCommitUnit(__func__); @@ -1883,8 +1875,8 @@ void MyMoneyStorageSql::removePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].deleteString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Price"))); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Price"))); --m_prices; writeFileInfo(); endCommitUnit(__func__); @@ -1896,30 +1888,30 @@ void MyMoneyStorageSql::writePrice(const MyMoneyPrice& p) { q.prepare (m_db.m_tables["kmmPrices"].insertString()); q.bindValue(":fromId", p.from()); q.bindValue(":toId", p.to()); - q.bindValue(":priceDate", p.date().toString(Qt::ISODate)); - q.bindValue(":price", p.rate(QString()).toString()); - q.bindValue(":priceFormatted", p.rate(QString()).formatMoney("", 2)); + q.bindValue(":priceDate", TQString(p.date().toString(Qt::ISODate))); + q.bindValue(":price", p.rate(TQString()).toString()); + q.bindValue(":priceFormatted", p.rate(TQString()).formatMoney("", 2)); q.bindValue(":priceSource", p.source()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Prices"))); } // **** Currencies **** void MyMoneyStorageSql::writeCurrencies() { DBG("*** Entering MyMoneyStorageSql::writeCurrencies"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT ISOCode FROM kmmCurrencies;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Currency list")); while (q.next()) dbList.append(q.value(0).toString()); - const QValueList<MyMoneySecurity> currencyList = m_storage->currencyList(); + const TQValueList<MyMoneySecurity> currencyList = m_storage->currencyList(); signalProgress(0, currencyList.count(), "Writing Currencies..."); q.prepare (m_db.m_tables["kmmCurrencies"].updateString()); q2.prepare (m_db.m_tables["kmmCurrencies"].insertString()); - for(QValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { - if (dbList.contains((*it).id())) { + for(TQValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeCurrency((*it), q); } else { @@ -1930,7 +1922,7 @@ void MyMoneyStorageSql::writeCurrencies() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmCurrencies WHERE ISOCode = :ISOCode"); - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":ISOCode", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Currency")); @@ -1966,7 +1958,7 @@ void MyMoneyStorageSql::removeCurrency(const MyMoneySecurity& sec) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmCurrencies"].deleteString()); q.bindValue(":ISOcode", sec.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Currency"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Currency"))); --m_currencies; writeFileInfo(); endCommitUnit(__func__); @@ -1980,35 +1972,35 @@ void MyMoneyStorageSql::writeCurrency(const MyMoneySecurity& currency, MyMoneySq q.bindValue(":typeString", MyMoneySecurity::securityTypeToString(currency.securityType())); // writing the symbol as three short ints is a PITA, but the // problem is that database drivers have incompatible ways of declaring UTF8 - QString symbol = currency.tradingSymbol() + " "; - q.bindValue(":symbol1", symbol.mid(0,1).unicode()->unicode()); - q.bindValue(":symbol2", symbol.mid(1,1).unicode()->unicode()); - q.bindValue(":symbol3", symbol.mid(2,1).unicode()->unicode()); + TQString symbol = currency.tradingSymbol() + " "; + q.bindValue(":symbol1", symbol.mid(0,1).tqunicode()->tqunicode()); + q.bindValue(":symbol2", symbol.mid(1,1).tqunicode()->tqunicode()); + q.bindValue(":symbol3", symbol.mid(2,1).tqunicode()->tqunicode()); q.bindValue(":symbolString", symbol); q.bindValue(":partsPerUnit", currency.partsPerUnit()); q.bindValue(":smallestCashFraction", currency.smallestCashFraction()); q.bindValue(":smallestAccountFraction", currency.smallestAccountFraction()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Currencies"))); } void MyMoneyStorageSql::writeReports() { DBG("*** Entering MyMoneyStorageSql::writeReports"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT id FROM kmmReportConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Report list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList<MyMoneyReport> list = m_storage->reportList(); + TQValueList<MyMoneyReport> list = m_storage->reportList(); signalProgress(0, list.count(), "Writing Reports..."); - QValueList<MyMoneyReport>::ConstIterator it; + TQValueList<MyMoneyReport>::ConstIterator it; q.prepare (m_db.m_tables["kmmReportConfig"].updateString()); q2.prepare (m_db.m_tables["kmmReportConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).id())) { + if (dbList.tqcontains((*it).id())) { dbList.remove ((*it).id()); writeReport(*it, q); } else { @@ -2019,7 +2011,7 @@ void MyMoneyStorageSql::writeReports() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":id", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Report")); @@ -2055,7 +2047,7 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { MyMoneySqlQuery q(this); q.prepare("DELETE FROM kmmReportConfig WHERE id = :id"); q.bindValue(":id", rep.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Report"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Report"))); --m_reports; writeFileInfo(); endCommitUnit(__func__); @@ -2063,34 +2055,34 @@ void MyMoneyStorageSql::removeReport(const MyMoneyReport& rep) { void MyMoneyStorageSql::writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeReport"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("REPORTS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("REPORTS"); d.appendChild (e); rep.writeXML(d, e); // write the XML to document q.bindValue(":id", rep.id()); q.bindValue(":name", rep.name()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Reports"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Reports"))); //m_hiIdReports = calcHighId(m_hiIdReports, rep.id()); } void MyMoneyStorageSql::writeBudgets() { DBG("*** Entering MyMoneyStorageSql::writeBudgets"); // first, get a list of what's on the database (see writeInstitutions) - QValueList<QString> dbList; + TQValueList<TQString> dbList; MyMoneySqlQuery q(this); MyMoneySqlQuery q2(this); q.prepare("SELECT name FROM kmmBudgetConfig;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "building Budget list")); while (q.next()) dbList.append(q.value(0).toString()); - QValueList<MyMoneyBudget> list = m_storage->budgetList(); + TQValueList<MyMoneyBudget> list = m_storage->budgetList(); signalProgress(0, list.count(), "Writing Budgets..."); - QValueList<MyMoneyBudget>::ConstIterator it; + TQValueList<MyMoneyBudget>::ConstIterator it; q.prepare (m_db.m_tables["kmmBudgetConfig"].updateString()); q2.prepare (m_db.m_tables["kmmBudgetConfig"].insertString()); for(it = list.begin(); it != list.end(); ++it){ - if (dbList.contains((*it).name())) { + if (dbList.tqcontains((*it).name())) { dbList.remove ((*it).name()); writeBudget(*it, q); } else { @@ -2101,7 +2093,7 @@ void MyMoneyStorageSql::writeBudgets() { if (!dbList.isEmpty()) { q.prepare("DELETE FROM kmmBudgetConfig WHERE id = :id"); - QValueList<QString>::const_iterator it = dbList.begin(); + TQValueList<TQString>::const_iterator it = dbList.begin(); while (it != dbList.end()) { q.bindValue(":name", (*it)); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "deleting Budget")); @@ -2137,7 +2129,7 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmBudgetConfig"].deleteString()); q.bindValue(":id", bud.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting Budget"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting Budget"))); --m_budgets; writeFileInfo(); endCommitUnit(__func__); @@ -2145,15 +2137,15 @@ void MyMoneyStorageSql::removeBudget(const MyMoneyBudget& bud) { void MyMoneyStorageSql::writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q) { DBG("*** Entering MyMoneyStorageSql::writeBudget"); - QDomDocument d; // create a dummy XML document - QDomElement e = d.createElement("BUDGETS"); + TQDomDocument d; // create a dummy XML document + TQDomElement e = d.createElement("BUDGETS"); d.appendChild (e); bud.writeXML(d, e); // write the XML to document q.bindValue(":id", bud.id()); q.bindValue(":name", bud.name()); q.bindValue(":start", bud.budgetStart()); q.bindValue(":XML", d.toString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing Budgets"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing Budgets"))); } void MyMoneyStorageSql::writeFileInfo() { @@ -2165,7 +2157,7 @@ void MyMoneyStorageSql::writeFileInfo() { MyMoneySqlQuery q(this); q.prepare ("SELECT * FROM kmmFileInfo;"); if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, "checking fileinfo")); - QString qs; + TQString qs; if (q.next()) qs = m_db.m_tables["kmmFileInfo"].updateString(); else @@ -2173,9 +2165,9 @@ void MyMoneyStorageSql::writeFileInfo() { q.prepare(qs); q.bindValue(":version", m_dbVersion); q.bindValue(":fixLevel", m_storage->fileFixVersion()); - q.bindValue(":created", m_storage->creationDate().toString(Qt::ISODate)); + q.bindValue(":created", TQString(m_storage->creationDate().toString(Qt::ISODate))); //q.bindValue(":lastModified", m_storage->lastModificationDate().toString(Qt::ISODate)); - q.bindValue(":lastModified", QDate::currentDate().toString(Qt::ISODate)); + q.bindValue(":lastModified", TQString(TQDate::tqcurrentDate().toString(Qt::ISODate))); q.bindValue(":baseCurrency", m_storage->pairs()["kmm-baseCurrency"]); q.bindValue(":institutions", (unsigned long long) m_institutions); q.bindValue(":accounts", (unsigned long long) m_accounts); @@ -2189,8 +2181,8 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":reports", (unsigned long long) m_reports); q.bindValue(":kvps", (unsigned long long) m_kvps); q.bindValue(":budgets", (unsigned long long) m_budgets); - q.bindValue(":dateRangeStart", QDate()); - q.bindValue(":dateRangeEnd", QDate()); + q.bindValue(":dateRangeStart", TQDate()); + q.bindValue(":dateRangeEnd", TQDate()); //FIXME: This modifies all m_<variable> used in this function. // Sometimes the memory has been updated. @@ -2217,19 +2209,19 @@ void MyMoneyStorageSql::writeFileInfo() { q.bindValue(":updateInProgress", "N"); q.bindValue(":logonUser", m_logonUser); q.bindValue(":logonAt", m_logonAt.toString(Qt::ISODate)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing FileInfo"))); } // **** Key/value pairs **** -void MyMoneyStorageSql::writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap<QString, QString>& pairs) { +void MyMoneyStorageSql::writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap<TQString, TQString>& pairs) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePairs"); - QMap<QString, QString>::const_iterator it; + TQMap<TQString, TQString>::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { writeKeyValuePair (kvpType, kvpId, it.key(), it.data()); } } -void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString& kvpId, const QString& kvpKey, const QString& kvpData) { +void MyMoneyStorageSql::writeKeyValuePair (const TQString& kvpType, const TQString& kvpId, const TQString& kvpKey, const TQString& kvpData) { DBG("*** Entering MyMoneyStorageSql::writeKeyValuePair"); MyMoneySqlQuery q(this); q.prepare (m_db.m_tables["kmmKeyValuePairs"].insertString()); @@ -2237,17 +2229,17 @@ void MyMoneyStorageSql::writeKeyValuePair (const QString& kvpType, const QString q.bindValue(":kvpId", kvpId); q.bindValue(":kvpKey", kvpKey); q.bindValue(":kvpData", kvpData); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("writing KVP"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("writing KVP"))); ++m_kvps; } -void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QString& kvpId) { +void MyMoneyStorageSql::deleteKeyValuePairs (const TQString& kvpType, const TQString& kvpId) { DBG("*** Entering MyMoneyStorageSql::deleteKeyValuePairs"); MyMoneySqlQuery q(this); q.prepare ("DELETE FROM kmmKeyValuePairs WHERE kvpType = :kvpType AND kvpId = :kvpId;"); q.bindValue(":kvpType", kvpType); q.bindValue(":kvpId", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("deleting kvp for %1 %2").arg(kvpType).arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("deleting kvp for %1 %2").tqarg(kvpType).tqarg(kvpId))); m_kvps -= q.numRowsAffected(); } @@ -2262,12 +2254,12 @@ void MyMoneyStorageSql::deleteKeyValuePairs (const QString& kvpType, const QStri void MyMoneyStorageSql::readFileInfo(void) { DBG("*** Entering MyMoneyStorageSql::readFileInfo"); - signalProgress(0, 18, QObject::tr("Loading file information...")); + signalProgress(0, 18, TQObject::tr("Loading file information...")); MyMoneyDbTable& t = m_db.m_tables["kmmFileInfo"]; MyMoneySqlQuery q(this); q.prepare (t.selectAllString()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading FileInfo"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving FileInfo"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading FileInfo"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving FileInfo"))); MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != t.end()) { @@ -2302,10 +2294,10 @@ void MyMoneyStorageSql::readFileInfo(void) { ++ft; ++i; signalProgress(i,0); } - m_storage->setPairs(readKeyValuePairs("STORAGE", QString("")).pairs()); + m_storage->setPairs(readKeyValuePairs("STORAGE", TQString("")).pairs()); } -/*void MyMoneyStorageSql::setVersion (const QString& version) { +/*void MyMoneyStorageSql::setVersion (const TQString& version) { DBG("*** Entering MyMoneyStorageSql::setVersion"); m_dbVersion = version.section('.', 0, 0).toUInt(); m_minorVersion = version.section('.', 1, 1).toUInt(); @@ -2318,31 +2310,31 @@ void MyMoneyStorageSql::readFileInfo(void) { void MyMoneyStorageSql::readInstitutions(void) { TRY - QMap<QString, MyMoneyInstitution> iList = fetchInstitutions(); + TQMap<TQString, MyMoneyInstitution> iList = fetchInstitutions(); m_storage->loadInstitutions(iList); readFileInfo(); m_storage->loadInstitutionId(m_hiIdInstitutions); PASS } -const QMap<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (const QStringList& idList, bool forUpdate) const { +const TQMap<TQString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readInstitutions"); - signalProgress(0, m_institutions, QObject::tr("Loading institutions...")); + signalProgress(0, m_institutions, TQObject::tr("Loading institutions...")); int progress = 0; - QMap<QString, MyMoneyInstitution> iList; + TQMap<TQString, MyMoneyInstitution> iList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmInstitutions"]; MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (this)); sq.prepare ("SELECT id from kmmAccounts where institutionId = :id"); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } if (forUpdate) @@ -2353,17 +2345,17 @@ const QMap<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (co q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString iid; + TQString iid; MyMoneyInstitution inst; while (ft != t.end()) { CASE(id) iid = GETSTRING; @@ -2378,10 +2370,10 @@ const QMap<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (co } // get list of subaccounts sq.bindValue(":id", iid); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Institution AccountList"))); - QStringList aList; + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Institution AccountList"))); + TQStringList aList; while (sq.next()) aList.append(sq.value(0).toString()); - for (QStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) + for (TQStringList::ConstIterator it = aList.begin(); it != aList.end(); ++it) inst.addAccountId(*it); iList[iid] = MyMoneyInstitution(iid, inst); @@ -2394,18 +2386,18 @@ const QMap<QString, MyMoneyInstitution> MyMoneyStorageSql::fetchInstitutions (co return iList; } -void MyMoneyStorageSql::readPayees (const QString& id) { +void MyMoneyStorageSql::readPayees (const TQString& id) { DBG("*** Entering MyMoneyStorageSql::readPayees"); - QValueList<QString> list; + TQValueList<TQString> list; list.append(id); readPayees(list); } -void MyMoneyStorageSql::readPayees(const QValueList<QString> pid) { +void MyMoneyStorageSql::readPayees(const TQValueList<TQString> pid) { DBG("*** Entering MyMoneyStorageSql::readPayees"); TRY - QStringList pidList; - qCopy(pid.begin(), pid.end(), qBackInserter(pidList)); + TQStringList pidList; + tqCopy(pid.begin(), pid.end(), qBackInserter(pidList)); m_storage->loadPayees(fetchPayees(pidList)); readFileInfo(); @@ -2416,15 +2408,15 @@ void MyMoneyStorageSql::readPayees(const QValueList<QString> pid) { // if (pid.isEmpty()) m_payeeListRead = true; } -const QMap<QString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const QStringList& idList, bool /*forUpdate*/) const { +const TQMap<TQString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const TQStringList& idList, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readPayees"); - if (m_displayStatus) { - signalProgress(0, m_payees, QObject::tr("Loading payees...")); + if (m_displaytqStatus) { + signalProgress(0, m_payees, TQObject::tr("Loading payees...")); } else { // if (m_payeeListRead) return; } int progress = 0; - QMap<QString, MyMoneyPayee> pList; + TQMap<TQString, MyMoneyPayee> pList; //unsigned long lastId; const MyMoneyDbTable& t = m_db.m_tables["kmmPayees"]; MyMoneyDbTable::field_iterator payeeEnd = t.end(); @@ -2432,26 +2424,26 @@ const QMap<QString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const QStringL if (idList.isEmpty()) { q.prepare (t.selectAllString()); } else { - QString whereClause = " where ("; - QString itemConnector = ""; - QStringList::ConstIterator it; + TQString whereClause = " where ("; + TQString itemConnector = ""; + TQStringList::ConstIterator it; for (it = idList.begin(); it != idList.end(); ++it) { - whereClause.append(QString("%1id = '%2'").arg(itemConnector).arg(*it)); + whereClause.append(TQString("%1id = '%2'").tqarg(itemConnector).tqarg(*it)); itemConnector = " or "; } whereClause += ")"; q.prepare (t.selectAllString(false) + whereClause); } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Payee"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Payee"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString pid; - QString boolChar; + TQString pid; + TQString boolChar; MyMoneyPayee payee; unsigned int type; bool ignoreCase; - QString matchKeys; + TQString matchKeys; while (ft != payeeEnd) { CASE(id) pid = GETCSTRING; else CASE(name) payee.setName(GETSTRING); @@ -2476,48 +2468,48 @@ const QMap<QString, MyMoneyPayee> MyMoneyStorageSql::fetchPayees (const QStringL PASS } else { pList[pid] = MyMoneyPayee(pid, payee); - //unsigned long id = extractId(QString(pid)); + //unsigned long id = extractId(TQString(pid)); //if(id > lastId) // lastId = id; } - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } return pList; } -const QMap<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStringList& idList, bool forUpdate) const { +const TQMap<TQString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::fetchAccounts"); - signalProgress(0, m_accounts, QObject::tr("Loading accounts...")); + signalProgress(0, m_accounts, TQObject::tr("Loading accounts...")); int progress = 0; - QMap<QString, MyMoneyAccount> accList; - QStringList kvpAccountList; + TQMap<TQString, MyMoneyAccount> accList; + TQStringList kvpAccountList; const MyMoneyDbTable& t = m_db.m_tables["kmmAccounts"]; MyMoneyDbTable::field_iterator accEnd = t.end(); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (this)); - QString childQueryString = "SELECT id, parentId FROM kmmAccounts WHERE "; - QString queryString (t.selectAllString(false)); + TQString childQueryString = "SELECT id, tqparentId FROM kmmAccounts WHERE "; + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { kvpAccountList = idList; queryString += " WHERE id IN ("; - childQueryString += " parentId IN ("; + childQueryString += " tqparentId IN ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; - childQueryString += ":id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; + childQueryString += ":id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + ")"; childQueryString = childQueryString.left(childQueryString.length() - 2) + ")"; } else { - childQueryString += " NOT parentId IS NULL"; + childQueryString += " NOT tqparentId IS NULL"; } queryString += " ORDER BY id"; - childQueryString += " ORDER BY parentid, id"; + childQueryString += " ORDER BY tqparentid, id"; if (forUpdate) { queryString += " FOR UPDATE"; @@ -2528,26 +2520,26 @@ const QMap<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStr sq.prepare (childQueryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); - sq.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); + sq.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Account"))); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading subAccountList"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Account"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading subAccountList"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString aid; - QString balance; + TQString aid; + TQString balance; MyMoneyAccount acc; while (ft != accEnd) { CASE(id) aid = GETCSTRING; else CASE(institutionId) acc.setInstitutionId(GETCSTRING); - else CASE(parentId) acc.setParentAccountId(GETCSTRING); + else CASE(tqparentId) acc.setParentAccountId(GETCSTRING); else CASE(lastReconciled) acc.setLastReconciliationDate(GETDATE); else CASE(lastModified) acc.setLastModified(GETDATE); else CASE(openingDate) acc.setOpeningDate(GETDATE); @@ -2575,10 +2567,10 @@ const QMap<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStr signalProgress(++progress, 0); } - QMapIterator<QString, MyMoneyAccount> it_acc; - QMapIterator<QString, MyMoneyAccount> accListEnd = accList.end(); + TQMapIterator<TQString, MyMoneyAccount> it_acc; + TQMapIterator<TQString, MyMoneyAccount> accListEnd = accList.end(); while (sq.next()) { - it_acc = accList.find(sq.value(1).toString()); + it_acc = accList.tqfind(sq.value(1).toString()); if (it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { while (sq.isValid() && it_acc != accListEnd && it_acc.data().id() == sq.value(1).toString()) { @@ -2593,16 +2585,16 @@ const QMap<QString, MyMoneyAccount> MyMoneyStorageSql::fetchAccounts (const QStr // where it may be able to be done in O(n), if things are just right. // The operator[] call in the loop is the most expensive call in this function, according // to several profile runs. - QMap <QString, MyMoneyKeyValueContainer> kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); - QMap <QString, MyMoneyKeyValueContainer>::const_iterator kvp_end = kvpResult.end(); - for (QMap <QString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin(); + TQMap <TQString, MyMoneyKeyValueContainer> kvpResult = readKeyValuePairs("ACCOUNT", kvpAccountList); + TQMap <TQString, MyMoneyKeyValueContainer>::const_iterator kvp_end = kvpResult.end(); + for (TQMap <TQString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setPairs(it_kvp.data().pairs()); } kvpResult = readKeyValuePairs("ONLINEBANKING", kvpAccountList); kvp_end = kvpResult.end(); - for (QMap <QString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin(); + for (TQMap <TQString, MyMoneyKeyValueContainer>::const_iterator it_kvp = kvpResult.begin(); it_kvp != kvp_end; ++it_kvp) { accList[it_kvp.key()].setOnlineBankingSettings(it_kvp.data()); } @@ -2615,15 +2607,15 @@ void MyMoneyStorageSql::readAccounts(void) { m_storage->loadAccountId(m_hiIdAccounts); } -const QMap<QString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const QStringList& idList, const QDate& date) const { +const TQMap<TQString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const TQStringList& idList, const TQDate& date) const { - QMap<QString, MyMoneyMoney> returnValue; + TQMap<TQString, MyMoneyMoney> returnValue; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString = "SELECT action, shares, accountId, postDate " + TQString queryString = "SELECT action, shares, accountId, postDate " "FROM kmmSplits WHERE txType = 'N' AND accountId in ("; for (unsigned i = 0; i < idList.count(); ++i) { - queryString += " :id" + QString::number(i) + ", "; + queryString += " :id" + TQString::number(i) + ", "; } queryString = queryString.left(queryString.length() - 2) + " )"; @@ -2631,20 +2623,20 @@ const QMap<QString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const QStringL // the <= operator misbehave when the date matches. To avoid this, add a day to the // requested date and use the < operator. if (date.isValid() && !date.isNull()) - queryString += QString(" AND postDate < '%1'").arg(date.addDays(1).toString(Qt::ISODate)); + queryString += TQString(" AND postDate < '%1'").tqarg(date.addDays(1).toString(Qt::ISODate)); DBG (queryString); q.prepare(queryString); - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); returnValue[*bindVal] = MyMoneyMoney(0); } if (!q.exec()) - throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("fetching balance"))); - QString id; - QString shares; - QString action; + throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("fetching balance"))); + TQString id; + TQString shares; + TQString action; while (q.next()) { id = q.value(2).toString(); shares = q.value(1).toString(); @@ -2657,7 +2649,7 @@ const QMap<QString, MyMoneyMoney> MyMoneyStorageSql::fetchBalance(const QStringL return returnValue; } -void MyMoneyStorageSql::readTransactions(const QString& tidList, const QString& dateClause) { +void MyMoneyStorageSql::readTransactions(const TQString& tidList, const TQString& dateClause) { TRY m_storage->loadTransactions(fetchTransactions(tidList, dateClause)); m_storage->loadTransactionId(m_hiIdTransactions); @@ -2671,13 +2663,13 @@ void MyMoneyStorageSql::readTransactions(const MyMoneyTransactionFilter& filter) PASS } -const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const QString& tidList, const QString& dateClause, bool /*forUpdate*/) const { +const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const TQString& tidList, const TQString& dateClause, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // if (m_transactionListRead) return; // all list already in memory - if (m_displayStatus) signalProgress(0, m_transactions, QObject::tr("Loading transactions...")); + if (m_displaytqStatus) signalProgress(0, m_transactions, TQObject::tr("Loading transactions...")); int progress = 0; // m_payeeList.clear(); - QString whereClause; + TQString whereClause; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { whereClause += " AND id IN " + tidList; @@ -2686,7 +2678,7 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co const MyMoneyDbTable& t = m_db.m_tables["kmmTransactions"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare (t.selectAllString(false) + whereClause + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Transaction"))); const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; whereClause = " WHERE txType = 'N' "; if (! tidList.isEmpty()) { @@ -2694,11 +2686,11 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co } if (!dateClause.isEmpty()) whereClause += " and " + dateClause; MyMoneySqlQuery qs(const_cast <MyMoneyStorageSql*> (this)); - QString splitQuery = ts.selectAllString(false) + whereClause + TQString splitQuery = ts.selectAllString(false) + whereClause + " ORDER BY transactionId, splitId;"; qs.prepare (splitQuery); if (!qs.exec()) throw new MYMONEYEXCEPTION(buildError (qs, __func__, "reading Splits")); - QString splitTxId = "ZZZ"; + TQString splitTxId = "ZZZ"; MyMoneySplit s; if (qs.next()) { splitTxId = qs.value(0).toString(); @@ -2706,12 +2698,12 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co } else { splitTxId = "ZZZ"; } - QMap <QString, MyMoneyTransaction> txMap; - QStringList txList; + TQMap <TQString, MyMoneyTransaction> txMap; + TQStringList txList; MyMoneyDbTable::field_iterator txEnd = t.end(); while (q.next()) { MyMoneyTransaction tx; - QString txId; + TQString txId; MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; while (ft != txEnd) { @@ -2749,14 +2741,14 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co txMap.insert(tx.uniqueSortKey(), tx); } } - QMap <QString, MyMoneyKeyValueContainer> kvpMap = readKeyValuePairs("TRANSACTION", txList); - QMap<QString, MyMoneyTransaction> tList; - QMapIterator<QString, MyMoneyTransaction> txMapEnd = txMap.end(); - for (QMapIterator<QString, MyMoneyTransaction> i = txMap.begin(); + TQMap <TQString, MyMoneyKeyValueContainer> kvpMap = readKeyValuePairs("TRANSACTION", txList); + TQMap<TQString, MyMoneyTransaction> tList; + TQMapIterator<TQString, MyMoneyTransaction> txMapEnd = txMap.end(); + for (TQMapIterator<TQString, MyMoneyTransaction> i = txMap.begin(); i != txMapEnd; ++i) { i.data().setPairs(kvpMap[i.data().id()].pairs()); - if (m_displayStatus) signalProgress(++progress, 0); + if (m_displaytqStatus) signalProgress(++progress, 0); } if ((tidList.isEmpty()) && (dateClause.isEmpty())) { @@ -2789,20 +2781,20 @@ int MyMoneyStorageSql::splitState(const MyMoneyTransactionFilter::stateOptionE& return rc; } -const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { +const TQMap<TQString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (const MyMoneyTransactionFilter& filter) const { DBG("*** Entering MyMoneyStorageSql::readTransactions"); // analyze the filter // if (m_transactionListRead) return; // all list already in memory // if the filter is restricted to certain accounts/categories // check if we already have them all in memory - QStringList accounts; - QString inQuery; + TQStringList accounts; + TQString inQuery; filter.accounts(accounts); filter.categories(accounts); -// QStringList::iterator it; +// TQStringList::iterator it; // bool allAccountsLoaded = true; // for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { // allAccountsLoaded = false; // break; // } @@ -2817,7 +2809,7 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co alert ("Amount Filter Set"); canImplementFilter = false; } - QString n1, n2; + TQString n1, n2; if (filter.numberFilter(n1, n2)) { alert("Number filter set"); canImplementFilter = false; @@ -2832,7 +2824,7 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co // alert("State filter set"); // canImplementFilter = false; // } - QRegExp t2; + TQRegExp t2; if (filter.textFilter(t2)) { alert("text filter set"); canImplementFilter = false; @@ -2843,9 +2835,9 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co canImplementFilter = false; } if (!canImplementFilter) { - QMap<QString, MyMoneyTransaction> transactionList = fetchTransactions(); - QMap<QString, MyMoneyTransaction>::ConstIterator it_t; - QMap<QString, MyMoneyTransaction>::ConstIterator txListEnd = transactionList.end(); + TQMap<TQString, MyMoneyTransaction> transactionList = fetchTransactions(); + TQMap<TQString, MyMoneyTransaction>::ConstIterator it_t; + TQMap<TQString, MyMoneyTransaction>::ConstIterator txListEnd = transactionList.end(); std::remove_if(transactionList.begin(), transactionList.end(), FilterFail(filter, m_storagePtr)); return transactionList; @@ -2854,27 +2846,27 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co bool accountsOnlyFilter = true; bool splitFilterActive = false; // the split filter is active if we are selecting on fields in the split table // get start and end dates - QDate start = filter.fromDate(); - QDate end = filter.toDate(); + TQDate start = filter.fromDate(); + TQDate end = filter.toDate(); // not entirely sure if the following is correct, but at best, saves a lot of reads, at worst // it only causes us to read a few more transactions that strictly necessary (I think...) - if (start == KMyMoneySettings::startDate().date()) start = QDate(); - bool txFilterActive = ((start != QDate()) || (end != QDate())); // and this for fields in the transaction table + if (start == KMyMoneySettings::startDate().date()) start = TQDate(); + bool txFilterActive = ((start != TQDate()) || (end != TQDate())); // and this for fields in the transaction table if (txFilterActive) accountsOnlyFilter = false; - QString whereClause = ""; - QString subClauseconnector = " where txType = 'N' and "; + TQString whereClause = ""; + TQString subClauseconnector = " where txType = 'N' and "; // payees - QStringList payees; + TQStringList payees; //filter.payees(payees); if (filter.payees(payees)) { accountsOnlyFilter = false; - QString itemConnector = "payeeId in ("; - QString payeesClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "payeeId in ("; + TQString payeesClause = ""; + TQStringList::const_iterator it; for (it = payees.begin(); it != payees.end(); ++it) { - payeesClause.append(QString("%1'%2'") - .arg(itemConnector).arg(*it)); + payeesClause.append(TQString("%1'%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; } if (!payeesClause.isEmpty()) { @@ -2887,13 +2879,13 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co // accounts and categories if (!accounts.isEmpty()) { splitFilterActive = true; - QString itemConnector = "accountId in ("; - QString accountsClause = ""; - QStringList::const_iterator it; + TQString itemConnector = "accountId in ("; + TQString accountsClause = ""; + TQStringList::const_iterator it; for (it = accounts.begin(); it != accounts.end(); ++it) { -// if (m_accountsLoaded.find(*it) == m_accountsLoaded.end()) { - accountsClause.append(QString("%1 '%2'") - .arg(itemConnector).arg(*it)); +// if (m_accountsLoaded.tqfind(*it) == m_accountsLoaded.end()) { + accountsClause.append(TQString("%1 '%2'") + .tqarg(itemConnector).tqarg(*it)); itemConnector = ", "; //if (accountsOnlyFilter) m_accountsLoaded.append(*it); // a bit premature... // } @@ -2905,15 +2897,15 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co } // split states - QValueList <int> splitStates; + TQValueList <int> splitStates; if (filter.states(splitStates)) { splitFilterActive = true; - QString itemConnector = " reconcileFlag IN ("; - QString statesClause = ""; - for (QValueList<int>::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { - statesClause.append(QString(" %1 '%2'") - .arg(itemConnector) - .arg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); + TQString itemConnector = " reconcileFlag IN ("; + TQString statesClause = ""; + for (TQValueList<int>::ConstIterator it = splitStates.begin(); it != splitStates.end(); ++it) { + statesClause.append(TQString(" %1 '%2'") + .tqarg(itemConnector) + .tqarg(splitState(MyMoneyTransactionFilter::stateOptionE(*it)))); itemConnector = ","; } if (!statesClause.isEmpty()) { @@ -2922,8 +2914,8 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co } } // I've given up trying to work out the logic. we keep getting the wrong number of close brackets - int obc = whereClause.contains('('); - int cbc = whereClause.contains(')'); + int obc = whereClause.tqcontains('('); + int cbc = whereClause.tqcontains(')'); if (cbc > obc) { qFatal("invalid where clause - %s", whereClause.latin1()); } @@ -2946,22 +2938,22 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co return fetchTransactions(); } // build a date clause for the transaction table - QString dateClause; - QString connector = ""; - if (end != QDate()) { - dateClause = QString("(postDate < '%1')").arg(end.addDays(1).toString(Qt::ISODate)); + TQString dateClause; + TQString connector = ""; + if (end != TQDate()) { + dateClause = TQString("(postDate < '%1')").tqarg(end.addDays(1).toString(Qt::ISODate)); connector = " and "; } - if (start != QDate()) { - dateClause += QString("%1 (postDate >= '%2')").arg(connector).arg(start.toString(Qt::ISODate)); + if (start != TQDate()) { + dateClause += TQString("%1 (postDate >= '%2')").tqarg(connector).tqarg(start.toString(Qt::ISODate)); } // now get a list of transaction ids // if we have only a date filter, we need to build the list from the tx table // otherwise we need to build from the split table if (splitFilterActive) { - inQuery = QString("(select distinct transactionId from kmmSplits %1)").arg(whereClause); + inQuery = TQString("(select distinct transactionId from kmmSplits %1)").tqarg(whereClause); } else { - inQuery = QString("(select distinct id from kmmTransactions where %1)").arg(dateClause); + inQuery = TQString("(select distinct id from kmmTransactions where %1)").tqarg(dateClause); txFilterActive = false; // kill off the date filter now } @@ -2969,7 +2961,7 @@ const QMap<QString, MyMoneyTransaction> MyMoneyStorageSql::fetchTransactions (co //FIXME: if we have an accounts-only filter, recalc balances on loaded accounts } -unsigned long MyMoneyStorageSql::transactionCount (const QString& aid) const { +unsigned long MyMoneyStorageSql::transactionCount (const TQString& aid) const { DBG("*** Entering MyMoneyStorageSql::transactionCount"); if (aid.length() == 0) return m_transactions; @@ -2984,17 +2976,17 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co MyMoneyDbTable::field_iterator splitEnd = t.end(); int i = 0; - // Use the QString here instead of CASE, since this is called so often. - QString fieldName; + // Use the TQString here instead of CASE, since this is called so often. + TQString fieldName; while (ft != splitEnd) { fieldName = (*ft)->name(); if (fieldName == "payeeId") s.setPayeeId(GETCSTRING); else if (fieldName == "reconcileDate") s.setReconcileDate(GETDATE); else if (fieldName == "action") s.setAction(GETCSTRING); else if (fieldName == "reconcileFlag") s.setReconcileFlag(static_cast<MyMoneySplit::reconcileFlagE>(GETINT)); - else if (fieldName == "value") s.setValue(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "shares") s.setShares(MyMoneyMoney(QStringEmpty(GETSTRING))); - else if (fieldName == "price") s.setPrice(MyMoneyMoney(QStringEmpty(GETSTRING))); + else if (fieldName == "value") s.setValue(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "shares") s.setShares(MyMoneyMoney(TQStringEmpty(GETSTRING))); + else if (fieldName == "price") s.setPrice(MyMoneyMoney(TQStringEmpty(GETSTRING))); else if (fieldName == "memo") s.setMemo(GETSTRING); else if (fieldName == "accountId") s.setAccountId(GETCSTRING); else if (fieldName == "checkNumber") s.setNumber(GETSTRING); @@ -3006,7 +2998,7 @@ void MyMoneyStorageSql::readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, co return; } -bool MyMoneyStorageSql::isReferencedByTransaction(const QString& id) const { +bool MyMoneyStorageSql::isReferencedByTransaction(const TQString& id) const { DBG("*** Entering MyMoneyStorageSql::isReferencedByTransaction"); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare("SELECT COUNT(*) FROM kmmTransactions " @@ -3030,13 +3022,13 @@ void MyMoneyStorageSql::readSchedules(void) { PASS } -const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QStringList& idList, bool forUpdate) const { +const TQMap<TQString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readSchedules"); - signalProgress(0, m_schedules, QObject::tr("Loading schedules...")); + signalProgress(0, m_schedules, TQObject::tr("Loading schedules...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSchedules"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QMap<QString, MyMoneySchedule> sList; + TQMap<TQString, MyMoneySchedule> sList; //unsigned long lastId = 0; const MyMoneyDbTable& ts = m_db.m_tables["kmmSplits"]; MyMoneySqlQuery qs(const_cast <MyMoneyStorageSql*> (this)); @@ -3044,14 +3036,14 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery sq(const_cast <MyMoneyStorageSql*> (this)); sq.prepare ("SELECT payDate from kmmSchedulePaymentHistory where schedId = :id"); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " id = :id" + QString::number(i) + " OR"; + queryString += " id = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } queryString += " ORDER BY id;"; @@ -3064,20 +3056,20 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Schedules"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Schedules"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySchedule s; - QString sId; - QString boolChar; - QDate nextPaymentDue; + TQString sId; + TQString boolChar; + TQDate nextPaymentDue; while (ft != t.end()) { CASE(id) sId = GETCSTRING; else CASE(name) s.setName (GETSTRING); @@ -3110,8 +3102,8 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare (t.selectAllString(false) + " WHERE id = :id;"); q.bindValue(":id", s.id()); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Scheduled Transaction"))); - if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("retrieving scheduled transaction"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Scheduled Transaction"))); + if (!q.next()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("retrieving scheduled transaction"))); MyMoneyTransaction tx(s.id(), MyMoneyTransaction()); ft = t.begin(); i = 0; @@ -3138,7 +3130,7 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS // If the transaction doesn't have a post date, setTransaction will reject it. // The old way of handling things was to store the next post date in the schedule object - // and set the transaction post date to QDate(). + // and set the transaction post date to TQDate(). // For compatibility, if this is the case, copy the next post date from the schedule object // to the transaction object post date. if (!tx.postDate().isValid()) { @@ -3149,7 +3141,7 @@ const QMap<QString, MyMoneySchedule> MyMoneyStorageSql::fetchSchedules (const QS // read in the recorded payments sq.bindValue(":id", s.id()); - if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading schedule payment history"))); + if (!sq.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading schedule payment history"))); while (sq.next()) s.recordPayment (sq.value(0).toDate()); sList[s.id()] = s; @@ -3174,21 +3166,21 @@ void MyMoneyStorageSql::readSecurities(void) { PASS } -const QMap<QString, MyMoneySecurity> MyMoneyStorageSql::fetchSecurities (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap<TQString, MyMoneySecurity> MyMoneyStorageSql::fetchSecurities (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readSecurities"); - signalProgress(0, m_securities, QObject::tr("Loading securities...")); + signalProgress(0, m_securities, TQObject::tr("Loading securities...")); int progress = 0; - QMap<QString, MyMoneySecurity> sList; + TQMap<TQString, MyMoneySecurity> sList; unsigned long lastId = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmSecurities"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare (t.selectAllString(false) + " ORDER BY id;"); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Securities"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Securities"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; MyMoneySecurity e; - QString eid; + TQString eid; int saf = 0; while (ft != t.end()) { CASE(id) eid = GETSTRING; @@ -3232,12 +3224,12 @@ void MyMoneyStorageSql::readPrices(void) { } -const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date_, bool exactDate, bool /*forUpdate*/) const { +const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date_, bool exactDate, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::fetchSinglePrice"); const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. @@ -3250,28 +3242,28 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi q.prepare(queryString); - QDate date (date_); + TQDate date (date_); if(!date.isValid()) - date = QDate::currentDate(); + date = TQDate::tqcurrentDate(); q.bindValue(":fromId", fromIdList); q.bindValue(":toId", toIdList); - q.bindValue(":priceDate", date.addDays(1).toString(Qt::ISODate)); + q.bindValue(":priceDate", TQString(date.addDays(1).toString(Qt::ISODate))); if (exactDate) - q.bindValue(":exactDate", date.toString(Qt::ISODate)); + q.bindValue(":exactDate", TQString(date.toString(Qt::ISODate))); if (! q.exec()) {} if (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; bool foundFromId = false; bool foundToId = false; bool foundPriceDate = false; @@ -3303,30 +3295,30 @@ const MyMoneyPrice MyMoneyStorageSql::fetchSinglePrice (const QString& fromIdLi return MyMoneyPrice(); } -const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromIdList, const QStringList& toIdList, bool forUpdate) const { +const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const TQStringList& fromIdList, const TQStringList& toIdList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readPrices"); - signalProgress(0, m_prices, QObject::tr("Loading prices...")); + signalProgress(0, m_prices, TQObject::tr("Loading prices...")); int progress = 0; const_cast <MyMoneyStorageSql*> (this)->m_readingPrices = true; MyMoneyPriceList pList; const MyMoneyDbTable& t = m_db.m_tables["kmmPrices"]; MyMoneyDbTable::field_iterator tableEnd = t.end(); MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString = t.selectAllString(false); + TQString queryString = t.selectAllString(false); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! fromIdList.empty()) { queryString += " WHERE ("; for (unsigned i = 0; i < fromIdList.count(); ++i) { - queryString += " fromId = :fromId" + QString::number(i) + " OR"; + queryString += " fromId = :fromId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } if (! toIdList.empty()) { queryString += " AND ("; for (unsigned i = 0; i < toIdList.count(); ++i) { - queryString += " toId = :toId" + QString::number(i) + " OR"; + queryString += " toId = :toId" + TQString::number(i) + " OR"; } queryString = queryString.left(queryString.length() - 2) + ")"; } @@ -3340,27 +3332,27 @@ const MyMoneyPriceList MyMoneyStorageSql::fetchPrices (const QStringList& fromI q.prepare (queryString); if (! fromIdList.empty()) { - QStringList::const_iterator bindVal = fromIdList.begin(); + TQStringList::const_iterator bindVal = fromIdList.begin(); for (int i = 0; bindVal != fromIdList.end(); ++i, ++bindVal) { - q.bindValue (":fromId" + QString::number(i), *bindVal); + q.bindValue (":fromId" + TQString::number(i), *bindVal); } } if (! toIdList.empty()) { - QStringList::const_iterator bindVal = toIdList.begin(); + TQStringList::const_iterator bindVal = toIdList.begin(); for (int i = 0; bindVal != toIdList.end(); ++i, ++bindVal) { - q.bindValue (":toId" + QString::number(i), *bindVal); + q.bindValue (":toId" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Prices"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Prices"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString from; - QString to; - QDate date; + TQString from; + TQString to; + TQDate date; MyMoneyMoney rate; - QString source; + TQString source; while (ft != tableEnd) { CASE(fromId) from = GETCSTRING; @@ -3384,22 +3376,22 @@ void MyMoneyStorageSql::readCurrencies(void) { PASS } -const QMap<QString, MyMoneySecurity> MyMoneyStorageSql::fetchCurrencies (const QStringList& idList, bool forUpdate) const { +const TQMap<TQString, MyMoneySecurity> MyMoneyStorageSql::fetchCurrencies (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readCurrencies"); - signalProgress(0, m_currencies, QObject::tr("Loading currencies...")); + signalProgress(0, m_currencies, TQObject::tr("Loading currencies...")); int progress = 0; - QMap<QString, MyMoneySecurity> cList; + TQMap<TQString, MyMoneySecurity> cList; const MyMoneyDbTable& t = m_db.m_tables["kmmCurrencies"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); // Use bind variables, instead of just inserting the values in the queryString, // so that values containing a ':' will work. if (! idList.empty()) { queryString += " WHERE"; for (unsigned i = 0; i < idList.count(); ++i) - queryString += " isocode = :id" + QString::number(i) + " OR"; + queryString += " isocode = :id" + TQString::number(i) + " OR"; queryString = queryString.left(queryString.length() - 2); } @@ -3413,32 +3405,32 @@ const QMap<QString, MyMoneySecurity> MyMoneyStorageSql::fetchCurrencies (const Q q.prepare (queryString); if (! idList.empty()) { - QStringList::const_iterator bindVal = idList.begin(); + TQStringList::const_iterator bindVal = idList.begin(); for (int i = 0; bindVal != idList.end(); ++i, ++bindVal) { - q.bindValue (":id" + QString::number(i), *bindVal); + q.bindValue (":id" + TQString::number(i), *bindVal); } } - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Currencies"))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Currencies"))); while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QString id; + TQString id; MyMoneySecurity c; - QChar symbol[3]; + TQChar symbol[3]; while (ft != t.end()) { CASE(ISOcode) id = GETCSTRING; else CASE(name) c.setName(GETSTRING); else CASE(type) c.setSecurityType(static_cast<MyMoneySecurity::eSECURITYTYPE>(GETINT)); - else CASE(symbol1) symbol[0] = QChar(GETINT); - else CASE(symbol2) symbol[1] = QChar(GETINT); - else CASE(symbol3) symbol[2] = QChar(GETINT); + else CASE(symbol1) symbol[0] = TQChar(GETINT); + else CASE(symbol2) symbol[1] = TQChar(GETINT); + else CASE(symbol3) symbol[2] = TQChar(GETINT); else CASE(partsPerUnit) c.setPartsPerUnit(GETINT); else CASE(smallestCashFraction) c.setSmallestCashFraction(GETINT); else CASE(smallestAccountFraction) c.setSmallestAccountFraction(GETINT); ++ft; ++i; } - c.setTradingSymbol(QString(symbol, 3).stripWhiteSpace()); + c.setTradingSymbol(TQString(symbol, 3).stripWhiteSpace()); cList[id] = MyMoneySecurity(id, c); @@ -3455,24 +3447,24 @@ void MyMoneyStorageSql::readReports(void) { PASS } -const QMap<QString, MyMoneyReport> MyMoneyStorageSql::fetchReports (const QStringList& /*idList*/, bool /*forUpdate*/) const { +const TQMap<TQString, MyMoneyReport> MyMoneyStorageSql::fetchReports (const TQStringList& /*idList*/, bool /*forUpdate*/) const { DBG("*** Entering MyMoneyStorageSql::readReports"); - signalProgress(0, m_reports, QObject::tr("Loading reports...")); + signalProgress(0, m_reports, TQObject::tr("Loading reports...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmReportConfig"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare (t.selectAllString(true)); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading reports"))); - QMap<QString, MyMoneyReport> rList; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading reports"))); + TQMap<TQString, MyMoneyReport> rList; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyReport report; @@ -3484,13 +3476,13 @@ const QMap<QString, MyMoneyReport> MyMoneyStorageSql::fetchReports (const QStrin return rList; } -const QMap<QString, MyMoneyBudget> MyMoneyStorageSql::fetchBudgets (const QStringList& idList, bool forUpdate) const { +const TQMap<TQString, MyMoneyBudget> MyMoneyStorageSql::fetchBudgets (const TQStringList& idList, bool forUpdate) const { DBG("*** Entering MyMoneyStorageSql::readBudgets"); - signalProgress(0, m_budgets, QObject::tr("Loading budgets...")); + signalProgress(0, m_budgets, TQObject::tr("Loading budgets...")); int progress = 0; const MyMoneyDbTable& t = m_db.m_tables["kmmBudgetConfig"]; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString queryString (t.selectAllString(false)); + TQString queryString (t.selectAllString(false)); if (! idList.empty()) { queryString += " WHERE id = '" + idList.join("' OR id = '") + "'"; } @@ -3500,17 +3492,17 @@ const QMap<QString, MyMoneyBudget> MyMoneyStorageSql::fetchBudgets (const QStrin queryString += ";"; q.prepare (queryString); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading budgets"))); - QMap<QString, MyMoneyBudget> budgets; + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading budgets"))); + TQMap<TQString, MyMoneyBudget> budgets; while (q.next()) { MyMoneyDbTable::field_iterator ft = t.begin(); int i = 0; - QDomDocument d; + TQDomDocument d; while (ft != t.end()) { CASE(XML) d.setContent(GETSTRING, false); ++ft; ++i; } - QDomNode child = d.firstChild(); + TQDomNode child = d.firstChild(); child = child.firstChild(); MyMoneyBudget budget (child.toElement()); budgets.insert(budget.id(), budget); @@ -3523,25 +3515,25 @@ void MyMoneyStorageSql::readBudgets(void) { m_storage->loadBudgets(fetchBudgets()); } -const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QString& kvpId) const { +const MyMoneyKeyValueContainer MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); MyMoneyKeyValueContainer list; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); q.prepare ("SELECT kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type and kvpId = :id;"); q.bindValue(":type", kvpType); q.bindValue(":id", kvpId); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp for %1 %2").arg(kvpType) - .arg(kvpId))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp for %1 %2").tqarg(kvpType) + .tqarg(kvpId))); while (q.next()) list.setValue(q.value(0).toString(), q.value(1).toString()); return (list); } -const QMap<QString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const { +const TQMap<TQString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const { DBG("*** Entering MyMoneyStorageSql::readKeyValuePairs"); - QMap<QString, MyMoneyKeyValueContainer> retval; + TQMap<TQString, MyMoneyKeyValueContainer> retval; MyMoneySqlQuery q(const_cast <MyMoneyStorageSql*> (this)); - QString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); + TQString query ("SELECT kvpId, kvpKey, kvpData from kmmKeyValuePairs where kvpType = :type"); if (!kvpIdList.empty()) { query += " and kvpId IN ('" + kvpIdList.join("', '") + "')"; @@ -3550,7 +3542,7 @@ const QMap<QString, MyMoneyKeyValueContainer> MyMoneyStorageSql::readKeyValuePai query += " order by kvpId;"; q.prepare (query); q.bindValue(":type", kvpType); - if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, QString("reading Kvp List for %1").arg(kvpType))); + if (!q.exec()) throw new MYMONEYEXCEPTION(buildError (q, __func__, TQString("reading Kvp List for %1").tqarg(kvpType))); while (q.next()) { retval [q.value(0).toString()].setValue(q.value(1).toString(), q.value(2).toString()); } @@ -3607,7 +3599,7 @@ long unsigned MyMoneyStorageSql::incrementBudgetId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiBudgetId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdBudgets = returnValue; @@ -3623,7 +3615,7 @@ long unsigned MyMoneyStorageSql::incrementAccountId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiAccountId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdAccounts = returnValue; @@ -3639,7 +3631,7 @@ long unsigned MyMoneyStorageSql::incrementInstitutionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiInstitutionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdInstitutions = returnValue; @@ -3655,7 +3647,7 @@ long unsigned MyMoneyStorageSql::incrementPayeeId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiPayeeId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdPayees = returnValue; @@ -3671,7 +3663,7 @@ long unsigned MyMoneyStorageSql::incrementReportId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiReportId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiReportId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdReports = returnValue; @@ -3687,7 +3679,7 @@ long unsigned MyMoneyStorageSql::incrementScheduleId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiScheduleId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSchedules = returnValue; @@ -3703,7 +3695,7 @@ long unsigned MyMoneyStorageSql::incrementSecurityId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiSecurityId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdSecurities = returnValue; @@ -3719,7 +3711,7 @@ long unsigned MyMoneyStorageSql::incrementTransactionId() { q.next(); long unsigned returnValue = (unsigned long) q.value(0).toULongLong(); ++returnValue; - q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + QString::number(returnValue)); + q.prepare("UPDATE kmmFileInfo SET hiTransactionId = " + TQString::number(returnValue)); q.exec(); endCommitUnit (__func__); m_hiIdTransactions = returnValue; @@ -3776,33 +3768,33 @@ void MyMoneyStorageSql::loadBudgetId(const unsigned long& id) //**************************************************** long unsigned MyMoneyStorageSql::calcHighId - (const long unsigned& i, const QString& id) { + (const long unsigned& i, const TQString& id) { DBG("*** Entering MyMoneyStorageSql::calcHighId"); - QString nid = id; - long unsigned high = (unsigned long) nid.replace(QRegExp("[A-Z]*"), "").toULongLong(); + TQString nid = id; + long unsigned high = (unsigned long) nid.tqreplace(TQRegExp("[A-Z]*"), "").toULongLong(); return std::max(high, i); } -void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const QString&)) { +void MyMoneyStorageSql::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageSql::signalProgress(int current, int total, const QString& msg) const { +void MyMoneyStorageSql::signalProgress(int current, int total, const TQString& msg) const { if (m_progressCallback != 0) (*m_progressCallback)(current, total, msg); } // **************************** Error display routine ******************************* -QString& MyMoneyStorageSql::buildError (const QSqlQuery& q, const QString& function, const QString& message) const { - QString s = QString("Error in function %1 : %2").arg(function).arg(message); - QSqlError e = lastError(); - s += QString ("\nDriver = %1, Host = %2, User = %3, Database = %4") - .arg(driverName()).arg(hostName()).arg(userName()).arg(databaseName()); - s += QString ("\nDriver Error: %1").arg(e.driverText()); - s += QString ("\nDatabase Error No %1: %2").arg(e.number()).arg(e.databaseText()); +TQString& MyMoneyStorageSql::buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const { + TQString s = TQString("Error in function %1 : %2").tqarg(function).tqarg(message); + TQSqlError e = lastError(); + s += TQString ("\nDriver = %1, Host = %2, User = %3, Database = %4") + .tqarg(driverName()).tqarg(hostName()).tqarg(userName()).tqarg(databaseName()); + s += TQString ("\nDriver Error: %1").tqarg(e.driverText()); + s += TQString ("\nDatabase Error No %1: %2").tqarg(e.number()).tqarg(e.databaseText()); e = q.lastError(); - s += QString ("\nExecuted: %1").arg(q.executedQuery()); - s += QString ("\nQuery error No %1: %2").arg(e.number()).arg(e.text()); + s += TQString ("\nExecuted: %1").tqarg(q.executedQuery()); + s += TQString ("\nQuery error No %1: %2").tqarg(e.number()).tqarg(e.text()); const_cast <MyMoneyStorageSql*> (this)->m_error = s; qDebug("%s", s.ascii()); @@ -3841,7 +3833,7 @@ MyMoneyDbDef::MyMoneyDbDef () { //#define ISKEY true void MyMoneyDbDef::FileInfo(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("version", "varchar(16)")); fields.append(new MyMoneyDbColumn("created", "date")); fields.append(new MyMoneyDbColumn("lastModified", "date")); @@ -3880,7 +3872,7 @@ void MyMoneyDbDef::FileInfo(void){ } void MyMoneyDbDef::Institutions(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("manager")); @@ -3895,7 +3887,7 @@ void MyMoneyDbDef::Institutions(void){ } void MyMoneyDbDef::Payees(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name")); fields.append(new MyMoneyDbTextColumn("reference")); @@ -3916,10 +3908,10 @@ void MyMoneyDbDef::Payees(void){ } void MyMoneyDbDef::Accounts(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("institutionId", "varchar(32)")); - fields.append(new MyMoneyDbColumn("parentId", "varchar(32)")); + fields.append(new MyMoneyDbColumn("tqparentId", "varchar(32)")); fields.append(new MyMoneyDbDatetimeColumn("lastReconciled")); fields.append(new MyMoneyDbDatetimeColumn("lastModified")); fields.append(new MyMoneyDbColumn("openingDate", "date")); @@ -3939,7 +3931,7 @@ void MyMoneyDbDef::Accounts(void){ } void MyMoneyDbDef::Transactions(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbDatetimeColumn("postDate")); @@ -3953,7 +3945,7 @@ void MyMoneyDbDef::Transactions(void){ } void MyMoneyDbDef::Splits(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("transactionId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("txType", "char(1)")); fields.append(new MyMoneyDbIntColumn("splitId", MyMoneyDbIntColumn::SMALL, UNSIGNED, PRIMARYKEY, NOTNULL)); @@ -3973,7 +3965,7 @@ void MyMoneyDbDef::Splits(void){ fields.append(new MyMoneyDbDatetimeColumn("postDate")); fields.append(new MyMoneyDbTextColumn("bankId")); MyMoneyDbTable t("kmmSplits", fields); - QStringList list; + TQStringList list; list << "accountId" << "txType"; t.addIndex("kmmSplitsaccount_type", list, false); t.buildSQLStrings(); @@ -3981,13 +3973,13 @@ void MyMoneyDbDef::Splits(void){ } void MyMoneyDbDef::KeyValuePairs(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("kvpType", "varchar(16)", false, NOTNULL)); fields.append(new MyMoneyDbColumn("kvpId", "varchar(32)")); fields.append(new MyMoneyDbColumn("kvpKey", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("kvpData")); MyMoneyDbTable t("kmmKeyValuePairs", fields); - QStringList list; + TQStringList list; list << "kvpType" << "kvpId"; t.addIndex("type_id", list, false); t.buildSQLStrings(); @@ -3995,7 +3987,7 @@ void MyMoneyDbDef::KeyValuePairs(void){ } void MyMoneyDbDef::Schedules(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::TINY, UNSIGNED, false, NOTNULL)); @@ -4022,7 +4014,7 @@ void MyMoneyDbDef::Schedules(void){ } void MyMoneyDbDef::SchedulePaymentHistory(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("schedId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("payDate", "date", PRIMARYKEY, NOTNULL)); MyMoneyDbTable t("kmmSchedulePaymentHistory", fields); @@ -4031,7 +4023,7 @@ void MyMoneyDbDef::SchedulePaymentHistory(void){ } void MyMoneyDbDef::Securities(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("symbol")); @@ -4046,7 +4038,7 @@ void MyMoneyDbDef::Securities(void){ } void MyMoneyDbDef::Prices(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("fromId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("toId", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("priceDate", "date", PRIMARYKEY, NOTNULL)); @@ -4059,7 +4051,7 @@ void MyMoneyDbDef::Prices(void){ } void MyMoneyDbDef::Currencies(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("ISOcode", "char(3)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbTextColumn("name", MyMoneyDbTextColumn::NORMAL, false, NOTNULL)); fields.append(new MyMoneyDbIntColumn("type", MyMoneyDbIntColumn::SMALL, UNSIGNED)); @@ -4077,7 +4069,7 @@ void MyMoneyDbDef::Currencies(void){ } void MyMoneyDbDef::Reports(void) { - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("name", "varchar(255)", false, NOTNULL)); fields.append(new MyMoneyDbTextColumn("XML", MyMoneyDbTextColumn::LONG)); fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); @@ -4087,7 +4079,7 @@ void MyMoneyDbDef::Reports(void) { } void MyMoneyDbDef::Budgets(void){ - QValueList<KSharedPtr <MyMoneyDbColumn> > fields; + TQValueList<KSharedPtr <MyMoneyDbColumn> > fields; fields.append(new MyMoneyDbColumn("id", "varchar(32)", PRIMARYKEY, NOTNULL)); fields.append(new MyMoneyDbColumn("name", "text", false, NOTNULL)); fields.append(new MyMoneyDbColumn("start", "date", false, NOTNULL)); @@ -4111,8 +4103,8 @@ void MyMoneyDbDef::Balances(void){ } // function to write create SQL to a stream -const QString MyMoneyDbDef::generateSQL (const QString& driver) const { - QString retval; +const TQString MyMoneyDbDef::generateSQL (const TQString& driver) const { + TQString retval; databaseTypeE dbType = m_drivers.driverToType(driver); table_iterator tt = tableBegin(); while (tt != tableEnd()) { @@ -4127,31 +4119,31 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { retval += '\n'; MyMoneyDbTable fi = m_tables["kmmFileInfo"]; - QString qs = fi.insertString(); + TQString qs = fi.insertString(); MyMoneyDbTable::field_iterator fit; for (fit = fi.begin(); fit != fi.end(); ++fit) { - QString toReplace = (*fit)->name(); + TQString toReplace = (*fit)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*fit)->name() == "version") - replace = QString::number(m_currentVersion); + tqreplace = TQString::number(m_currentVersion); if ((*fit)->name() == "fixLevel") - replace = QString::number + tqreplace = TQString::number (MyMoneyFile::instance()->storage()->currentFixVersion()); if ((*fit)->name() == "created") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "lastModified") - replace = QDate::currentDate().toString(Qt::ISODate); + tqreplace = TQDate::tqcurrentDate().toString(Qt::ISODate); if ((*fit)->name() == "updateInProgress") - replace = enclose("N"); - qs.replace(toReplace, replace); + tqreplace = enclose("N"); + qs.tqreplace(toReplace, tqreplace); } qs += "\n\n"; retval += qs; - qs = QString(); + qs = TQString(); unsigned int i; - QValueList<MyMoneyAccount> stdList; + TQValueList<MyMoneyAccount> stdList; stdList.append (MyMoneyFile::instance()->asset()); stdList.append (MyMoneyFile::instance()->equity()); stdList.append (MyMoneyFile::instance()->expense()); @@ -4164,23 +4156,23 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { MyMoneyDbTable::field_iterator act; // do the following in reverse so the 'formatted' fields are // correctly handled. - // Hmm, how does one use a QValueListIterator in reverse - // It'll be okay in Qt4 with QListIterator + // Hmm, how does one use a TQValueListIterator in reverse + // It'll be okay in TQt4 with TQListIterator for (act = ac.end(), --act; act != ac.begin(); --act) { - QString toReplace = (*act)->name(); + TQString toReplace = (*act)->name(); toReplace.prepend(':'); - QString replace = "NULL"; + TQString tqreplace = "NULL"; if ((*act)->name() == "accountType") - replace = QString::number(pac->accountType()); + tqreplace = TQString::number(pac->accountType()); if ((*act)->name() == "accountTypeString") - replace = enclose(pac->name()); + tqreplace = enclose(pac->name()); if ((*act)->name() == "isStockAccount") - replace = enclose("N"); + tqreplace = enclose("N"); if ((*act)->name() == "accountName") - replace = enclose(pac->name()); - qs.replace(toReplace, replace); + tqreplace = enclose(pac->name()); + qs.tqreplace(toReplace, tqreplace); } - qs.replace (":id", enclose(pac->id())); // a real kludge + qs.tqreplace (":id", enclose(pac->id())); // a real kludge qs += "\n\n"; retval += qs; } @@ -4189,19 +4181,19 @@ const QString MyMoneyDbDef::generateSQL (const QString& driver) const { //***************************************************************************** -void MyMoneyDbTable::addIndex(const QString& name, const QStringList& columns, bool unique) { +void MyMoneyDbTable::addIndex(const TQString& name, const TQStringList& columns, bool unique) { m_indices.push_back (MyMoneyDbIndex (m_name, name, columns, unique)); } void MyMoneyDbTable::buildSQLStrings (void) { // build fixed SQL strings for this table // build the insert string with placeholders for each field - QString qs = QString("INSERT INTO %1 (").arg(name()); - QString ws = ") VALUES ("; + TQString qs = TQString("INSERT INTO %1 (").tqarg(name()); + TQString ws = ") VALUES ("; field_iterator ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); - ws += QString(":%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); + ws += TQString(":%1, ").tqarg((*ft)->name()); ++ft; } qs = qs.left(qs.length() - 2); @@ -4213,14 +4205,14 @@ void MyMoneyDbTable::buildSQLStrings (void) { // build an update string; key fields go in the where clause qs = "UPDATE " + name() + " SET "; - ws = QString(); + ws = TQString(); ft = m_fields.begin(); while (ft != m_fields.end()) { if ((*ft)->isPrimaryKey()) { if (!ws.isEmpty()) ws += " AND "; - ws += QString("%1 = :%2").arg((*ft)->name()).arg((*ft)->name()); + ws += TQString("%1 = :%2").tqarg((*ft)->name()).tqarg((*ft)->name()); } else { - qs += QString("%1 = :%2, ").arg((*ft)->name()).arg((*ft)->name()); + qs += TQString("%1 = :%2, ").tqarg((*ft)->name()).tqarg((*ft)->name()); } ++ft; } @@ -4233,20 +4225,20 @@ void MyMoneyDbTable::buildSQLStrings (void) { m_deleteString = qs + ";"; } -const QString MyMoneyDbTable::columnList() const { +const TQString MyMoneyDbTable::columnList() const { field_iterator ft = m_fields.begin(); - QString qs; + TQString qs; ft = m_fields.begin(); while (ft != m_fields.end()) { - qs += QString("%1, ").arg((*ft)->name()); + qs += TQString("%1, ").tqarg((*ft)->name()); ++ft; } return (qs.left(qs.length() - 2)); } -const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { - QString qs = QString("CREATE TABLE %1 (").arg(name()); - QString pkey; +const TQString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { + TQString qs = TQString("CREATE TABLE %1 (").tqarg(name()); + TQString pkey; for (field_iterator it = m_fields.begin(); it != m_fields.end(); ++it) { qs += (*it)->generateDDL (dbType) + ", "; if ((*it)->isPrimaryKey ()) @@ -4271,7 +4263,7 @@ const QString MyMoneyDbTable::generateCreateSQL (databaseTypeE dbType) const { return qs; } -const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const +const TQString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const { if (dbType == Mysql || dbType == Oracle8) return "ALTER TABLE " + m_name + " DROP PRIMARY KEY;"; @@ -4283,8 +4275,8 @@ const QString MyMoneyDbTable::dropPrimaryKeyString(databaseTypeE dbType) const return ""; } -const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const { - QString qs = "ALTER TABLE " + m_name + " "; +const TQString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const { + TQString qs = "ALTER TABLE " + m_name + " "; if (dbType == Mysql) qs += "CHANGE " + columnName + " " + newDef.generateDDL(dbType); else if (dbType == Postgresql) @@ -4298,14 +4290,14 @@ const QString MyMoneyDbTable::modifyColumnString(databaseTypeE dbType, const QSt } //***************************************************************************** -const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = "CREATE "; + TQString qs = "CREATE "; if (m_unique) - qs += "UNIQUE "; + qs += "UNITQUE "; qs += "INDEX " + m_table + "_" + m_name + "_idx ON " + m_table + " ("; @@ -4315,7 +4307,7 @@ const QString MyMoneyDbIndex::generateDDL (databaseTypeE dbType) const // the result of an SQL function, but not a partial column. There should be // a way to merge these, and support other DBMSs like SQLite at the same time. // For now, if we just use plain columns, this will work fine. - for (QStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { + for (TQStringList::const_iterator it = m_columns.begin(); it != m_columns.end(); ++it) { qs += *it + ","; } @@ -4341,18 +4333,18 @@ MyMoneyDbDatetimeColumn* MyMoneyDbDatetimeColumn::clone () const MyMoneyDbTextColumn* MyMoneyDbTextColumn::clone () const { return (new MyMoneyDbTextColumn (*this)); } -const QString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbColumn::generateDDL (databaseTypeE dbType) const { Q_UNUSED(dbType); - QString qs = name() + " " + type(); + TQString qs = name() + " " + type(); if (isNotNull()) qs += " NOT NULL"; return qs; } -const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbIntColumn::TINY: @@ -4423,9 +4415,9 @@ const QString MyMoneyDbIntColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; switch (m_type) { case MyMoneyDbTextColumn::TINY: @@ -4496,9 +4488,9 @@ const QString MyMoneyDbTextColumn::generateDDL (databaseTypeE dbType) const return qs; } -const QString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const +const TQString MyMoneyDbDatetimeColumn::generateDDL (databaseTypeE dbType) const { - QString qs = name() + " "; + TQString qs = name() + " "; if (dbType == Mysql || dbType == ODBC3) { qs += "datetime "; } else if (dbType == Postgresql || dbType == Db2 || dbType == Oracle8 || dbType == Sqlite3 ) { diff --git a/kmymoney2/mymoney/storage/mymoneystoragesql.h b/kmymoney2/mymoney/storage/mymoneystoragesql.h index 1abe70b..4250256 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragesql.h +++ b/kmymoney2/mymoney/storage/mymoneystoragesql.h @@ -13,12 +13,12 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qsqldatabase.h> -#include <qsqlquery.h> -#include <qsqlerror.h> -#include <qvaluestack.h> +#include <tqsqldatabase.h> +#include <tqsqlquery.h> +#include <tqsqlerror.h> +#include <tqvaluestack.h> -class QIODevice; +class TQIODevice; // ---------------------------------------------------------------------------- // KDE Includes @@ -56,7 +56,7 @@ class FilterFail { m_storage (storage) {} - inline bool operator() (const QPair<QString, MyMoneyTransaction>& transactionPair) + inline bool operator() (const TQPair<TQString, MyMoneyTransaction>& transactionPair) { return (*this) (transactionPair.second); } inline bool operator() (const MyMoneyTransaction& transaction) @@ -87,16 +87,16 @@ typedef enum databaseTypeE { // database (driver) type class MyMoneyStorageSql; /** - * The MyMoneySqlQuery class is derived from QSqlQuery to provide + * The MyMoneySqlQuery class is derived from TQSqlQuery to provide * a way to adjust some queries based on databaseTypeE and make * debugging easier by providing a place to put debug statements. */ -class MyMoneySqlQuery : public QSqlQuery { +class MyMoneySqlQuery : public TQSqlQuery { public: MyMoneySqlQuery (MyMoneyStorageSql* db = 0); virtual ~MyMoneySqlQuery() {} bool exec (); - bool prepare ( const QString & query ); + bool prepare ( const TQString & query ); private: const MyMoneyStorageSql* m_db; }; @@ -108,13 +108,13 @@ class MyMoneyDbDrivers { public: MyMoneyDbDrivers (); /** - * @return a list ofsupported Qt database driver types, their qt names and useful names + * @return a list ofsupported TQt database driver types, their qt names and useful names **/ - const QMap<QString, QString> driverMap() const {return (m_driverMap);}; - databaseTypeE driverToType (const QString& driver) const; + const TQMap<TQString, TQString> driverMap() const {return (m_driverMap);}; + databaseTypeE driverToType (const TQString& driver) const; bool isTested (databaseTypeE dbType) const; private: - QMap<QString, QString> m_driverMap; + TQMap<TQString, TQString> m_driverMap; }; /** @@ -123,11 +123,11 @@ class MyMoneyDbDrivers { */ class MyMoneyDbColumn : public KShared { public: - MyMoneyDbColumn (const QString& iname, - const QString& itype = QString::null, + MyMoneyDbColumn (const TQString& iname, + const TQString& itype = TQString(), const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): m_name(iname), m_type(itype), m_isPrimary(iprimary), @@ -147,20 +147,20 @@ class MyMoneyDbColumn : public KShared { * * @param dbType Database driver type * - * @return QString of the DDL for the column, tailored for what the driver supports. + * @return TQString of the DDL for the column, tailored for what the driver supports. */ - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; - const QString& name(void) const {return (m_name);} - const QString& type(void) const {return (m_type);} + const TQString& name(void) const {return (m_name);} + const TQString& type(void) const {return (m_type);} bool isPrimaryKey(void) const {return (m_isPrimary);} bool isNotNull(void) const {return (m_isNotNull);} private: - QString m_name; - QString m_type; + TQString m_name; + TQString m_type; bool m_isPrimary; bool m_isNotNull; - QString m_initVersion; + TQString m_initVersion; }; /** @@ -168,17 +168,17 @@ class MyMoneyDbColumn : public KShared { */ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { public: - MyMoneyDbDatetimeColumn (const QString& iname, + MyMoneyDbDatetimeColumn (const TQString& iname, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion) {} virtual ~MyMoneyDbDatetimeColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbDatetimeColumn* clone () const; private: - static const QString calcType(void); + static const TQString calcType(void); }; /** @@ -187,17 +187,17 @@ class MyMoneyDbDatetimeColumn : public MyMoneyDbColumn { class MyMoneyDbIntColumn : public MyMoneyDbColumn { public: enum size {TINY, SMALL, MEDIUM, BIG}; - MyMoneyDbIntColumn (const QString& iname, + MyMoneyDbIntColumn (const TQString& iname, const size type = MEDIUM, const bool isigned = true, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type), m_isSigned (isigned) {} virtual ~MyMoneyDbIntColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbIntColumn* clone () const; private: size m_type; @@ -212,15 +212,15 @@ class MyMoneyDbIntColumn : public MyMoneyDbColumn { class MyMoneyDbTextColumn : public MyMoneyDbColumn { public: enum size {TINY, NORMAL, MEDIUM, LONG}; - MyMoneyDbTextColumn (const QString& iname, + MyMoneyDbTextColumn (const TQString& iname, const size type = MEDIUM, const bool iprimary = false, const bool inotnull = false, - const QString &initVersion = "0.1"): + const TQString &initVersion = "0.1"): MyMoneyDbColumn (iname, "", iprimary, inotnull, initVersion), m_type (type) {} virtual ~MyMoneyDbTextColumn() {} - virtual const QString generateDDL (databaseTypeE dbType) const; + virtual const TQString generateDDL (databaseTypeE dbType) const; virtual MyMoneyDbTextColumn* clone () const; private: size m_type; @@ -237,9 +237,9 @@ class MyMoneyDbTextColumn : public MyMoneyDbColumn { */ class MyMoneyDbIndex { public: - MyMoneyDbIndex (const QString& table, - const QString& name, - const QStringList& columns, + MyMoneyDbIndex (const TQString& table, + const TQString& name, + const TQStringList& columns, bool unique = false): m_table(table), m_unique(unique), @@ -247,16 +247,16 @@ class MyMoneyDbIndex { m_columns(columns) {} MyMoneyDbIndex () {} - inline const QString table () const {return m_table;} + inline const TQString table () const {return m_table;} inline bool isUnique () const {return m_unique;} - inline const QString name () const {return m_name;} - inline const QStringList columns () const {return m_columns;} - const QString generateDDL (databaseTypeE dbType) const; + inline const TQString name () const {return m_name;} + inline const TQStringList columns () const {return m_columns;} + const TQString generateDDL (databaseTypeE dbType) const; private: - QString m_table; + TQString m_table; bool m_unique; - QString m_name; - QStringList m_columns; + TQString m_name; + TQStringList m_columns; }; /** @@ -270,20 +270,20 @@ class MyMoneyDbIndex { */ class MyMoneyDbTable { public: - MyMoneyDbTable (const QString& iname, - const QValueList<KSharedPtr <MyMoneyDbColumn> >& ifields, - const QString& initVersion = "1.0"): + MyMoneyDbTable (const TQString& iname, + const TQValueList<KSharedPtr <MyMoneyDbColumn> >& ifields, + const TQString& initVersion = "1.0"): m_name(iname), m_fields(ifields), m_initVersion(initVersion) {} MyMoneyDbTable (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString& insertString(void) const {return (m_insertString);}; - inline const QString selectAllString(bool terminate = true) const - {return (terminate ? QString(m_selectAllString + ";") : m_selectAllString);}; - inline const QString& updateString(void) const {return (m_updateString);}; - inline const QString& deleteString(void) const {return (m_deleteString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString& insertString(void) const {return (m_insertString);}; + inline const TQString selectAllString(bool terminate = true) const + {return (terminate ? TQString(m_selectAllString + ";") : m_selectAllString);}; + inline const TQString& updateString(void) const {return (m_updateString);}; + inline const TQString& deleteString(void) const {return (m_deleteString);}; /** * This method determines the string required to drop the primary key for the table @@ -291,15 +291,15 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString for the syntax to drop the primary key. + * @return TQString for the syntax to drop the primary key. */ - const QString dropPrimaryKeyString(databaseTypeE dbType) const; + const TQString dropPrimaryKeyString(databaseTypeE dbType) const; /** * This method returns a comma-separated list of all column names in the table * - * @return QString column list. + * @return TQString column list. */ - const QString columnList() const; + const TQString columnList() const; /** * This method returns the string for changing a column's definition. It covers statements * like ALTER TABLE..CHANGE COLUMN, MODIFY COLUMN, etc. @@ -308,9 +308,9 @@ class MyMoneyDbTable { * @param columnName The name of the column to be modified. * @param newDef The MyMoneyColumn object of the new column definition. * - * @return QString containing DDL to change the column. + * @return TQString containing DDL to change the column. */ - const QString modifyColumnString(databaseTypeE dbType, const QString& columnName, const MyMoneyDbColumn& newDef) const; + const TQString modifyColumnString(databaseTypeE dbType, const TQString& columnName, const MyMoneyDbColumn& newDef) const; /** * This method builds all of the SQL strings for common operations. @@ -322,9 +322,9 @@ class MyMoneyDbTable { * * @param dbType The driver type of the database. * - * @return QString of the DDL. + * @return TQString of the DDL. */ - const QString generateCreateSQL (databaseTypeE dbType) const; + const TQString generateCreateSQL (databaseTypeE dbType) const; /** * This method creates a MyMoneyDbIndex object and adds it to the list of indices for the table. @@ -333,22 +333,22 @@ class MyMoneyDbTable { * @param columns The list of the columns affected. * @param unique Whether or not this should be a unique index. */ - void addIndex(const QString& name, const QStringList& columns, bool unique = false); + void addIndex(const TQString& name, const TQStringList& columns, bool unique = false); - typedef QValueList<KSharedPtr <MyMoneyDbColumn> >::const_iterator field_iterator; + typedef TQValueList<KSharedPtr <MyMoneyDbColumn> >::const_iterator field_iterator; inline field_iterator begin(void) const {return m_fields.constBegin();} inline field_iterator end(void) const {return m_fields.constEnd(); } private: - QString m_name; - QValueList<KSharedPtr <MyMoneyDbColumn> > m_fields; - - typedef QValueList<MyMoneyDbIndex>::const_iterator index_iterator; - QValueList<MyMoneyDbIndex> m_indices; - QString m_initVersion; - QString m_insertString; // string to insert a record - QString m_selectAllString; // to select all fields - QString m_updateString; // normal string for record update - QString m_deleteString; // string to delete 1 record + TQString m_name; + TQValueList<KSharedPtr <MyMoneyDbColumn> > m_fields; + + typedef TQValueList<MyMoneyDbIndex>::const_iterator index_iterator; + TQValueList<MyMoneyDbIndex> m_indices; + TQString m_initVersion; + TQString m_insertString; // string to insert a record + TQString m_selectAllString; // to select all fields + TQString m_updateString; // normal string for record update + TQString m_deleteString; // string to delete 1 record }; /** @@ -360,21 +360,21 @@ class MyMoneyDbTable { */ class MyMoneyDbView { public: - MyMoneyDbView (const QString& name, - const QString& createString, - const QString& initVersion = "0.1") + MyMoneyDbView (const TQString& name, + const TQString& createString, + const TQString& initVersion = "0.1") : m_name (name), m_createString (createString), m_initVersion (initVersion) {} MyMoneyDbView (void) {} - inline const QString& name(void) const {return (m_name);} - inline const QString createString(void) const {return (m_createString);}; + inline const TQString& name(void) const {return (m_name);} + inline const TQString createString(void) const {return (m_createString);}; private: - QString m_name; - QString m_createString; - QString m_initVersion; + TQString m_name; + TQString m_createString; + TQString m_initVersion; }; /** @@ -387,22 +387,22 @@ public: MyMoneyDbDef(); ~MyMoneyDbDef() {} - const QString generateSQL (const QString& driver) const; + const TQString generateSQL (const TQString& driver) const; - typedef QMap<QString, MyMoneyDbTable>::const_iterator table_iterator; + typedef TQMap<TQString, MyMoneyDbTable>::const_iterator table_iterator; inline table_iterator tableBegin(void) const {return m_tables.constBegin();} inline table_iterator tableEnd(void) const {return m_tables.constEnd();} - typedef QMap<QString, MyMoneyDbView>::const_iterator view_iterator; + typedef TQMap<TQString, MyMoneyDbView>::const_iterator view_iterator; inline view_iterator viewBegin(void) const {return m_views.constBegin();} inline view_iterator viewEnd(void) const {return m_views.constEnd();} inline unsigned int currentVersion() const {return (m_currentVersion);}; private: - const QString enclose(const QString& text) const - {return (QString("'" + text + "'"));}; - static unsigned int m_currentVersion; // The current version of the database layout + const TQString enclose(const TQString& text) const + {return (TQString("'" + text + "'"));}; + static unsigned int m_currentVersion; // The current version of the database tqlayout MyMoneyDbDrivers m_drivers; #define TABLE(name) void name(); #define VIEW(name) void name(); @@ -422,8 +422,8 @@ private: TABLE(Budgets); VIEW(Balances); protected: - QMap<QString, MyMoneyDbTable> m_tables; - QMap<QString, MyMoneyDbView> m_views; + TQMap<TQString, MyMoneyDbTable> m_tables; + TQMap<TQString, MyMoneyDbView> m_views; }; class IMyMoneySerialize; @@ -432,7 +432,7 @@ class IMyMoneySerialize; * The MyMoneyDbColumn class is a base type for generic db columns. * Derived types exist for several common column types. */ -class MyMoneyStorageSql : public IMyMoneyStorageFormat, public QSqlDatabase, public KShared { +class MyMoneyStorageSql : public IMyMoneyStorageFormat, public TQSqlDatabase, public KShared { public: MyMoneyStorageSql (IMyMoneySerialize *storage, const KURL& = KURL()); @@ -444,7 +444,7 @@ public: * MyMoneyStorageSql - open database file * * @param url pseudo-URL of database to be opened - * @param openMode open mode, same as for QFile::open + * @param openMode open mode, same as for TQFile::open * @param clear whether existing data can be deleted * @return 0 - database successfully opened @@ -491,7 +491,7 @@ public: * @return : error message to be displayed * */ - const QString& lastError() const {return (m_error);}; + const TQString& lastError() const {return (m_error);}; /** * This method is used when a database file is open, and the data is to * be saved in a different file or format. It will ensure that all data @@ -533,40 +533,40 @@ public: void modifyBudget(const MyMoneyBudget& bud); void removeBudget(const MyMoneyBudget& bud); - unsigned long transactionCount (const QString& aid = QString()) const; - inline const QMap<QString, unsigned long> transactionCountMap () const + unsigned long transactionCount (const TQString& aid = TQString()) const; + inline const TQMap<TQString, unsigned long> transactionCountMap () const {return (m_transactionCountMap);}; /** * the storage manager also needs the following read entry points */ - const QMap<QString, MyMoneyAccount> fetchAccounts (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneyMoney> fetchBalance(const QStringList& id, const QDate& date) const; - const QMap<QString, MyMoneyBudget> fetchBudgets (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneySecurity> fetchCurrencies (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneyInstitution> fetchInstitutions (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneyPayee> fetchPayees (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const MyMoneyPriceList fetchPrices (const QStringList& fromIdList = QStringList (), const QStringList& toIdList = QStringList(), bool forUpdate = false) const; - const MyMoneyPrice fetchSinglePrice (const QString& fromIdList, const QString& toIdList, const QDate& date, bool exactDate, bool forUpdate = false) const; - const QMap<QString, MyMoneyReport> fetchReports (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneySchedule> fetchSchedules (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneySecurity> fetchSecurities (const QStringList& idList = QStringList (), bool forUpdate = false) const; - const QMap<QString, MyMoneyTransaction> fetchTransactions (const QString& tidList = QString (), const QString& dateClause = QString(), bool forUpdate = false) const; - const QMap<QString, MyMoneyTransaction> fetchTransactions (const MyMoneyTransactionFilter& filter) const; - bool isReferencedByTransaction(const QString& id) const; - - void readPayees(const QString&); - void readPayees(const QValueList<QString> payeeList = QValueList<QString>()); + const TQMap<TQString, MyMoneyAccount> fetchAccounts (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneyMoney> fetchBalance(const TQStringList& id, const TQDate& date) const; + const TQMap<TQString, MyMoneyBudget> fetchBudgets (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneySecurity> fetchCurrencies (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneyInstitution> fetchInstitutions (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneyPayee> fetchPayees (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const MyMoneyPriceList fetchPrices (const TQStringList& fromIdList = TQStringList (), const TQStringList& toIdList = TQStringList(), bool forUpdate = false) const; + const MyMoneyPrice fetchSinglePrice (const TQString& fromIdList, const TQString& toIdList, const TQDate& date, bool exactDate, bool forUpdate = false) const; + const TQMap<TQString, MyMoneyReport> fetchReports (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneySchedule> fetchSchedules (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneySecurity> fetchSecurities (const TQStringList& idList = TQStringList (), bool forUpdate = false) const; + const TQMap<TQString, MyMoneyTransaction> fetchTransactions (const TQString& tidList = TQString (), const TQString& dateClause = TQString(), bool forUpdate = false) const; + const TQMap<TQString, MyMoneyTransaction> fetchTransactions (const MyMoneyTransactionFilter& filter) const; + bool isReferencedByTransaction(const TQString& id) const; + + void readPayees(const TQString&); + void readPayees(const TQValueList<TQString> payeeList = TQValueList<TQString>()); void readTransactions(const MyMoneyTransactionFilter& filter); - void setProgressCallback(void(*callback)(int, int, const QString&)); + void setProgressCallback(void(*callback)(int, int, const TQString&)); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage) { Q_UNUSED(s); Q_UNUSED(storage) }; + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage){ Q_UNUSED(s); Q_UNUSED(storage) }; - void startCommitUnit (const QString& callingFunction); - bool endCommitUnit (const QString& callingFunction); - void cancelCommitUnit (const QString& callingFunction); + void startCommitUnit (const TQString& callingFunction); + bool endCommitUnit (const TQString& callingFunction); + void cancelCommitUnit (const TQString& callingFunction); - long unsigned getRecCount(const QString& table) const; + long unsigned getRecCount(const TQString& table) const; long unsigned getNextBudgetId() const; long unsigned getNextAccountId() const; long unsigned getNextInstitutionId() const; @@ -596,7 +596,7 @@ public: private: // a function to build a comprehensive error message - QString& buildError (const QSqlQuery& q, const QString& function, const QString& message) const; + TQString& buildError (const TQSqlQuery& q, const TQString& function, const TQString& message) const; // write routines void writeUserInformation(void); void writeInstitutions(void); @@ -614,9 +614,9 @@ private: void writeInstitution(const MyMoneyInstitution& i, MyMoneySqlQuery& q); void writePayee(const MyMoneyPayee& p, MyMoneySqlQuery& q, bool isUserInfo = false); void writeAccount (const MyMoneyAccount& a, MyMoneySqlQuery& q); - void writeTransaction(const QString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const QString& type); - void writeSplits(const QString& txId, const QString& type, const QValueList<MyMoneySplit>& splitList); - void writeSplit(const QString& txId, const MyMoneySplit& split, const QString& type, const int splitId, MyMoneySqlQuery& q); + void writeTransaction(const TQString& txId, const MyMoneyTransaction& tx, MyMoneySqlQuery& q, const TQString& type); + void writeSplits(const TQString& txId, const TQString& type, const TQValueList<MyMoneySplit>& splitList); + void writeSplit(const TQString& txId, const MyMoneySplit& split, const TQString& type, const int splitId, MyMoneySqlQuery& q); void writeSchedule(const MyMoneySchedule& sch, MyMoneySqlQuery& q, bool insert); void writeSecurity(const MyMoneySecurity& security, MyMoneySqlQuery& q); void writePricePair ( const MyMoneyPriceEntries& p); @@ -624,21 +624,21 @@ private: void writeCurrency(const MyMoneySecurity& currency, MyMoneySqlQuery& q); void writeReport (const MyMoneyReport& rep, MyMoneySqlQuery& q); void writeBudget (const MyMoneyBudget& bud, MyMoneySqlQuery& q); - void writeKeyValuePairs(const QString& kvpType, const QString& kvpId, const QMap<QString, QString>& pairs); - void writeKeyValuePair(const QString& kvpType, const QString& kvpId, - const QString& kvpKey, const QString& kvpData); + void writeKeyValuePairs(const TQString& kvpType, const TQString& kvpId, const TQMap<TQString, TQString>& pairs); + void writeKeyValuePair(const TQString& kvpType, const TQString& kvpId, + const TQString& kvpKey, const TQString& kvpData); // read routines void readFileInfo(void); void readLogonData(void); void readUserInformation(void); void readInstitutions(void); void readAccounts(void); - void readTransaction(const QString id); - void readTransactions(const QString& tidList = QString(), const QString& dateClause = QString()); - void readTransaction(MyMoneyTransaction &tx, const QString& tid); + void readTransaction(const TQString id); + void readTransactions(const TQString& tidList = TQString(), const TQString& dateClause = TQString()); + void readTransaction(MyMoneyTransaction &tx, const TQString& tid); void readSplit (MyMoneySplit& s, const MyMoneySqlQuery& q, const MyMoneyDbTable& t) const; - const MyMoneyKeyValueContainer readKeyValuePairs (const QString& kvpType, const QString& kvpId) const; - const QMap<QString, MyMoneyKeyValueContainer> readKeyValuePairs (const QString& kvpType, const QStringList& kvpIdList) const; + const MyMoneyKeyValueContainer readKeyValuePairs (const TQString& kvpType, const TQString& kvpId) const; + const TQMap<TQString, MyMoneyKeyValueContainer> readKeyValuePairs (const TQString& kvpType, const TQStringList& kvpIdList) const; void readSchedules(void); void readSecurities(void); void readPrices(void); @@ -646,27 +646,27 @@ private: void readReports(void); void readBudgets(void); - void deleteTransaction(const QString& id); - void deleteSchedule(const QString& id); - void deleteKeyValuePairs(const QString& kvpType, const QString& kvpId); - long unsigned calcHighId (const long unsigned&, const QString&); + void deleteTransaction(const TQString& id); + void deleteSchedule(const TQString& id); + void deleteKeyValuePairs(const TQString& kvpType, const TQString& kvpId); + long unsigned calcHighId (const long unsigned&, const TQString&); - void setVersion (const QString& version); + void setVersion (const TQString& version); - void signalProgress(int current, int total, const QString& = "") const; - void (*m_progressCallback)(int, int, const QString&); + void signalProgress(int current, int total, const TQString& = "") const; + void (*m_progressCallback)(int, int, const TQString&); - //void startCommitUnit (const QString& callingFunction); - //void endCommitUnit (const QString& callingFunction); - //void cancelCommitUnit (const QString& callingFunction); + //void startCommitUnit (const TQString& callingFunction); + //void endCommitUnit (const TQString& callingFunction); + //void cancelCommitUnit (const TQString& callingFunction); int splitState(const MyMoneyTransactionFilter::stateOptionE& state) const; - inline const QDate getDate (const QString& date) const { - return (date.isNull() ? QDate() : QDate::fromString(date, Qt::ISODate)); + inline const TQDate getDate (const TQString& date) const { + return (date.isNull() ? TQDate() : TQDate::fromString(date, Qt::ISODate)); } - inline const QDateTime getDateTime (const QString& date) const { - return (date.isNull() ? QDateTime() : QDateTime::fromString(date, Qt::ISODate)); + inline const TQDateTime getDateTime (const TQString& date) const { + return (date.isNull() ? TQDateTime() : TQDateTime::fromString(date, Qt::ISODate)); } // open routines @@ -690,16 +690,16 @@ private: bool sqliteAlterTable(const MyMoneyDbTable& t); bool addColumn(const MyMoneyDbTable& t, const MyMoneyDbColumn& c, - const QString& after = QString()); - bool addColumn(const QString& table, - const QString& column, - const QString& after = QString()); + const TQString& after = TQString()); + bool addColumn(const TQString& table, + const TQString& column, + const TQString& after = TQString()); bool dropColumn(const MyMoneyDbTable& t, - const QString& c); - bool dropColumn(const QString& table, - const QString& column); + const TQString& c); + bool dropColumn(const TQString& table, + const TQString& column); -// long long unsigned getRecCount(const QString& table); +// long long unsigned getRecCount(const TQString& table); int createTables(); void createTable(const MyMoneyDbTable& t); void clean (); @@ -716,7 +716,7 @@ private: bool m_loadAll; // preload all data bool m_override; // override open if already in use // error message - QString m_error; + TQString m_error; // record counts long unsigned m_institutions; long unsigned m_accounts; @@ -740,14 +740,14 @@ private: long unsigned m_hiIdReports; long unsigned m_hiIdBudgets; // encrypt option - usage TBD - QString m_encryptData; + TQString m_encryptData; /** * This variable is used to suppress status messages except during * initial data load and final write */ - bool m_displayStatus; + bool m_displaytqStatus; /** * On occasions, e.g. after a complex transaction search, or for populating a * payee popup list, it becomes necessary to load all data into memory. The @@ -760,19 +760,19 @@ private: * This member variable holds a list of those accounts for which all * transactions are in memory, thus saving reading them again */ -// QValueList<QString> m_accountsLoaded; +// TQValueList<TQString> m_accountsLoaded; /** * This member variable is used when loading transactions to list all * referenced payees, which can then be read into memory (if not already there) */ -// QValueList<QString> m_payeeList; +// TQValueList<TQString> m_payeeList; - void alert(QString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... + void alert(TQString s) const {qDebug("%s", s.ascii());}; // FIXME: remove... /** The following keeps track of commitment units (known as transactions in SQL * though it would be confusing to use that term within KMM). It is implemented * as a stack for debug purposes. Long term, probably a count would suffice */ - QValueStack<QString> m_commitUnitStack; + TQValueStack<TQString> m_commitUnitStack; /** * This member variable is used to preload transactions for preferred accounts */ @@ -790,13 +790,13 @@ private: * probably be moved into the MyMoneyAccount object; maybe we will do that once * the database code has been properly checked out */ - QMap<QString, unsigned long> m_transactionCountMap; + TQMap<TQString, unsigned long> m_transactionCountMap; /** * These member variables hold the user name and date/time of logon */ - QString m_logonUser; - QDateTime m_logonAt; - QDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object + TQString m_logonUser; + TQDateTime m_logonAt; + TQDateTime m_txPostDate; // FIXME: remove when Tom puts date into split object //Disable copying MyMoneyStorageSql (const MyMoneyStorageSql& rhs); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp index e8027d1..49e0739 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.cpp +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.cpp @@ -22,10 +22,10 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qfile.h> -#include <qdom.h> -#include <qmap.h> -#include <qxml.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqmap.h> +#include <tqxml.h> // ---------------------------------------------------------------------------- // KDE Includes @@ -52,49 +52,49 @@ class MyMoneyStorageXML::Private public: Private() {} - QMap<QString, MyMoneyInstitution> iList; - QMap<QString, MyMoneyAccount> aList; - QMap<QString, MyMoneyTransaction> tList; - QMap<QString, MyMoneyPayee> pList; - QMap<QString, MyMoneySchedule> sList; - QMap<QString, MyMoneySecurity> secList; - QMap<QString, MyMoneyReport> rList; - QMap<QString, MyMoneyBudget> bList; - QMap<MyMoneySecurityPair, MyMoneyPriceEntries> prList; + TQMap<TQString, MyMoneyInstitution> iList; + TQMap<TQString, MyMoneyAccount> aList; + TQMap<TQString, MyMoneyTransaction> tList; + TQMap<TQString, MyMoneyPayee> pList; + TQMap<TQString, MyMoneySchedule> sList; + TQMap<TQString, MyMoneySecurity> secList; + TQMap<TQString, MyMoneyReport> rList; + TQMap<TQString, MyMoneyBudget> bList; + TQMap<MyMoneySecurityPair, MyMoneyPriceEntries> prList; - QString m_fromSecurity; - QString m_toSecurity; + TQString m_fromSecurity; + TQString m_toSecurity; }; -class MyMoneyXmlContentHandler : public QXmlContentHandler +class MyMoneyXmlContentHandler : public TQXmlContentHandler { public: MyMoneyXmlContentHandler(MyMoneyStorageXML* reader); virtual ~MyMoneyXmlContentHandler() {} - virtual void setDocumentLocator (QXmlLocator * locator) { m_loc = locator; } + virtual void setDocumentLocator (TQXmlLocator * locator) { m_loc = locator; } virtual bool startDocument (void); virtual bool endDocument (void); - virtual bool startPrefixMapping(const QString & prefix, const QString & uri); - virtual bool endPrefixMapping(const QString & prefix); - virtual bool startElement(const QString & namespaceURI, const QString & localName, const QString & qName, const QXmlAttributes & atts); - virtual bool endElement(const QString & namespaceURI, const QString & localName, const QString & qName); - virtual bool characters(const QString & ch); - virtual bool ignorableWhitespace(const QString & ch); - virtual bool processingInstruction(const QString & target, const QString & data); - virtual bool skippedEntity(const QString & name); - virtual QString errorString(void); + virtual bool startPrefixMapping(const TQString & prefix, const TQString & uri); + virtual bool endPrefixMapping(const TQString & prefix); + virtual bool startElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName, const TQXmlAttributes & atts); + virtual bool endElement(const TQString & namespaceURI, const TQString & localName, const TQString & qName); + virtual bool characters(const TQString & ch); + virtual bool ignorableWhitespace(const TQString & ch); + virtual bool processingInstruction(const TQString & target, const TQString & data); + virtual bool skippedEntity(const TQString & name); + virtual TQString errorString(void); private: MyMoneyStorageXML* m_reader; - QXmlLocator* m_loc; + TQXmlLocator* m_loc; int m_level; int m_elementCount; - QDomDocument m_doc; - QDomElement m_baseNode; - QDomElement m_currNode; - QString m_errMsg; + TQDomDocument m_doc; + TQDomElement m_baseNode; + TQDomElement m_currNode; + TQString m_errMsg; }; MyMoneyXmlContentHandler::MyMoneyXmlContentHandler(MyMoneyStorageXML* reader) : @@ -117,28 +117,28 @@ bool MyMoneyXmlContentHandler::endDocument(void) return true; } -bool MyMoneyXmlContentHandler::skippedEntity (const QString & /* name */) +bool MyMoneyXmlContentHandler::skippedEntity (const TQString & /* name */) { - // qDebug(QString("Skipped entity '%1'").arg(name)); + // qDebug(TQString("Skipped entity '%1'").tqarg(name)); return true; } -bool MyMoneyXmlContentHandler::startPrefixMapping (const QString& /*prefix */, const QString & /* uri */) +bool MyMoneyXmlContentHandler::startPrefixMapping (const TQString& /*prefix */, const TQString & /* uri */) { - // qDebug(QString("start prefix '%1', '%2'").arg(prefix).arg(uri)); + // qDebug(TQString("start prefix '%1', '%2'").tqarg(prefix).tqarg(uri)); return true; } -bool MyMoneyXmlContentHandler::endPrefixMapping (const QString& /* prefix */) +bool MyMoneyXmlContentHandler::endPrefixMapping (const TQString& /* prefix */) { - // qDebug(QString("end prefix '%1'").arg(prefix)); + // qDebug(TQString("end prefix '%1'").tqarg(prefix)); return true; } -bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName, const QXmlAttributes & atts) +bool MyMoneyXmlContentHandler::startElement (const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName, const TQXmlAttributes & atts) { if(m_level == 0) { - QString s = qName.lower(); + TQString s = qName.lower(); if(s == "transaction" || s == "account" || s == "price" @@ -162,28 +162,28 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, } else if(s == "transactions") { qDebug("reading transactions"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading transactions...")); m_elementCount = 0; } } else if(s == "accounts") { qDebug("reading accounts"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading accounts...")); m_elementCount = 0; } } else if(s == "securities") { qDebug("reading securities"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading securities...")); m_elementCount = 0; } } else if(s == "reports") { qDebug("reading reports"); if(atts.count()) { - int count = atts.value(QString("count")).toUInt(); + int count = atts.value(TQString("count")).toUInt(); m_reader->signalProgress(0, count, i18n("Loading reports...")); m_elementCount = 0; } @@ -192,14 +192,14 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, m_elementCount = 0; } else if(s == "pricepair") { if(atts.count()) { - m_reader->d->m_fromSecurity = atts.value(QString("from")); - m_reader->d->m_toSecurity = atts.value(QString("to")); + m_reader->d->m_fromSecurity = atts.value(TQString("from")); + m_reader->d->m_toSecurity = atts.value(TQString("to")); } } } else { m_level++; - QDomElement node = m_doc.createElement(qName); + TQDomElement node = m_doc.createElement(qName); for(int i=0; i < atts.count(); ++i) { node.setAttribute(atts.qName(i), atts.value(i)); } @@ -209,12 +209,12 @@ bool MyMoneyXmlContentHandler::startElement (const QString& /* namespaceURI */, return true; } -bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, const QString& /* localName */, const QString& qName) +bool MyMoneyXmlContentHandler::endElement(const TQString& /* namespaceURI */, const TQString& /* localName */, const TQString& qName) { bool rc = true; - QString s = qName.lower(); + TQString s = qName.lower(); if(m_level) { - m_currNode = m_currNode.parentNode().toElement(); + m_currNode = m_currNode.tqparentNode().toElement(); m_level--; if(!m_level) { try { @@ -265,18 +265,18 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con MyMoneyPrice p(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity, m_baseNode); m_reader->d->prList[MyMoneySecurityPair(m_reader->d->m_fromSecurity, m_reader->d->m_toSecurity)][p.date()] = p; } else { - m_errMsg = i18n("Unknown XML tag %1 found in line %2").arg(qName).arg(m_loc->lineNumber()); + m_errMsg = i18n("Unknown XML tag %1 found in line %2").tqarg(qName).tqarg(m_loc->lineNumber()); kdWarning() << m_errMsg << endl; rc = false; } m_reader->signalProgress(++m_elementCount, 0); } catch(MyMoneyException* e) { - m_errMsg = i18n("Exception while creating a %1 element: %2").arg(s).arg(e->what()); + m_errMsg = i18n("Exception while creating a %1 element: %2").tqarg(s).tqarg(e->what()); kdWarning() << m_errMsg << endl; delete e; rc = false; } - m_doc = QDomDocument(); + m_doc = TQDomDocument(); } } else { if(s == "institutions") { @@ -334,22 +334,22 @@ bool MyMoneyXmlContentHandler::endElement(const QString& /* namespaceURI */, con return rc; } -bool MyMoneyXmlContentHandler::characters(const QString& /* ch */) +bool MyMoneyXmlContentHandler::characters(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::ignorableWhitespace(const QString& /* ch */) +bool MyMoneyXmlContentHandler::ignorableWhitespace(const TQString& /* ch */) { return true; } -bool MyMoneyXmlContentHandler::processingInstruction(const QString& /* target */, const QString& /* data */) +bool MyMoneyXmlContentHandler::processingInstruction(const TQString& /* target */, const TQString& /* data */) { return true; } -QString MyMoneyXmlContentHandler::errorString(void) +TQString MyMoneyXmlContentHandler::errorString(void) { return m_errMsg; } @@ -373,7 +373,7 @@ MyMoneyStorageXML::~MyMoneyStorageXML() } // Function to read in the file, send to XML parser. -void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) +void MyMoneyStorageXML::readFile(TQIODevice* pDevice, IMyMoneySerialize* storage) { Q_CHECK_PTR(storage); Q_CHECK_PTR(pDevice); @@ -382,20 +382,20 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) m_storage = storage; - m_doc = new QDomDocument; + m_doc = new TQDomDocument; Q_CHECK_PTR(m_doc); qDebug("reading file"); - // creating the QXmlInputSource object based on a QIODevice object + // creating the TQXmlInputSource object based on a TQIODevice object // reads all data of the underlying object into memory. I have not // found an object that reads on the fly. I tried to derive one myself, // but there could be a severe problem with decoding when reading // blocks of data and not a stream. So I left it the way it is. (ipwizard) - QXmlInputSource xml(pDevice); + TQXmlInputSource xml(pDevice); qDebug("start parsing file"); MyMoneyXmlContentHandler mmxml(this); - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setContentHandler(&mmxml); if(!reader.parse(&xml, false)) { @@ -421,7 +421,7 @@ void MyMoneyStorageXML::readFile(QIODevice* pDevice, IMyMoneySerialize* storage) signalProgress(-1, -1); } -void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) +void MyMoneyStorageXML::writeFile(TQIODevice* qf, IMyMoneySerialize* storage) { Q_CHECK_PTR(qf); Q_CHECK_PTR(storage); @@ -432,67 +432,67 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = storage; // qDebug("XMLWRITER: Starting file write"); - m_doc = new QDomDocument("KMYMONEY-FILE"); + m_doc = new TQDomDocument("KMYMONEY-FILE"); Q_CHECK_PTR(m_doc); - QDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); + TQDomProcessingInstruction instruct = m_doc->createProcessingInstruction("xml", "version=\"1.0\" encoding=\"utf-8\""); m_doc->appendChild(instruct); - QDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); + TQDomElement mainElement = m_doc->createElement("KMYMONEY-FILE"); m_doc->appendChild(mainElement); - QDomElement fileInfo = m_doc->createElement("FILEINFO"); + TQDomElement fileInfo = m_doc->createElement("FILEINFO"); writeFileInformation(fileInfo); mainElement.appendChild(fileInfo); - QDomElement userInfo = m_doc->createElement("USER"); + TQDomElement userInfo = m_doc->createElement("USER"); writeUserInformation(userInfo); mainElement.appendChild(userInfo); - QDomElement institutions = m_doc->createElement("INSTITUTIONS"); + TQDomElement institutions = m_doc->createElement("INSTITUTIONS"); writeInstitutions(institutions); mainElement.appendChild(institutions); - QDomElement payees = m_doc->createElement("PAYEES"); + TQDomElement payees = m_doc->createElement("PAYEES"); writePayees(payees); mainElement.appendChild(payees); - QDomElement accounts = m_doc->createElement("ACCOUNTS"); + TQDomElement accounts = m_doc->createElement("ACCOUNTS"); writeAccounts(accounts); mainElement.appendChild(accounts); - QDomElement transactions = m_doc->createElement("TRANSACTIONS"); + TQDomElement transactions = m_doc->createElement("TRANSACTIONS"); writeTransactions(transactions); mainElement.appendChild(transactions); - QDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); + TQDomElement keyvalpairs = writeKeyValuePairs(m_storage->pairs()); mainElement.appendChild(keyvalpairs); - QDomElement schedules = m_doc->createElement("SCHEDULES"); + TQDomElement schedules = m_doc->createElement("SCHEDULES"); writeSchedules(schedules); mainElement.appendChild(schedules); - QDomElement equities = m_doc->createElement("SECURITIES"); + TQDomElement equities = m_doc->createElement("SECURITIES"); writeSecurities(equities); mainElement.appendChild(equities); - QDomElement currencies = m_doc->createElement("CURRENCIES"); + TQDomElement currencies = m_doc->createElement("CURRENCIES"); writeCurrencies(currencies); mainElement.appendChild(currencies); - QDomElement prices = m_doc->createElement("PRICES"); + TQDomElement prices = m_doc->createElement("PRICES"); writePrices(prices); mainElement.appendChild(prices); - QDomElement reports = m_doc->createElement("REPORTS"); + TQDomElement reports = m_doc->createElement("REPORTS"); writeReports(reports); mainElement.appendChild(reports); - QDomElement budgets = m_doc->createElement("BUDGETS"); + TQDomElement budgets = m_doc->createElement("BUDGETS"); writeBudgets(budgets); mainElement.appendChild(budgets); - QTextStream stream(qf); - stream.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream stream(qf); + stream.setEncoding(TQTextStream::UnicodeUTF8); stream << m_doc->toString(); delete m_doc; @@ -508,36 +508,36 @@ void MyMoneyStorageXML::writeFile(QIODevice* qf, IMyMoneySerialize* storage) m_storage = NULL; } -bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) +bool MyMoneyStorageXML::readFileInformation(const TQDomElement& fileInfo) { signalProgress(0, 3, i18n("Loading file information...")); bool rc = true; - QDomElement temp = findChildElement("CREATION_DATE", fileInfo); - if (temp == QDomElement()) { + TQDomElement temp = findChildElement("CREATION_DATE", fileInfo); + if (temp == TQDomElement()) { rc = false; } - QString strDate = QStringEmpty(temp.attribute("date")); + TQString strDate = TQStringEmpty(temp.attribute("date")); m_storage->setCreationDate(stringToDate(strDate)); signalProgress(1, 0); temp = findChildElement("LAST_MODIFIED_DATE", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - strDate = QStringEmpty(temp.attribute("date")); + strDate = TQStringEmpty(temp.attribute("date")); m_storage->setLastModificationDate(stringToDate(strDate)); signalProgress(2, 0); temp = findChildElement("VERSION", fileInfo); - if (temp == QDomElement()) { + if (temp == TQDomElement()) { rc = false; } - QString strVersion = QStringEmpty(temp.attribute("id")); + TQString strVersion = TQStringEmpty(temp.attribute("id")); fileVersionRead = strVersion.toUInt(NULL, 16); temp = findChildElement("FIXVERSION", fileInfo); - if (temp != QDomElement()) { - QString strFixVersion = QStringEmpty(temp.attribute("id")); + if (temp != TQDomElement()) { + TQString strFixVersion = TQStringEmpty(temp.attribute("id")); m_storage->setFileFixVersion (strFixVersion.toUInt()); } // FIXME The old version stuff used this rather odd number @@ -549,33 +549,33 @@ bool MyMoneyStorageXML::readFileInformation(const QDomElement& fileInfo) return rc; } -void MyMoneyStorageXML::writeFileInformation(QDomElement& fileInfo) +void MyMoneyStorageXML::writeFileInformation(TQDomElement& fileInfo) { - QDomElement creationDate = m_doc->createElement("CREATION_DATE"); + TQDomElement creationDate = m_doc->createElement("CREATION_DATE"); creationDate.setAttribute("date", dateToString(m_storage->creationDate())); fileInfo.appendChild(creationDate); - QDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); + TQDomElement lastModifiedDate = m_doc->createElement("LAST_MODIFIED_DATE"); lastModifiedDate.setAttribute("date", dateToString(m_storage->lastModificationDate())); fileInfo.appendChild(lastModifiedDate); - QDomElement version = m_doc->createElement("VERSION"); + TQDomElement version = m_doc->createElement("VERSION"); version.setAttribute("id", "1"); fileInfo.appendChild(version); - QDomElement fixVersion = m_doc->createElement("FIXVERSION"); + TQDomElement fixVersion = m_doc->createElement("FIXVERSION"); fixVersion.setAttribute("id", m_storage->fileFixVersion()); fileInfo.appendChild(fixVersion); } -void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) +void MyMoneyStorageXML::writeUserInformation(TQDomElement& userInfo) { MyMoneyPayee user = m_storage->user(); userInfo.setAttribute("name", user.name()); userInfo.setAttribute("email", user.email()); - QDomElement address = m_doc->createElement("ADDRESS"); + TQDomElement address = m_doc->createElement("ADDRESS"); address.setAttribute("street", user.address()); address.setAttribute("city", user.city()); address.setAttribute("county", user.state()); @@ -585,22 +585,22 @@ void MyMoneyStorageXML::writeUserInformation(QDomElement& userInfo) userInfo.appendChild(address); } -bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) +bool MyMoneyStorageXML::readUserInformation(const TQDomElement& userElement) { bool rc = true; signalProgress(0, 1, i18n("Loading user information...")); MyMoneyPayee user; - user.setName(QStringEmpty(userElement.attribute("name"))); - user.setEmail(QStringEmpty(userElement.attribute("email"))); + user.setName(TQStringEmpty(userElement.attribute("name"))); + user.setEmail(TQStringEmpty(userElement.attribute("email"))); - QDomElement addressNode = findChildElement("ADDRESS", userElement); + TQDomElement addressNode = findChildElement("ADDRESS", userElement); if(!addressNode.isNull()) { - user.setAddress(QStringEmpty(addressNode.attribute("street"))); - user.setCity(QStringEmpty(addressNode.attribute("city"))); - user.setState(QStringEmpty(addressNode.attribute("county"))); - user.setPostcode(QStringEmpty(addressNode.attribute("zipcode"))); - user.setTelephone(QStringEmpty(addressNode.attribute("telephone"))); + user.setAddress(TQStringEmpty(addressNode.attribute("street"))); + user.setCity(TQStringEmpty(addressNode.attribute("city"))); + user.setState(TQStringEmpty(addressNode.attribute("county"))); + user.setPostcode(TQStringEmpty(addressNode.attribute("zipcode"))); + user.setTelephone(TQStringEmpty(addressNode.attribute("telephone"))); } m_storage->setUser(user); @@ -609,41 +609,41 @@ bool MyMoneyStorageXML::readUserInformation(const QDomElement& userElement) return rc; } -void MyMoneyStorageXML::writeInstitutions(QDomElement& institutions) +void MyMoneyStorageXML::writeInstitutions(TQDomElement& institutions) { - const QValueList<MyMoneyInstitution> list = m_storage->institutionList(); - QValueList<MyMoneyInstitution>::ConstIterator it; + const TQValueList<MyMoneyInstitution> list = m_storage->institutionList(); + TQValueList<MyMoneyInstitution>::ConstIterator it; institutions.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writeInstitution(institutions, *it); } -void MyMoneyStorageXML::writeInstitution(QDomElement& institution, const MyMoneyInstitution& i) +void MyMoneyStorageXML::writeInstitution(TQDomElement& institution, const MyMoneyInstitution& i) { i.writeXML(*m_doc, institution); } -void MyMoneyStorageXML::writePayees(QDomElement& payees) +void MyMoneyStorageXML::writePayees(TQDomElement& payees) { - const QValueList<MyMoneyPayee> list = m_storage->payeeList(); - QValueList<MyMoneyPayee>::ConstIterator it; + const TQValueList<MyMoneyPayee> list = m_storage->payeeList(); + TQValueList<MyMoneyPayee>::ConstIterator it; payees.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) writePayee(payees, *it); } -void MyMoneyStorageXML::writePayee(QDomElement& payee, const MyMoneyPayee& p) +void MyMoneyStorageXML::writePayee(TQDomElement& payee, const MyMoneyPayee& p) { p.writeXML(*m_doc, payee); } -void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) +void MyMoneyStorageXML::writeAccounts(TQDomElement& accounts) { - QValueList<MyMoneyAccount> list; + TQValueList<MyMoneyAccount> list; m_storage->accountList(list); - QValueList<MyMoneyAccount>::ConstIterator it; + TQValueList<MyMoneyAccount>::ConstIterator it; accounts.setAttribute("count", list.count()+5); writeAccount(accounts, m_storage->asset()); @@ -660,20 +660,20 @@ void MyMoneyStorageXML::writeAccounts(QDomElement& accounts) } } -void MyMoneyStorageXML::writeAccount(QDomElement& account, const MyMoneyAccount& p) +void MyMoneyStorageXML::writeAccount(TQDomElement& account, const MyMoneyAccount& p) { p.writeXML(*m_doc, account); } -void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) +void MyMoneyStorageXML::writeTransactions(TQDomElement& transactions) { MyMoneyTransactionFilter filter; filter.setReportAllSplits(false); - QValueList<MyMoneyTransaction> list; + TQValueList<MyMoneyTransaction> list; m_storage->transactionList(list, filter); transactions.setAttribute("count", list.count()); - QValueList<MyMoneyTransaction>::ConstIterator it; + TQValueList<MyMoneyTransaction>::ConstIterator it; signalProgress(0, list.count(), i18n("Saving transactions...")); @@ -685,15 +685,15 @@ void MyMoneyStorageXML::writeTransactions(QDomElement& transactions) } } -void MyMoneyStorageXML::writeTransaction(QDomElement& transaction, const MyMoneyTransaction& tx) +void MyMoneyStorageXML::writeTransaction(TQDomElement& transaction, const MyMoneyTransaction& tx) { tx.writeXML(*m_doc, transaction); } -void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) +void MyMoneyStorageXML::writeSchedules(TQDomElement& scheduled) { - const QValueList<MyMoneySchedule> list = m_storage->scheduleList(); - QValueList<MyMoneySchedule>::ConstIterator it; + const TQValueList<MyMoneySchedule> list = m_storage->scheduleList(); + TQValueList<MyMoneySchedule>::ConstIterator it; scheduled.setAttribute("count", list.count()); for(it = list.begin(); it != list.end(); ++it) @@ -702,86 +702,86 @@ void MyMoneyStorageXML::writeSchedules(QDomElement& scheduled) } } -void MyMoneyStorageXML::writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx) +void MyMoneyStorageXML::writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx) { tx.writeXML(*m_doc, scheduledTx); } -void MyMoneyStorageXML::writeSecurities(QDomElement& equities) +void MyMoneyStorageXML::writeSecurities(TQDomElement& equities) { - const QValueList<MyMoneySecurity> securityList = m_storage->securityList(); + const TQValueList<MyMoneySecurity> securityList = m_storage->securityList(); equities.setAttribute("count", securityList.count()); if(securityList.size()) { - for(QValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) + for(TQValueList<MyMoneySecurity>::ConstIterator it = securityList.begin(); it != securityList.end(); ++it) { writeSecurity(equities, (*it)); } } } -void MyMoneyStorageXML::writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security) +void MyMoneyStorageXML::writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security) { security.writeXML(*m_doc, securityElement); } -void MyMoneyStorageXML::writeCurrencies(QDomElement& currencies) +void MyMoneyStorageXML::writeCurrencies(TQDomElement& currencies) { - const QValueList<MyMoneySecurity> currencyList = m_storage->currencyList(); + const TQValueList<MyMoneySecurity> currencyList = m_storage->currencyList(); currencies.setAttribute("count", currencyList.count()); if(currencyList.size()) { - for(QValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) + for(TQValueList<MyMoneySecurity>::ConstIterator it = currencyList.begin(); it != currencyList.end(); ++it) { writeSecurity(currencies, (*it)); } } } -void MyMoneyStorageXML::writeReports(QDomElement& parent) +void MyMoneyStorageXML::writeReports(TQDomElement& tqparent) { - const QValueList<MyMoneyReport> list = m_storage->reportList(); - QValueList<MyMoneyReport>::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList<MyMoneyReport> list = m_storage->reportList(); + TQValueList<MyMoneyReport>::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving reports...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - (*it).writeXML(*m_doc, parent); + (*it).writeXML(*m_doc, tqparent); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudgets(QDomElement& parent) +void MyMoneyStorageXML::writeBudgets(TQDomElement& tqparent) { - const QValueList<MyMoneyBudget> list = m_storage->budgetList(); - QValueList<MyMoneyBudget>::ConstIterator it; - parent.setAttribute("count", list.count()); + const TQValueList<MyMoneyBudget> list = m_storage->budgetList(); + TQValueList<MyMoneyBudget>::ConstIterator it; + tqparent.setAttribute("count", list.count()); signalProgress(0, list.count(), i18n("Saving budgets...")); unsigned i = 0; for(it = list.begin(); it != list.end(); ++it) { - writeBudget(parent, (*it)); + writeBudget(tqparent, (*it)); signalProgress(++i, 0); } } -void MyMoneyStorageXML::writeBudget(QDomElement& budget, const MyMoneyBudget& b) +void MyMoneyStorageXML::writeBudget(TQDomElement& budget, const MyMoneyBudget& b) { b.writeXML(*m_doc, budget); } -QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomElement& root) +TQDomElement MyMoneyStorageXML::findChildElement(const TQString& name, const TQDomElement& root) { - QDomNode child = root.firstChild(); + TQDomNode child = root.firstChild(); while(!child.isNull()) { if(child.isElement()) { - QDomElement childElement = child.toElement(); + TQDomElement childElement = child.toElement(); if(name == childElement.tagName()) { return childElement; @@ -790,29 +790,29 @@ QDomElement MyMoneyStorageXML::findChildElement(const QString& name, const QDomE child = child.nextSibling(); } - return QDomElement(); + return TQDomElement(); } -QDomElement MyMoneyStorageXML::writeKeyValuePairs(const QMap<QString, QString> pairs) +TQDomElement MyMoneyStorageXML::writeKeyValuePairs(const TQMap<TQString, TQString> pairs) { if(m_doc) { - QDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); + TQDomElement keyValPairs = m_doc->createElement("KEYVALUEPAIRS"); - QMap<QString, QString>::const_iterator it; + TQMap<TQString, TQString>::const_iterator it; for(it = pairs.begin(); it != pairs.end(); ++it) { - QDomElement pair = m_doc->createElement("PAIR"); + TQDomElement pair = m_doc->createElement("PAIR"); pair.setAttribute("key", it.key()); pair.setAttribute("value", it.data()); keyValPairs.appendChild(pair); } return keyValPairs; } - return QDomElement(); + return TQDomElement(); } -void MyMoneyStorageXML::writePrices(QDomElement& prices) +void MyMoneyStorageXML::writePrices(TQDomElement& prices) { const MyMoneyPriceList list = m_storage->priceList(); MyMoneyPriceList::ConstIterator it; @@ -820,7 +820,7 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) for(it = list.begin(); it != list.end(); ++it) { - QDomElement price = m_doc->createElement("PRICEPAIR"); + TQDomElement price = m_doc->createElement("PRICEPAIR"); price.setAttribute("from", it.key().first); price.setAttribute("to", it.key().second); writePricePair(price, *it); @@ -828,29 +828,29 @@ void MyMoneyStorageXML::writePrices(QDomElement& prices) } } -void MyMoneyStorageXML::writePricePair(QDomElement& price, const MyMoneyPriceEntries& p) +void MyMoneyStorageXML::writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p) { MyMoneyPriceEntries::ConstIterator it; for(it = p.begin(); it != p.end(); ++it) { - QDomElement entry = m_doc->createElement("PRICE"); + TQDomElement entry = m_doc->createElement("PRICE"); writePrice(entry, *it); price.appendChild(entry); } } -void MyMoneyStorageXML::writePrice(QDomElement& price, const MyMoneyPrice& p) +void MyMoneyStorageXML::writePrice(TQDomElement& price, const MyMoneyPrice& p) { price.setAttribute("date", p.date().toString(Qt::ISODate)); - price.setAttribute("price", p.rate(QString()).toString()); + price.setAttribute("price", p.rate(TQString()).toString()); price.setAttribute("source", p.source()); } -void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const QString&)) +void MyMoneyStorageXML::setProgressCallback(void(*callback)(int, int, const TQString&)) { m_progressCallback = callback; } -void MyMoneyStorageXML::signalProgress(int current, int total, const QString& msg) +void MyMoneyStorageXML::signalProgress(int current, int total, const TQString& msg) { if(m_progressCallback != 0) (*m_progressCallback)(current, total, msg); @@ -860,23 +860,23 @@ void MyMoneyStorageXML::signalProgress(int current, int total, const QString& ms This convenience function returns all of the remaining data in the device. - @note It's copied from the original Qt sources and modified to + @note It's copied from the original TQt sources and modified to fix a problem with KFilterDev that does not correctly return atEnd() status in certain circumstances which caused our application to lock at startup. */ -QByteArray QIODevice::readAll() +TQByteArray TQIODevice::readAll() { if ( isDirectAccess() ) { // we know the size int n = size()-at(); // ### fix for 64-bit or large files? int totalRead = 0; - QByteArray ba( n ); + TQByteArray ba( n ); char* c = ba.data(); while ( n ) { int r = readBlock( c, n ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); n -= r; c += r; totalRead += r; @@ -892,13 +892,13 @@ QByteArray QIODevice::readAll() // read until we reach the end const int blocksize = 512; int nread = 0; - QByteArray ba; + TQByteArray ba; int r = 1; while ( !atEnd() && r != 0) { ba.resize( nread + blocksize ); r = readBlock( ba.data()+nread, blocksize ); if ( r < 0 ) - return QByteArray(); + return TQByteArray(); nread += r; } ba.resize( nread ); diff --git a/kmymoney2/mymoney/storage/mymoneystoragexml.h b/kmymoney2/mymoney/storage/mymoneystoragexml.h index 8485978..b74626d 100644 --- a/kmymoney2/mymoney/storage/mymoneystoragexml.h +++ b/kmymoney2/mymoney/storage/mymoneystoragexml.h @@ -23,9 +23,9 @@ // ---------------------------------------------------------------------------- // QT Includes -#include <qdom.h> -#include <qdatastream.h> -class QIODevice; +#include <tqdom.h> +#include <tqdatastream.h> +class TQIODevice; // ---------------------------------------------------------------------------- // Project Includes @@ -54,78 +54,78 @@ public: }; protected: - void setProgressCallback(void(*callback)(int, int, const QString&)); - void signalProgress(int current, int total, const QString& = ""); + void setProgressCallback(void(*callback)(int, int, const TQString&)); + void signalProgress(int current, int total, const TQString& = ""); /** * This method returns the version of the underlying file. It * is used by the MyMoney objects contained in a MyMoneyStorageBin object (e.g. * MyMoneyAccount, MyMoneyInstitution, MyMoneyTransaction, etc.) to - * determine the layout used when reading/writing a persistant file. + * determine the tqlayout used when reading/writing a persistant file. * A parameter is used to determine the direction. * * @param dir information about the direction (reading/writing). The * default is reading. * - * @return version QString of file's version + * @return version TQString of file's version * * @see m_fileVersionRead, m_fileVersionWrite */ static unsigned int fileVersion(fileVersionDirectionType dir = Reading); - QValueList<QDomElement> readElements(QString groupTag, QString itemTag = QString()); + TQValueList<TQDomElement> readElements(TQString groupTag, TQString itemTag = TQString()); - bool readFileInformation(const QDomElement& fileInfo); - virtual void writeFileInformation(QDomElement& fileInfo); + bool readFileInformation(const TQDomElement& fileInfo); + virtual void writeFileInformation(TQDomElement& fileInfo); - virtual void writeUserInformation(QDomElement& userInfo); + virtual void writeUserInformation(TQDomElement& userInfo); - virtual void writeInstitution(QDomElement& institutions, const MyMoneyInstitution& i); - virtual void writeInstitutions(QDomElement& institutions); + virtual void writeInstitution(TQDomElement& institutions, const MyMoneyInstitution& i); + virtual void writeInstitutions(TQDomElement& institutions); - virtual void writePrices(QDomElement& prices); - virtual void writePricePair(QDomElement& price, const MyMoneyPriceEntries& p); - virtual void writePrice(QDomElement& prices, const MyMoneyPrice& p); + virtual void writePrices(TQDomElement& prices); + virtual void writePricePair(TQDomElement& price, const MyMoneyPriceEntries& p); + virtual void writePrice(TQDomElement& prices, const MyMoneyPrice& p); - virtual void writePayees(QDomElement& payees); - virtual void writePayee(QDomElement& payees, const MyMoneyPayee& p); + virtual void writePayees(TQDomElement& payees); + virtual void writePayee(TQDomElement& payees, const MyMoneyPayee& p); - virtual void writeAccounts(QDomElement& accounts); - virtual void writeAccount(QDomElement& accounts, const MyMoneyAccount& p); + virtual void writeAccounts(TQDomElement& accounts); + virtual void writeAccount(TQDomElement& accounts, const MyMoneyAccount& p); - virtual void writeTransactions(QDomElement& transactions); - virtual void writeTransaction(QDomElement& transactions, const MyMoneyTransaction& tx); + virtual void writeTransactions(TQDomElement& transactions); + virtual void writeTransaction(TQDomElement& transactions, const MyMoneyTransaction& tx); - virtual void writeSchedules(QDomElement& scheduled); - virtual void writeSchedule(QDomElement& scheduledTx, const MyMoneySchedule& tx); + virtual void writeSchedules(TQDomElement& scheduled); + virtual void writeSchedule(TQDomElement& scheduledTx, const MyMoneySchedule& tx); - virtual void writeReports(QDomElement& e); - virtual void writeBudgets(QDomElement& e); - virtual void writeBudget(QDomElement& budget, const MyMoneyBudget& b); + virtual void writeReports(TQDomElement& e); + virtual void writeBudgets(TQDomElement& e); + virtual void writeBudget(TQDomElement& budget, const MyMoneyBudget& b); - virtual void writeSecurities(QDomElement& securities); - virtual void writeSecurity(QDomElement& securityElement, const MyMoneySecurity& security); + virtual void writeSecurities(TQDomElement& securities); + virtual void writeSecurity(TQDomElement& securityElement, const MyMoneySecurity& security); - virtual void writeCurrencies(QDomElement& currencies); + virtual void writeCurrencies(TQDomElement& currencies); - virtual QDomElement writeKeyValuePairs(const QMap<QString, QString> pairs); + virtual TQDomElement writeKeyValuePairs(const TQMap<TQString, TQString> pairs); - virtual void readFile(QIODevice* s, IMyMoneySerialize* storage); - virtual void writeFile(QIODevice* s, IMyMoneySerialize* storage); + virtual void readFile(TQIODevice* s, IMyMoneySerialize* storage); + virtual void writeFile(TQIODevice* s, IMyMoneySerialize* storage); - bool readUserInformation(const QDomElement& userElement); + bool readUserInformation(const TQDomElement& userElement); - void readPricePair(const QDomElement& pricePair); - const MyMoneyPrice readPrice(const QString& from, const QString& to, const QDomElement& price); + void readPricePair(const TQDomElement& pricePair); + const MyMoneyPrice readPrice(const TQString& from, const TQString& to, const TQDomElement& price); - QDomElement findChildElement(const QString& name, const QDomElement& root); + TQDomElement findChildElement(const TQString& name, const TQDomElement& root); private: - void (*m_progressCallback)(int, int, const QString&); + void (*m_progressCallback)(int, int, const TQString&); protected: IMyMoneySerialize *m_storage; - QDomDocument *m_doc; + TQDomDocument *m_doc; private: /// \internal d-pointer class. @@ -149,7 +149,7 @@ private: * temporarily to convert the price history from the old to the * new format. This should go at some time beyond 0.8 (ipwizard) */ - QString m_baseCurrencyId; + TQString m_baseCurrencyId; }; |