diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-29 16:05:55 +0000 |
commit | 87a016680e3677da3993f333561e79eb0cead7d5 (patch) | |
tree | cbda2b4df8b8ee0d8d1617e6c75bec1e3ee0ccba /microbe/btreebase.cpp | |
parent | 6ce3d1ad09c1096b5ed3db334e02859e45d5c32b (diff) | |
download | ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.tar.gz ktechlab-87a016680e3677da3993f333561e79eb0cead7d5.zip |
TQt4 port ktechlab
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktechlab@1238801 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'microbe/btreebase.cpp')
-rw-r--r-- | microbe/btreebase.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/microbe/btreebase.cpp b/microbe/btreebase.cpp index bd9e38a..7117b26 100644 --- a/microbe/btreebase.cpp +++ b/microbe/btreebase.cpp @@ -41,14 +41,14 @@ BTreeBase::~BTreeBase() } -void BTreeBase::addNode(BTreeNode *parent, BTreeNode *node, bool left) +void BTreeBase::addNode(BTreeNode *tqparent, BTreeNode *node, bool left) { // Debugging lines, remove when expression parsing has been completed. - //if(!parent) cerr<<"Null parent pointer!\n"; + //if(!tqparent) cerr<<"Null tqparent pointer!\n"; //if(!node) cerr<<"Null node pointer!\n"); - if(left) parent->setLeft(node); - else parent->setRight(node); + if(left) tqparent->setLeft(node); + else tqparent->setRight(node); } void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) @@ -60,7 +60,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) while(!done) { //t.descendLeftwardToTerminal(); - if( t.current()->parent() ) + if( t.current()->tqparent() ) { if( t.oppositeNode()->hasChildren() ) pruneTree(t.oppositeNode()); } @@ -69,7 +69,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) if( !t.current()->hasChildren() ) { //if(t.current() == t.root()) done = true; - if(!t.current()->parent()) done = true; + if(!t.current()->tqparent()) done = true; continue; } @@ -88,7 +88,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) t.current()->setChildOp(Expression::divbyzero); return; } - QString value = QString::number(Parser::doArithmetic(l->value().toInt(),r->value().toInt(),t.current()->childOp())); + TQString value = TQString::number(Parser::doArithmetic(l->value().toInt(),r->value().toInt(),t.current()->childOp())); t.current()->deleteChildren(); t.current()->setChildOp(Expression::noop); t.current()->setType(number); @@ -155,7 +155,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) { // since we can't call compileError from in this class, we have a special way of handling it: - // Leave the children as they are, and set childOp to divbyzero + // Leave the tqchildren as they are, and set childOp to divbyzero if( t.current()->childOp() == Expression::division ) { t.current()->setChildOp(Expression::divbyzero); @@ -204,7 +204,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) if(zero) { BTreeNode *p = t.current(); - QString value; + TQString value; if( p->childOp() == Expression::bwand ) { value = "0"; @@ -226,7 +226,7 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) } } - if(!t.current()->parent() || t.current() == root) done = true; + if(!t.current()->tqparent() || t.current() == root) done = true; else { @@ -237,12 +237,12 @@ void BTreeBase::pruneTree(BTreeNode *root, bool /*conditionalRoot*/) void BTreeBase::replaceNode(BTreeNode *node, BTreeNode *replacement) { // (This works under the assumption that a node is not linked to two places at once). - if( !node->parent() ) + if( !node->tqparent() ) { setRoot(replacement); replacement->setParent(0L); return; } - if( node->parent()->left() == node ) node->parent()->setLeft(replacement); - if( node->parent()->right() == node ) node->parent()->setRight(replacement); + if( node->tqparent()->left() == node ) node->tqparent()->setLeft(replacement); + if( node->tqparent()->right() == node ) node->tqparent()->setRight(replacement); } |