diff options
Diffstat (limited to 'src/svnfrontend/cacheentry.h')
-rw-r--r-- | src/svnfrontend/cacheentry.h | 120 |
1 files changed, 60 insertions, 60 deletions
diff --git a/src/svnfrontend/cacheentry.h b/src/svnfrontend/cacheentry.h index 2ab422b..db4cd6d 100644 --- a/src/svnfrontend/cacheentry.h +++ b/src/svnfrontend/cacheentry.h @@ -24,11 +24,11 @@ #include "src/svnqt/shared_pointer.hpp" #include "src/svnqt/status.hpp" -// std::map 'cause QMap isn't usable +// std::map 'cause TQMap isn't usable #include <map> #include <algorithm> -#include <qstring.h> -#include <qstringlist.h> +#include <tqstring.h> +#include <tqstringlist.h> namespace helpers { @@ -40,31 +40,31 @@ namespace helpers { template<class C> class cacheEntry { public: typedef cacheEntry<C> cache_type; - typedef typename std::map<QString,cache_type> cache_map_type; + typedef typename std::map<TQString,cache_type> cache_map_type; typedef typename cache_map_type::const_iterator citer; typedef typename cache_map_type::iterator iter; protected: - QString m_key; + TQString m_key; bool m_isValid; C m_content; cache_map_type m_subMap; public: cacheEntry(); - cacheEntry(const QString&key); + cacheEntry(const TQString&key); cacheEntry(const cacheEntry<C>&other); virtual ~cacheEntry(){}; - virtual bool find(QStringList&,QLIST<C>&)const; + virtual bool find(TQStringList&,TQLIST<C>&)const; //! Checks if cache contains a specific item /*! * the keylist will manipulated - so copy-operations aren't needed. * \param what Stringlist containing the components to search for * \return true if found (may or may not valid!) otherwise false */ - virtual bool find(QStringList&what)const; + virtual bool find(TQStringList&what)const; //! Checks if cache contains a specific valid item /*! * if yes, the content will stored in st @@ -72,19 +72,19 @@ public: * \param st target status to store content if found * \return true if found */ - virtual bool findSingleValid(QStringList&what,C&st)const; + virtual bool findSingleValid(TQStringList&what,C&st)const; //! Checks if cache contains a specific valid item /*! - * in difference to virtual bool find(QStringList&,svn::StatusEntries&)const no copy operations + * in difference to virtual bool find(TQStringList&,svn::StatusEntries&)const no copy operations * are made inside so it works much faster for simple find. * \param what the keylist to search for * \param check_valid_subs if true, return true if a subitem is valid even the item isn't valid * \return true if found */ - virtual bool findSingleValid(QStringList&what,bool check_valid_subs)const; - template<class T> void listsubs_if(QStringList&_what,T&oper)const; + virtual bool findSingleValid(TQStringList&what,bool check_valid_subs)const; + template<class T> void listsubs_if(TQStringList&_what,T&oper)const; - virtual void appendValidSub(QLIST<C>&)const; + virtual void appendValidSub(TQLIST<C>&)const; virtual bool isValid()const { return m_isValid; @@ -93,9 +93,9 @@ public: { return m_content; } - virtual bool deleteKey(QStringList&,bool exact); - virtual void insertKey(QStringList&,const C&); - virtual void setValidContent(const QString&key,const C&st) + virtual bool deleteKey(TQStringList&,bool exact); + virtual void insertKey(TQStringList&,const C&); + virtual void setValidContent(const TQString&key,const C&st) { kdDebug()<<"Insert for "<<key<<endl; m_key = key; @@ -107,7 +107,7 @@ public: m_content=C(); m_isValid=false; } - const QString&key()const { + const TQString&key()const { return m_key; } @@ -115,9 +115,9 @@ public: #if 0 void dump_tree(int level=0)const { - QString pre; + TQString pre; pre.fill('-',level); - std::map<QString,cacheEntry>::const_iterator it; + std::map<TQString,cacheEntry>::const_iterator it; for (it=m_subMap.begin();it!=m_subMap.end();++it) { std::cout<<pre.latin1()<<it->first.latin1() << " (" << it->second.m_key.latin1() << ")"<<std::endl; it->second.dump_tree(level+1); @@ -133,7 +133,7 @@ template<class C> inline cacheEntry<C>::cacheEntry() { } -template<class C> inline cacheEntry<C>::cacheEntry(const QString&key) +template<class C> inline cacheEntry<C>::cacheEntry(const TQString&key) : m_key(key),m_isValid(false),m_content() { } @@ -153,7 +153,7 @@ template<class C> inline cacheEntry<C>& cacheEntry<C>::operator=(const cacheEntr return *this; } -template<class C> inline bool cacheEntry<C>::find(QStringList&what,QLIST<C>&t)const +template<class C> inline bool cacheEntry<C>::find(TQStringList&what,TQLIST<C>&t)const { if (what.count()==0) { return false; @@ -185,7 +185,7 @@ template<class C> inline bool cacheEntry<C>::find(QStringList&what,QLIST<C>&t)c return it->second.find(what,t); } -template<class C> inline bool cacheEntry<C>::find(QStringList&what)const +template<class C> inline bool cacheEntry<C>::find(TQStringList&what)const { if (what.count()==0) { return false; @@ -201,12 +201,12 @@ template<class C> inline bool cacheEntry<C>::find(QStringList&what)const return it->second.find(what); } -template<class C> inline bool cacheEntry<C>::findSingleValid(QStringList&what,C&t)const +template<class C> inline bool cacheEntry<C>::findSingleValid(TQStringList&what,C&t)const { if (what.count()==0) { return false; } - //kdDebug()<<"cacheEntry::findSingleValid(QStringList&what,C&t)"<< what << endl; + //kdDebug()<<"cacheEntry::findSingleValid(TQStringList&what,C&t)"<< what << endl; citer it; it = m_subMap.find(what[0]); if (it==m_subMap.end()) { @@ -223,12 +223,12 @@ template<class C> inline bool cacheEntry<C>::findSingleValid(QStringList&what,C& return it->second.findSingleValid(what,t); } -template<class C> inline bool cacheEntry<C>::findSingleValid(QStringList&what,bool check_valid_subs)const +template<class C> inline bool cacheEntry<C>::findSingleValid(TQStringList&what,bool check_valid_subs)const { if (what.count()==0) { return false; } - // kdDebug()<<"cacheEntry::findSingleValid(QStringList&what,svn::Status&t)"<< what << endl; + // kdDebug()<<"cacheEntry::findSingleValid(TQStringList&what,svn::tqStatus&t)"<< what << endl; citer it = m_subMap.find(what[0]); if (it==m_subMap.end()) { return false; @@ -240,7 +240,7 @@ template<class C> inline bool cacheEntry<C>::findSingleValid(QStringList&what,bo return it->second.findSingleValid(what,check_valid_subs); } -template<class C> inline void cacheEntry<C>::appendValidSub(QLIST<C>&t)const +template<class C> inline void cacheEntry<C>::appendValidSub(TQLIST<C>&t)const { citer it; for (it=m_subMap.begin();it!=m_subMap.end();++it) { @@ -254,7 +254,7 @@ template<class C> inline void cacheEntry<C>::appendValidSub(QLIST<C>&t)const } } -template<class C> inline bool cacheEntry<C>::deleteKey(QStringList&what,bool exact) +template<class C> inline bool cacheEntry<C>::deleteKey(TQStringList&what,bool exact) { if (what.count()==0) { return true; @@ -295,13 +295,13 @@ template<class C> inline bool cacheEntry<C>::hasValidSubs()const return false; } -template<class C> inline void cacheEntry<C>::insertKey(QStringList&what,const C&st) +template<class C> inline void cacheEntry<C>::insertKey(TQStringList&what,const C&st) { if (what.count()==0) { return; } //kdDebug()<<"inserting "<<what<< "into " << m_key << endl; - QString m = what[0]; + TQString m = what[0]; if (m_subMap.find(m)==m_subMap.end()) { m_subMap[m].m_key=m; @@ -317,7 +317,7 @@ template<class C> inline void cacheEntry<C>::insertKey(QStringList&what,const C& m_subMap[m].insertKey(what,st); } -template<class C> template<class T> inline void cacheEntry<C>::listsubs_if(QStringList&what,T&oper)const +template<class C> template<class T> inline void cacheEntry<C>::listsubs_if(TQStringList&what,T&oper)const { if (what.count()==0) { /* we are the one to get the list for*/ @@ -338,7 +338,7 @@ template<class C> class itemCache { public: typedef cacheEntry<C> cache_type; - typedef typename std::map<QString,cache_type> cache_map_type; + typedef typename std::map<TQString,cache_type> cache_map_type; typedef typename cache_map_type::const_iterator citer; typedef typename cache_map_type::iterator iter; @@ -349,7 +349,7 @@ public: itemCache():m_contentMap(){} virtual ~itemCache(){}; - void setContent(const QLIST<C>&dlist); + void setContent(const TQLIST<C>&dlist); void clear(){m_contentMap.clear();} //! Checks if cache contains a specific item /*! @@ -357,25 +357,25 @@ public: * \param what Stringlist containing the components to search for * \return true if found (may or may not valid!) otherwise false */ - virtual bool find(const QString&what)const; - virtual bool find(const QString&,QLIST<C>&)const; + virtual bool find(const TQString&what)const; + virtual bool find(const TQString&,TQLIST<C>&)const; - virtual void deleteKey(const QString&what,bool exact); - virtual void insertKey(const C&,const QString&path); - virtual bool findSingleValid(const QString&what,C&)const; - virtual bool findSingleValid(const QString&what,bool check_valid_subs)const; + virtual void deleteKey(const TQString&what,bool exact); + virtual void insertKey(const C&,const TQString&path); + virtual bool findSingleValid(const TQString&what,C&)const; + virtual bool findSingleValid(const TQString&what,bool check_valid_subs)const; - template<class T>void listsubs_if(const QString&what,T&oper)const; + template<class T>void listsubs_if(const TQString&what,T&oper)const; void dump_tree(); }; -template<class C> inline void itemCache<C>::setContent(const QLIST<C>&dlist) +template<class C> inline void itemCache<C>::setContent(const TQLIST<C>&dlist) { m_contentMap.clear(); citer it; for (it=dlist.begin();it!=dlist.end();++it) { - QStringList _keys = QStringList::split("/",(*it).path()); + TQStringList _keys = TQStringList::split("/",(*it).path()); if (_keys.count()==0) { continue; } @@ -389,10 +389,10 @@ template<class C> inline void itemCache<C>::setContent(const QLIST<C>&dlist) } } -template<class C> inline void itemCache<C>::insertKey(const C&st,const QString&path) +template<class C> inline void itemCache<C>::insertKey(const C&st,const TQString&path) { // kdDebug()<<"Inserting "<<st.path()<<endl; - QStringList _keys = QStringList::split("/",path); + TQStringList _keys = TQStringList::split("/",path); if (_keys.count()==0) { return; } @@ -404,18 +404,18 @@ template<class C> inline void itemCache<C>::insertKey(const C&st,const QString&p if (_keys.count()==1) { m_contentMap[_keys[0]].setValidContent(_keys[0],st); } else { - QString m = _keys[0]; + TQString m = _keys[0]; _keys.erase(_keys.begin()); m_contentMap[m].insertKey(_keys,st); } } -template<class C> inline bool itemCache<C>::find(const QString&what)const +template<class C> inline bool itemCache<C>::find(const TQString&what)const { if (m_contentMap.size()==0) { return false; } - QStringList _keys = QStringList::split("/",what); + TQStringList _keys = TQStringList::split("/",what); if (_keys.count()==0) { return false; } @@ -430,12 +430,12 @@ template<class C> inline bool itemCache<C>::find(const QString&what)const return it->second.find(_keys); } -template<class C> inline bool itemCache<C>::find(const QString&_what,QLIST<C>&dlist)const +template<class C> inline bool itemCache<C>::find(const TQString&_what,TQLIST<C>&dlist)const { if (m_contentMap.size()==0) { return false; } - QStringList what = QStringList::split("/",_what); + TQStringList what = TQStringList::split("/",_what); if (what.count()==0) { return false; } @@ -444,16 +444,16 @@ template<class C> inline bool itemCache<C>::find(const QString&_what,QLIST<C>&dl return false; } what.erase(what.begin()); - // kdDebug()<<"itemCache::find(const QString&_what,svn::StatusEntries&dlist) "<<what<<endl; + // kdDebug()<<"itemCache::find(const TQString&_what,svn::StatusEntries&dlist) "<<what<<endl; return it->second.find(what,dlist); } -template<class C> inline void itemCache<C>::deleteKey(const QString&_what,bool exact) +template<class C> inline void itemCache<C>::deleteKey(const TQString&_what,bool exact) { if (m_contentMap.size()==0) { return; } - QStringList what = QStringList::split("/",_what); + TQStringList what = TQStringList::split("/",_what); if (what.count()==0) { return; } @@ -490,12 +490,12 @@ template<class C> inline void itemCache<C>::dump_tree() } } -template<class C> inline bool itemCache<C>::findSingleValid(const QString&_what,C&st)const +template<class C> inline bool itemCache<C>::findSingleValid(const TQString&_what,C&st)const { if (m_contentMap.size()==0) { return false; } - QStringList what = QStringList::split("/",_what); + TQStringList what = TQStringList::split("/",_what); if (what.count()==0) { return false; } @@ -517,12 +517,12 @@ template<class C> inline bool itemCache<C>::findSingleValid(const QString&_what, return it->second.findSingleValid(what,st); } -template<class C> inline bool itemCache<C>::findSingleValid(const QString&_what,bool check_valid_subs)const +template<class C> inline bool itemCache<C>::findSingleValid(const TQString&_what,bool check_valid_subs)const { if (m_contentMap.size()==0) { return false; } - QStringList what = QStringList::split("/",_what); + TQStringList what = TQStringList::split("/",_what); if (what.count()==0) { return false; } @@ -537,12 +537,12 @@ template<class C> inline bool itemCache<C>::findSingleValid(const QString&_what, return it->second.findSingleValid(what,check_valid_subs); } -template<class C> template<class T> inline void itemCache<C>::listsubs_if(const QString&_what,T&oper)const +template<class C> template<class T> inline void itemCache<C>::listsubs_if(const TQString&_what,T&oper)const { if (m_contentMap.size()==0) { return; } - QStringList what = QStringList::split("/",_what); + TQStringList what = TQStringList::split("/",_what); if (what.count()==0) { return; } @@ -567,9 +567,9 @@ class ValidRemoteOnly svn::StatusEntries m_List; public: ValidRemoteOnly():m_List(){} - void operator()(const std::pair<QString,helpers::ptrEntry>&_data) + void operator()(const std::pair<TQString,helpers::ptrEntry>&_data) { - if(_data.second.isValid() && _data.second.content()->validReposStatus()&&!_data.second.content()->validLocalStatus()) { + if(_data.second.isValid() && _data.second.content()->validRepostqStatus()&&!_data.second.content()->validLocaltqStatus()) { m_List.push_back(_data.second.content()); } } |