From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- kplato/kptaccount.cc | 92 ++++++++++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'kplato/kptaccount.cc') 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 -#include +#include +#include #include @@ -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()<name()<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 cit = m_costPlaces; + TQPtrListIterator 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 it = m_costPlaces; + TQPtrListIterator 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()< it = account.costPlaces(); + TQPtrListIterator 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 nit = m_project.nodeDict(); + TQDictIterator 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()<name()<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 it(m_idDict); - QStringList l; +TQStringList Accounts::costElements() const { + TQDictIterator 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 it(m_idDict); - QStringList l; +TQStringList Accounts::nameList() const { + TQDictIterator 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 it = m_idDict; + TQDictIterator 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 it = m_idDict; + TQDictIterator 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 it = m_idDict; + TQDictIterator 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()<name()<<"' inserted"<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()<