diff options
Diffstat (limited to 'kmymoney2/mymoney/mymoneyaccount.cpp')
-rw-r--r-- | kmymoney2/mymoney/mymoneyaccount.cpp | 166 |
1 files changed, 83 insertions, 83 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: |