summaryrefslogtreecommitdiffstats
path: root/juk/sortedstringlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'juk/sortedstringlist.cpp')
-rw-r--r--juk/sortedstringlist.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/juk/sortedstringlist.cpp b/juk/sortedstringlist.cpp
index 0886a88d..904c5f01 100644
--- a/juk/sortedstringlist.cpp
+++ b/juk/sortedstringlist.cpp
@@ -20,11 +20,11 @@
class SortedStringList::Node
{
public:
- Node(const TQString &value) : key(value), parent(0), left(0), right(0) {}
+ Node(const TQString &value) : key(value), tqparent(0), left(0), right(0) {}
~Node() {}
TQString key;
- Node *parent;
+ Node *tqparent;
Node *left;
Node *right;
};
@@ -44,9 +44,9 @@ bool SortedStringList::insert(const TQString &value)
return BSTInsert(value);
}
-bool SortedStringList::contains(const TQString &value) const
+bool SortedStringList::tqcontains(const TQString &value) const
{
- return find(value);
+ return tqfind(value);
}
SortedStringList::Node *SortedStringList::treeMinimum(Node *n) const
@@ -61,11 +61,11 @@ SortedStringList::Node *SortedStringList::treeSuccessor(Node *n) const
if(n->right)
return treeMinimum(n->right);
- Node *p = n->parent;
+ Node *p = n->tqparent;
while(p && n == p->right) {
n = p;
- p = p->parent;
+ p = p->tqparent;
}
return p;
@@ -73,7 +73,7 @@ SortedStringList::Node *SortedStringList::treeSuccessor(Node *n) const
bool SortedStringList::remove(const TQString &value)
{
- Node *n = find(value);
+ Node *n = tqfind(value);
if(!n)
return false;
@@ -92,15 +92,15 @@ bool SortedStringList::remove(const TQString &value)
x = y->right;
if(x)
- x->parent = y->parent;
+ x->tqparent = y->tqparent;
- if(!y->parent)
+ if(!y->tqparent)
m_root = x;
else {
- if(y == y->parent->left)
- y->parent->left = x;
+ if(y == y->tqparent->left)
+ y->tqparent->left = x;
else
- y->parent->right = x;
+ y->tqparent->right = x;
}
if(y != x)
@@ -122,7 +122,7 @@ TQStringList SortedStringList::values() const
// private methods
////////////////////////////////////////////////////////////////////////////////
-SortedStringList::Node *SortedStringList::find(const TQString &value) const
+SortedStringList::Node *SortedStringList::tqfind(const TQString &value) const
{
Node *n = m_root;
while(n && value != n->key) {
@@ -155,7 +155,7 @@ bool SortedStringList::BSTInsert(const TQString &value)
Node *n = new Node(value);
- n->parent = previousNode;
+ n->tqparent = previousNode;
if(!m_root)
m_root = n;