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/kptnode.cc | 200 +++++++++++++++++++++++++++--------------------------- 1 file changed, 100 insertions(+), 100 deletions(-) (limited to 'kplato/kptnode.cc') diff --git a/kplato/kptnode.cc b/kplato/kptnode.cc index cab767f8..48135a71 100644 --- a/kplato/kptnode.cc +++ b/kplato/kptnode.cc @@ -25,8 +25,8 @@ #include "kptresource.h" #include "kptschedule.h" -#include -#include +#include +#include #include #include @@ -34,19 +34,19 @@ namespace KPlato { -Node::Node(Node *parent) : m_nodes(), m_dependChildNodes(), m_dependParentNodes() { +Node::Node(Node *tqparent) : m_nodes(), m_dependChildNodes(), m_dependParentNodes() { //kdDebug()<projectNode(); - kdError()<name()< &nodes = m_nodes; - return (const_cast &>(nodes)).at(number); + // Work around missing const at() method in TQPtrList + const TQPtrList &nodes = m_nodes; + return (const_cast &>(nodes)).at(number); } Duration *Node::getDelay() { @@ -201,7 +201,7 @@ void Node::insertDependChildNode( unsigned int index, Node *node, Relation::Type } bool Node::addDependChildNode( Relation *relation) { - if(m_dependChildNodes.findRef(relation) != -1) + if(m_dependChildNodes.tqfindRef(relation) != -1) return false; m_dependChildNodes.append(relation); return true; @@ -209,7 +209,7 @@ bool Node::addDependChildNode( Relation *relation) { // These delDepend... methods look suspicious to me, can someone review? void Node::delDependChildNode( Node *node, bool remove) { - if ( m_nodes.findRef(node) != -1 ) { + if ( m_nodes.tqfindRef(node) != -1 ) { if(remove) m_dependChildNodes.remove(); else @@ -218,7 +218,7 @@ void Node::delDependChildNode( Node *node, bool remove) { } void Node::delDependChildNode( Relation *rel, bool remove) { - if ( m_dependChildNodes.findRef(rel) != -1 ) { + if ( m_dependChildNodes.tqfindRef(rel) != -1 ) { if(remove) m_dependChildNodes.remove(); else @@ -234,7 +234,7 @@ void Node::delDependChildNode( int number, bool remove) { } void Node::takeDependChildNode(Relation *rel) { - if (m_dependChildNodes.findRef(rel) != -1) { + if (m_dependChildNodes.tqfindRef(rel) != -1) { m_dependChildNodes.take(); } } @@ -260,7 +260,7 @@ void Node::insertDependParentNode( unsigned int index, Node *node, Relation::Typ } bool Node::addDependParentNode( Relation *relation) { - if(m_dependParentNodes.findRef(relation) != -1) + if(m_dependParentNodes.tqfindRef(relation) != -1) return false; m_dependParentNodes.append(relation); return true; @@ -268,7 +268,7 @@ bool Node::addDependParentNode( Relation *relation) { // These delDepend... methods look suspicious to me, can someone review? void Node::delDependParentNode( Node *node, bool remove) { - if ( m_nodes.findRef(node) != -1 ) { + if ( m_nodes.tqfindRef(node) != -1 ) { if(remove) m_dependParentNodes.remove(); else @@ -277,7 +277,7 @@ void Node::delDependParentNode( Node *node, bool remove) { } void Node::delDependParentNode( Relation *rel, bool remove) { - if ( m_dependParentNodes.findRef(rel) != -1 ) { + if ( m_dependParentNodes.tqfindRef(rel) != -1 ) { if(remove) m_dependParentNodes.remove(); else @@ -293,16 +293,16 @@ void Node::delDependParentNode( int number, bool remove) { } void Node::takeDependParentNode(Relation *rel) { - if (m_dependParentNodes.findRef(rel) != -1) { + if (m_dependParentNodes.tqfindRef(rel) != -1) { rel = m_dependParentNodes.take(); } } bool Node::isParentOf(Node *node) { - if (m_nodes.findRef(node) != -1) + if (m_nodes.tqfindRef(node) != -1) return true; - QPtrListIterator nit(childNodeIterator()); + TQPtrListIterator nit(childNodeIterator()); for ( ; nit.current(); ++nit ) { if (nit.current()->isParentOf(node)) return true; @@ -313,7 +313,7 @@ bool Node::isParentOf(Node *node) { Relation *Node::findParentRelation(Node *node) { for (int i=0; iparent() == node) + if (rel->tqparent() == node) return rel; } return (Relation *)0; @@ -339,9 +339,9 @@ bool Node::isDependChildOf(Node *node) { //kdDebug()<name()<<"'"<parent() == node) + if (rel->tqparent() == node) return true; - if (rel->parent()->isDependChildOf(node)) + if (rel->tqparent()->isDependChildOf(node)) return true; } return false; @@ -367,35 +367,35 @@ Duration Node::duration(const DateTime &time, int use, bool backward) { } void Node::makeAppointments() { - QPtrListIterator nit(m_nodes); + TQPtrListIterator nit(m_nodes); for ( ; nit.current(); ++nit ) { nit.current()->makeAppointments(); } } void Node::calcResourceOverbooked() { - QPtrListIterator nit(m_nodes); + TQPtrListIterator nit(m_nodes); for ( ; nit.current(); ++nit ) { nit.current()->calcResourceOverbooked(); } } -QStringList Node::overbookedResources() const { - return m_currentSchedule ? m_currentSchedule->overbookedResources() : QStringList(); +TQStringList Node::overbookedResources() const { + return m_currentSchedule ? m_currentSchedule->overbookedResources() : TQStringList(); } -void Node::saveRelations(QDomElement &element) const { - QPtrListIterator it(m_dependChildNodes); +void Node::saveRelations(TQDomElement &element) const { + TQPtrListIterator it(m_dependChildNodes); for (; it.current(); ++it) { it.current()->save(element); } - QPtrListIterator nodes(m_nodes); + TQPtrListIterator nodes(m_nodes); for ( ; nodes.current(); ++nodes ) { nodes.current()->saveRelations(element); } } -void Node::setConstraint(QString &type) { +void Node::setConstraint(TQString &type) { // Do not i18n these, they are used in load() if (type == "ASAP") setConstraint(ASAP); @@ -415,24 +415,24 @@ void Node::setConstraint(QString &type) { setConstraint(ASAP); // default } -QString Node::constraintToString() const { +TQString Node::constraintToString() const { // Do not i18n these, they are used in save() if (m_constraint == ASAP) - return QString("ASAP"); + return TQString("ASAP"); else if (m_constraint == ALAP) - return QString("ALAP"); + return TQString("ALAP"); else if (m_constraint == StartNotEarlier) - return QString("StartNotEarlier"); + return TQString("StartNotEarlier"); else if (m_constraint == FinishNotLater) - return QString("FinishNotLater"); + return TQString("FinishNotLater"); else if (m_constraint == MustStartOn) - return QString("MustStartOn"); + return TQString("MustStartOn"); else if (m_constraint == MustFinishOn) - return QString("MustFinishOn"); + return TQString("MustFinishOn"); else if (m_constraint == FixedInterval) - return QString("FixedInterval"); + return TQString("FixedInterval"); - return QString(); + return TQString(); } void Node::propagateEarliestStart(DateTime &time) { @@ -440,7 +440,7 @@ void Node::propagateEarliestStart(DateTime &time) { return; m_currentSchedule->earliestStart = time; //kdDebug()<earliestStart.toString()< it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->propagateEarliestStart(time); } @@ -451,7 +451,7 @@ void Node::propagateLatestFinish(DateTime &time) { return; m_currentSchedule->latestFinish = time; //kdDebug()<latestFinish< it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->propagateLatestFinish(time); } @@ -462,7 +462,7 @@ void Node::moveEarliestStart(DateTime &time) { return; if (m_currentSchedule->earliestStart < time) m_currentSchedule->earliestStart = time; - QPtrListIterator it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->moveEarliestStart(time); } @@ -473,14 +473,14 @@ void Node::moveLatestFinish(DateTime &time) { return; if (m_currentSchedule->latestFinish > time) m_currentSchedule->latestFinish = time; - QPtrListIterator it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->moveLatestFinish(time); } } void Node::initiateCalculation(Schedule &sch) { - QPtrListIterator it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->initiateCalculation(sch); } @@ -489,7 +489,7 @@ void Node::initiateCalculation(Schedule &sch) { void Node::resetVisited() { m_visitedForward = false; m_visitedBackward = false; - QPtrListIterator it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->resetVisited(); } @@ -504,7 +504,7 @@ Node *Node::siblingBefore() { Node *Node::childBefore(Node *node) { //kdDebug()< 0){ return m_nodes.at(index-1); } @@ -521,7 +521,7 @@ Node *Node::siblingAfter() { Node *Node::childAfter(Node *node) { //kdDebug()<name()< it = m_nodes; + TQString w = wbs + def.wbs(count, level()); + TQPtrListIterator it = m_nodes; for (int i=0; it.current(); ++it) { it.current()->generateWBS(++i, def, w); } @@ -767,7 +767,7 @@ void Node::generateWBS(int count, WBSDefinition &def, QString wbs) { } void Node::setCurrentSchedule(long id) { - QPtrListIterator it = m_nodes; + TQPtrListIterator it = m_nodes; for (; it.current(); ++it) { it.current()->setCurrentSchedule(id); } @@ -860,7 +860,7 @@ Duration Effort::effort(int use) const { return m_expectedEffort; // default } -bool Effort::load(QDomElement &element) { +bool Effort::load(TQDomElement &element) { m_expectedEffort = Duration::fromString(element.attribute("expected")); m_optimisticEffort = Duration::fromString(element.attribute("optimistic")); m_pessimisticEffort = Duration::fromString(element.attribute("pessimistic")); @@ -869,8 +869,8 @@ bool Effort::load(QDomElement &element) { return true; } -void Effort::save(QDomElement &element) const { - QDomElement me = element.ownerDocument().createElement("effort"); +void Effort::save(TQDomElement &element) const { + TQDomElement me = element.ownerDocument().createElement("effort"); element.appendChild(me); me.setAttribute("expected", m_expectedEffort.toString()); me.setAttribute("optimistic", m_optimisticEffort.toString()); @@ -879,16 +879,16 @@ void Effort::save(QDomElement &element) const { me.setAttribute("risk", risktypeToString()); } -QString Effort::typeToString() const { +TQString Effort::typeToString() const { if (m_type == Type_Effort) - return QString("Effort"); + return TQString("Effort"); if (m_type == Type_FixedDuration) - return QString("Type_FixedDuration"); + return TQString("Type_FixedDuration"); - return QString(); + return TQString(); } -void Effort::setType(QString type) { +void Effort::setType(TQString type) { if (type == "Effort") setType(Type_Effort); else if (type == "Type_FixedDuration") @@ -897,18 +897,18 @@ void Effort::setType(QString type) { setType(Type_Effort); // default } -QString Effort::risktypeToString() const { +TQString Effort::risktypeToString() const { if (m_risktype == Risk_None) - return QString("None"); + return TQString("None"); if (m_risktype == Risk_Low) - return QString("Low"); + return TQString("Low"); if (m_risktype == Risk_High) - return QString("High"); + return TQString("High"); - return QString(); + return TQString(); } -void Effort::setRisktype(QString type) { +void Effort::setRisktype(TQString type) { if (type == "High") setRisktype(Risk_High); else if (type == "Low") @@ -942,10 +942,10 @@ int Effort::pessimisticRatio() const { // Debugging #ifndef NDEBUG -void Node::printDebug(bool children, QCString indent) { +void Node::printDebug(bool tqchildren, TQCString indent) { kdDebug()< it = m_schedules; + TQIntDictIterator it = m_schedules; for (; it.current(); ++it) { it.current()->printDebug(indent+" "); } - kdDebug()<name() : QString("None"))<name() : TQString("None"))< pit(m_dependParentNodes); - //kdDebug()< cit(m_dependChildNodes); - //kdDebug()< it(m_nodes); + if (tqchildren) { + TQPtrListIterator it(m_nodes); for ( ; it.current(); ++it ) { it.current()->printDebug(true,indent); } @@ -993,7 +993,7 @@ void Node::printDebug(bool children, QCString indent) { #ifndef NDEBUG -void Effort::printDebug(QCString indent) { +void Effort::printDebug(TQCString indent) { kdDebug()<