diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kplato/kptaccount.cc | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/kptaccount.cc')
-rw-r--r-- | kplato/kptaccount.cc | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/kplato/kptaccount.cc b/kplato/kptaccount.cc index 42dff604..f166111c 100644 --- a/kplato/kptaccount.cc +++ b/kplato/kptaccount.cc @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#include <qdom.h> -#include <qstring.h> +#include <tqdom.h> +#include <tqstring.h> #include <klocale.h> @@ -43,7 +43,7 @@ Account::Account() m_costPlaces.setAutoDelete(true); } -Account::Account(QString name, QString description) +Account::Account(TQString name, TQString description) : m_name(name), m_description(description), m_list(0), @@ -65,7 +65,7 @@ Account::~Account() { } -void Account::setName(QString name) { +void Account::setName(TQString name) { if (findAccount() == this) { removeId(); } @@ -95,23 +95,23 @@ void Account::take(Account *account) { if (account == 0) { return; } - if (account->parent() == this) { - m_accountList.take(m_accountList.findRef(account)); - } else if (account->parent()) { - account->parent()->take(account); + if (account->tqparent() == this) { + m_accountList.take(m_accountList.tqfindRef(account)); + } else if (account->tqparent()) { + account->tqparent()->take(account); } else { m_list->take(account); } //kdDebug()<<k_funcinfo<<account->name()<<endl; } -bool Account::load(QDomElement &element, const Project &project) { +bool Account::load(TQDomElement &element, const Project &project) { m_name = element.attribute("name"); m_description = element.attribute("description"); - QDomNodeList list = element.childNodes(); + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "costplace") { Account::CostPlace *child = new Account::CostPlace(this); if (child->load(e, project)) { @@ -134,12 +134,12 @@ bool Account::load(QDomElement &element, const Project &project) { return true; } -void Account::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("account"); +void Account::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("account"); element.appendChild(me); me.setAttribute("name", m_name); me.setAttribute("description", m_description); - QPtrListIterator<Account::CostPlace> cit = m_costPlaces; + TQPtrListIterator<Account::CostPlace> cit = m_costPlaces; for (; cit.current(); ++cit) { cit.current()->save(me); } @@ -150,7 +150,7 @@ void Account::save(QDomElement &element) const { } Account::CostPlace *Account::findCostPlace(const Node &node) const { - QPtrListIterator<CostPlace> it = m_costPlaces; + TQPtrListIterator<CostPlace> it = m_costPlaces; for (; it.current(); ++it) { if (&node == it.current()->node()) { return it.current(); @@ -232,13 +232,13 @@ void Account::addShutdown(Node &node) { append(new CostPlace(this, &node, false, false, true)); } -Account *Account::findAccount(const QString &id) const { +Account *Account::findAccount(const TQString &id) const { if (m_list) return m_list->findAccount(id); return 0; } -bool Account::removeId(const QString &id) { +bool Account::removeId(const TQString &id) { return (m_list ? m_list->removeId(id) : false); } @@ -280,7 +280,7 @@ void Account::CostPlace::setShutdown(bool on ) { m_node->setShutdownAccount(on ? m_account : 0); } -bool Account::CostPlace::load(QDomElement &element, const Project &project) { +bool Account::CostPlace::load(TQDomElement &element, const Project &project) { //kdDebug()<<k_funcinfo<<endl; m_nodeId = element.attribute("node-id"); if (m_nodeId.isEmpty()) { @@ -298,9 +298,9 @@ bool Account::CostPlace::load(QDomElement &element, const Project &project) { return true; } -void Account::CostPlace::save(QDomElement &element) const { +void Account::CostPlace::save(TQDomElement &element) const { //kdDebug()<<k_funcinfo<<endl; - QDomElement me = element.ownerDocument().createElement("costplace"); + TQDomElement me = element.ownerDocument().createElement("costplace"); element.appendChild(me); me.setAttribute("node-id", m_nodeId); me.setAttribute("running-cost", m_running); @@ -323,9 +323,9 @@ Accounts::~Accounts() { m_accountList.clear(); } -EffortCostMap Accounts::plannedCost(const Account &account, const QDate &start, const QDate &end) { +EffortCostMap Accounts::plannedCost(const Account &account, const TQDate &start, const TQDate &end) { EffortCostMap ec; - QPtrListIterator<Account::CostPlace> it = account.costPlaces(); + TQPtrListIterator<Account::CostPlace> it = account.costPlaces(); for (; it.current(); ++it) { Node *n = it.current()->node(); if (n == 0) { @@ -347,7 +347,7 @@ EffortCostMap Accounts::plannedCost(const Account &account, const QDate &start, } } if (&account == m_defaultAccount) { - QDictIterator<Node> nit = m_project.nodeDict(); + TQDictIterator<Node> nit = m_project.nodeDict(); for (; nit.current(); ++nit) { Node *n = nit.current(); if (n->runningAccount() == 0) { @@ -383,19 +383,19 @@ void Accounts::take(Account *account){ return; } removeId(account->name()); - if (account->parent()) { - account->parent()->take(account); + if (account->tqparent()) { + account->tqparent()->take(account); return; } - m_accountList.take(m_accountList.findRef(account)); + m_accountList.take(m_accountList.tqfindRef(account)); //kdDebug()<<k_funcinfo<<account->name()<<endl; } -bool Accounts::load(QDomElement &element, const Project &project) { - QDomNodeList list = element.childNodes(); +bool Accounts::load(TQDomElement &element, const Project &project) { + TQDomNodeList list = element.childNodes(); for (unsigned int i=0; i<list.count(); ++i) { if (list.item(i).isElement()) { - QDomElement e = list.item(i).toElement(); + TQDomElement e = list.item(i).toElement(); if (e.tagName() == "account") { Account *child = new Account(); if (child->load(e, project)) { @@ -417,8 +417,8 @@ bool Accounts::load(QDomElement &element, const Project &project) { return true; } -void Accounts::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("accounts"); +void Accounts::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("accounts"); element.appendChild(me); if (m_defaultAccount) { me.setAttribute("default-account", m_defaultAccount->name()); @@ -429,9 +429,9 @@ void Accounts::save(QDomElement &element) const { } } -QStringList Accounts::costElements() const { - QDictIterator<Account> it(m_idDict); - QStringList l; +TQStringList Accounts::costElements() const { + TQDictIterator<Account> it(m_idDict); + TQStringList l; for(; it.current(); ++it) { if (it.current()->isElement()) l << it.currentKey(); @@ -440,9 +440,9 @@ QStringList Accounts::costElements() const { } -QStringList Accounts::nameList() const { - QDictIterator<Account> it(m_idDict); - QStringList l; +TQStringList Accounts::nameList() const { + TQDictIterator<Account> it(m_idDict); + TQStringList l; for(; it.current(); ++it) { l << it.currentKey(); } @@ -450,7 +450,7 @@ QStringList Accounts::nameList() const { } Account *Accounts::findRunningAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findRunning(node)) return it.current(); @@ -459,7 +459,7 @@ Account *Accounts::findRunningAccount(const Node &node) const { } Account *Accounts::findStartupAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findStartup(node)) return it.current(); @@ -468,7 +468,7 @@ Account *Accounts::findStartupAccount(const Node &node) const { } Account *Accounts::findShutdownAccount(const Node &node) const { - QDictIterator<Account> it = m_idDict; + TQDictIterator<Account> it = m_idDict; for (; it.current(); ++it) { if (it.current()->findShutdown(node)) return it.current(); @@ -476,13 +476,13 @@ Account *Accounts::findShutdownAccount(const Node &node) const { return 0; } -Account *Accounts::findAccount(const QString &id) const { - return m_idDict.find(id); +Account *Accounts::findAccount(const TQString &id) const { + return m_idDict.tqfind(id); } bool Accounts::insertId(const Account *account) { Q_ASSERT(account); - Account *a = m_idDict.find(account->name()); + Account *a = m_idDict.tqfind(account->name()); if (a == 0) { //kdDebug()<<k_funcinfo<<"'"<<account->name()<<"' inserted"<<endl; m_idDict.insert(account->name(), account); @@ -497,16 +497,16 @@ bool Accounts::insertId(const Account *account) { return false; } -bool Accounts::removeId(const QString &id) { +bool Accounts::removeId(const TQString &id) { bool res = m_idDict.remove(id); //kdDebug()<<k_funcinfo<<id<<": removed="<<res<<endl; return res; } #ifndef NDEBUG -void Accounts::printDebug(QString /*indent*/) { +void Accounts::printDebug(TQString /*indent*/) { } -void Account::printDebug(QString /*indent*/) { +void Account::printDebug(TQString /*indent*/) { } #endif } //namespace KPlato |