diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/ptrvector.h | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/ptrvector.h')
-rw-r--r-- | src/ptrvector.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ptrvector.h b/src/ptrvector.h index 1dd66ea..a27c884 100644 --- a/src/ptrvector.h +++ b/src/ptrvector.h @@ -17,7 +17,7 @@ #include <kdebug.h> #include <ksharedptr.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> namespace Tellico { @@ -134,7 +134,7 @@ public: m_baseVector.insert(&m_baseVector[pos.m_index], t); } - Iterator find(Ptr t) { + Iterator tqfind(Ptr t) { for(size_t i = 0; i < count(); ++i) { if(m_baseVector[i].data() == t) { return Iterator(this, i); @@ -143,16 +143,16 @@ public: return end(); } - bool contains(Ptr t) const { return qFind(m_baseVector.begin(), m_baseVector.end(), Ptr(t)) != m_baseVector.end(); } + bool tqcontains(Ptr t) const { return tqFind(m_baseVector.begin(), m_baseVector.end(), Ptr(t)) != m_baseVector.end(); } bool remove(const Ptr& t) { - Ptr* it = qFind(m_baseVector.begin(), m_baseVector.end(), t); + Ptr* it = tqFind(m_baseVector.begin(), m_baseVector.end(), t); if(it == m_baseVector.end()) return false; m_baseVector.erase(it); return true; } private: - QValueVector<Ptr> m_baseVector; + TQValueVector<Ptr> m_baseVector; }; template <class T> class PtrVector; @@ -259,7 +259,7 @@ public: void push_back(T* ptr) { m_baseVector.push_back(ptr); } bool remove(T* ptr); bool remove(Iterator it); - bool contains(const T* ptr) const; + bool tqcontains(const T* ptr) const; private: #ifndef NDEBUG @@ -268,7 +268,7 @@ private: void check(size_t) const {} #endif - QValueVector<T*> m_baseVector; + TQValueVector<T*> m_baseVector; bool m_autoDelete : 1; }; @@ -287,7 +287,7 @@ bool Tellico::PtrVector<T>::remove(T* t) { if(!t) { return false; } - T** ptr = qFind(m_baseVector.begin(), m_baseVector.end(), t); + T** ptr = tqFind(m_baseVector.begin(), m_baseVector.end(), t); if(ptr == m_baseVector.end()) { return false; } @@ -311,11 +311,11 @@ bool Tellico::PtrVector<T>::remove(Iterator it) { } template <class T> -bool Tellico::PtrVector<T>::contains(const T* t) const { +bool Tellico::PtrVector<T>::tqcontains(const T* t) const { if(!t) { return false; } - const T* const* ptr = qFind(m_baseVector.begin(), m_baseVector.end(), t); + const T* const* ptr = tqFind(m_baseVector.begin(), m_baseVector.end(), t); return ptr != m_baseVector.end(); } |