rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kvirc@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 5d03948cd3
commit 72aaee9802

@ -71,7 +71,7 @@ class(installer,object)
@$mkdir($2)
foreach(%file,%files)
{
$this->%lFiles <+ $str.tqreplace($file.fixpath("$2/%file"),"\\\\","\\")
$this->%lFiles <+ $str.replace($file.fixpath("$2/%file"),"\\\\","\\")
file.copy -o $file.fixpath($0/%file) $file.fixpath($2/%file)
}
}
@ -117,7 +117,7 @@ class(installer,object)
{
foreach(%file,%files)
{
$this->%lSources <+ $str.tqreplace($file.fixpath("$0/%file"),"\\\\","\\")
$this->%lSources <+ $str.replace($file.fixpath("$0/%file"),"\\\\","\\")
include $file.fixpath("$0/%file")
}
}
@ -150,7 +150,7 @@ class(installer,object)
else if($str.match("toolbar.create * *",%line,e))
%c .= " toolbar.destroy -q "$str.word(1,%line)"$lf"
else if($str.match("action.create* (*)",%line,e))
%c .= " action.destroy -q "$str.tqreplace($str.token(1,"(,)",%line),,\")"$lf"
%c .= " action.destroy -q "$str.replace($str.token(1,"(,)",%line),,\")"$lf"
else if($str.match("class(*)*",%line,e))
%c .= " objects.killclass -q "$str.token(1,"(,)",%line)"$lf"
}

@ -1159,7 +1159,7 @@ defpopup(logging)
# If this window is being logged actually , $log.file will be non empty
# and pointing to the log file actually open.
%:logfile = $str.tqreplace($log.file,,$file.localdir)
%:logfile = $str.replace($log.file,,$file.localdir)
}
label($tr("Logging to"):<br><b>%:logfile</b>) ("%:logfile" != "")

@ -2914,7 +2914,7 @@ to 399.
432 ERR_ERRONEUSNICKNAME
"<nick> :Erroneous nickname"
- Returned after receiving a NICK message which tqcontains
- Returned after receiving a NICK message which contains
characters which do not fall in the defined set. See
section 2.3.1 for details on valid nicknames.

@ -26,7 +26,7 @@
//=============================================================================
//=============================================================================
// This file tqcontains (more or less) freely customizable compile time defaults
// This file contains (more or less) freely customizable compile time defaults
//
// You can safely play with the ones you understand the meaning of
//=============================================================================

@ -349,7 +349,7 @@ public:
/// Places the hash table iterator at the position
/// of the item found.
///
T * tqfind(const Key & hKey)
T * find(const Key & hKey)
{
m_uIteratorIdx = kvi_hash_hash(hKey,m_bCaseSensitive) % m_uSize;
if(!m_pDataArray[m_uIteratorIdx])return 0;
@ -364,11 +364,11 @@ public:
/// Returns the item associated to the key hKey
/// or NULL if no such item exists in the hash table.
/// Places the hash table iterator at the position
/// of the item found. This is an alias to tqfind().
/// of the item found. This is an alias to find().
///
T * operator[](const Key & hKey)
{
return tqfind(hKey);
return find(hKey);
}
///
@ -427,7 +427,7 @@ public:
/// The hash table iterator is placed at the newly inserted item.
/// This is just an alias to insert() with a different name.
///
void tqreplace(const Key & hKey,T * pData)
void replace(const Key & hKey,T * pData)
{
insert(hKey,pData);
}
@ -522,7 +522,7 @@ public:
/// it's hash table entry, if found, and NULL otherwise.
/// The hash table iterator is placed at the item found.
///
KviPointerHashTableEntry<Key,T> * tqfindRef(const T * pRef)
KviPointerHashTableEntry<Key,T> * findRef(const T * pRef)
{
for(m_uIteratorIdx = 0;m_uIteratorIdx<m_uSize;m_uIteratorIdx++)
{
@ -540,7 +540,7 @@ public:
///
/// Returns the entry pointed by the hash table iterator.
/// This function must be preceeded by a call to firstEntry(), first()
/// or tqfindRef().
/// or findRef().
///
KviPointerHashTableEntry<Key,T> * currentEntry()
{
@ -568,7 +568,7 @@ public:
/// Places the hash table iterator at the next entry
/// and returns it.
/// This function must be preceeded by a call to firstEntry(), first()
/// or tqfindRef().
/// or findRef().
///
KviPointerHashTableEntry<Key,T> * nextEntry()
{
@ -596,7 +596,7 @@ public:
///
/// Returns the data value pointer pointed by the hash table iterator.
/// This function must be preceeded by a call to firstEntry(), first()
/// or tqfindRef().
/// or findRef().
///
T * current()
{
@ -613,7 +613,7 @@ public:
///
/// Returns the key pointed by the hash table iterator.
/// This function must be preceeded by a call to firstEntry(), first()
/// or tqfindRef().
/// or findRef().
///
const Key & currentKey()
{
@ -648,7 +648,7 @@ public:
/// Places the hash table iterator at the next entry
/// and returns the associated data value pointer.
/// This function must be preceeded by a call to firstEntry(), first()
/// or tqfindRef().
/// or findRef().
///
T * next()
{

@ -288,7 +288,7 @@ public:
/// Iterating over pointers is also very fast and this
/// class contains an internal iterator that allows to
/// write loops in a compact and clean way.
/// See the first(), next(), current() and tqfindRef()
/// See the first(), next(), current() and findRef()
/// functions for the description of this feature.
///
/// There is also a non-const external iterator
@ -618,7 +618,7 @@ public:
///
/// Returns the current iteration item
/// A call to this function MUST be preceded by a call to
/// first(),last(),at() or tqfindRef()
/// first(),last(),at() or findRef()
///
T * current()
{
@ -628,7 +628,7 @@ public:
///
/// Returns the current iteration item
/// A call to this function should be preceded by a call to
/// first(),last(),at() or tqfindRef().
/// first(),last(),at() or findRef().
/// This function will return a NULL pointer if the current
/// item has been invalidated due to a remove operation.
///
@ -641,7 +641,7 @@ public:
///
/// Returns an iterator pointing to the current item in the list.
/// A call to this function MUST be preceded by a call to
/// first(),last(),at() or tqfindRef()
/// first(),last(),at() or findRef()
///
KviPointerListIterator<T> iteratorAtCurrent()
{
@ -652,7 +652,7 @@ public:
/// Sets the iteration pointer to the next item in the list
/// and returns that item (or 0 if the end of the list has been reached)
/// A call to this function MUST be preceded by a _succesfull_ call to
/// first(),last(),at() or tqfindRef().
/// first(),last(),at() or findRef().
///
T * next()
{
@ -666,7 +666,7 @@ public:
/// Sets the iteration pointer to the previous item in the list
/// and returns that item (or 0 if the beginning of the list has been reached)
/// A call to this function MUST be preceded by a _succesfull_ call to
/// first(),last(),at() or tqfindRef()
/// first(),last(),at() or findRef()
///
T * prev()
{
@ -715,7 +715,7 @@ public:
/// and returns its position (zero based index) in the list or -1 if the
/// item cannot be found
///
int tqfindRef(const T * d)
int findRef(const T * d)
{
int ret = 0;
for(T * t = first();t;t = next())
@ -945,7 +945,7 @@ public:
///
bool removeRef(const T * d)
{
if(tqfindRef(d) == -1)return false;
if(findRef(d) == -1)return false;
removeCurrentSafe();
return true;
}
@ -957,7 +957,7 @@ public:
///
void insertAfter(const T * ref,const T * d)
{
if(tqfindRef(ref) == -1)
if(findRef(ref) == -1)
{
append(d);
return;
@ -981,7 +981,7 @@ public:
///
void insertBefore(const T * ref,const T * d)
{
if(tqfindRef(ref) == -1)
if(findRef(ref) == -1)
{
prepend(d);
return;

@ -934,7 +934,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.indexOf(c);
#else
int idx = s.tqfind(c);
int idx = s.find(c);
#endif
if(idx == -1)return;
s.truncate(bIncluded ? idx : idx + 1);
@ -945,7 +945,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.lastIndexOf(c);
#else
int idx = s.tqfindRev(c);
int idx = s.findRev(c);
#endif
if(idx == -1)return;
s.truncate(bIncluded ? idx : idx + 1);
@ -956,7 +956,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.indexOf(c);
#else
int idx = s.tqfind(c);
int idx = s.find(c);
#endif
if(idx == -1)
{
@ -971,7 +971,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.lastIndexOf(c);
#else
int idx = s.tqfindRev(c);
int idx = s.findRev(c);
#endif
if(idx == -1)
{
@ -986,7 +986,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.indexOf(c);
#else
int idx = s.tqfind(c);
int idx = s.find(c);
#endif
if(idx == -1)return;
s.truncate(bIncluded ? idx : idx + c.length());
@ -997,7 +997,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.lastIndexOf(c);
#else
int idx = s.tqfindRev(c);
int idx = s.findRev(c);
#endif
if(idx == -1)return;
s.truncate(bIncluded ? idx : idx + c.length());
@ -1008,7 +1008,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.indexOf(c);
#else
int idx = s.tqfind(c);
int idx = s.find(c);
#endif
if(idx == -1)
{
@ -1023,7 +1023,7 @@ namespace KviTQString
#ifdef COMPILE_USE_QT4
int idx = s.lastIndexOf(c);
#else
int idx = s.tqfindRev(c);
int idx = s.findRev(c);
#endif
if(idx == -1)
{

@ -148,93 +148,93 @@ namespace KviTQString
#endif
}
inline int tqfind(const TQString &s,TQChar c,int index = 0,bool cs = true)
inline int find(const TQString &s,TQChar c,int index = 0,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfind(c,index,cs);
return s.find(c,index,cs);
#endif
}
inline int tqfind(const TQString &s,char c,int index = 0,bool cs = true)
inline int find(const TQString &s,char c,int index = 0,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.indexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfind(c,index,cs);
return s.find(c,index,cs);
#endif
}
inline int tqfind(const TQString &s,const TQString & str,int index = 0,bool cs = true)
inline int find(const TQString &s,const TQString & str,int index = 0,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.indexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfind(str,index,cs);
return s.find(str,index,cs);
#endif
}
inline int tqfind(const TQString &s,const TQRegExp & rx,int index = 0)
inline int find(const TQString &s,const TQRegExp & rx,int index = 0)
{
#ifdef COMPILE_USE_QT4
return s.indexOf(rx,index);
#else
return s.tqfind(rx,index);
return s.find(rx,index);
#endif
}
inline int tqfind(const TQString &s,const char * str,int index = 0)
inline int find(const TQString &s,const char * str,int index = 0)
{
#ifdef COMPILE_USE_QT4
return s.indexOf(TQString(str),index);
#else
return s.tqfind(str,index);
return s.find(str,index);
#endif
}
inline int tqfindRev(const TQString &s,TQChar c,int index = -1,bool cs = true)
inline int findRev(const TQString &s,TQChar c,int index = -1,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfindRev(c,index,cs);
return s.findRev(c,index,cs);
#endif
}
inline int tqfindRev(const TQString &s,char c,int index = -1,bool cs = true)
inline int findRev(const TQString &s,char c,int index = -1,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.lastIndexOf(c,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfindRev(c,index,cs);
return s.findRev(c,index,cs);
#endif
}
inline int tqfindRev(const TQString &s,const TQString & str,int index = -1,bool cs = true)
inline int findRev(const TQString &s,const TQString & str,int index = -1,bool cs = true)
{
#ifdef COMPILE_USE_QT4
return s.lastIndexOf(str,index,cs ? TQt::CaseSensitive : TQt::CaseInsensitive);
#else
return s.tqfindRev(str,index,cs);
return s.findRev(str,index,cs);
#endif
}
inline int tqfindRev(const TQString &s,const TQRegExp & rx,int index = -1)
inline int findRev(const TQString &s,const TQRegExp & rx,int index = -1)
{
#ifdef COMPILE_USE_QT4
return s.lastIndexOf(rx,index);
#else
return s.tqfindRev(rx,index);
return s.findRev(rx,index);
#endif
}
inline int tqfindRev(const TQString &s,const char * str,int index = -1)
inline int findRev(const TQString &s,const char * str,int index = -1)
{
#ifdef COMPILE_USE_QT4
return s.lastIndexOf(TQString(str),index);
#else
return s.tqfindRev(str,index);
return s.findRev(str,index);
#endif
}

@ -2203,7 +2203,7 @@ int KviStr::occurences(const char *str,bool caseS) const
return cnt;
}
bool KviStr::tqcontains(char c,bool caseS) const
bool KviStr::contains(char c,bool caseS) const
{
register char *p = m_ptr;
if(caseS)
@ -2224,7 +2224,7 @@ bool KviStr::tqcontains(char c,bool caseS) const
return false;
}
bool KviStr::tqcontains(const char *str,bool caseS) const
bool KviStr::contains(const char *str,bool caseS) const
{
__range_valid(str);
register char *p = m_ptr;
@ -2657,7 +2657,7 @@ KviStr & KviStr::sprintf(const char *fmt,...)
return (*this);
}
int KviStr::tqfind(const char *str,int idx,bool caseS) const
int KviStr::find(const char *str,int idx,bool caseS) const
{
if(idx >= m_len)return -1;
register char *p=m_ptr + idx;
@ -2682,7 +2682,7 @@ int KviStr::tqfind(const char *str,int idx,bool caseS) const
}
}
int KviStr::tqfind(char c,int idx) const
int KviStr::find(char c,int idx) const
{
if(idx >= m_len)return -1;
register char *p=m_ptr + idx;
@ -2691,7 +2691,7 @@ int KviStr::tqfind(char c,int idx) const
}
int KviStr::tqfindRev(const char *str,int idx,bool caseS) const
int KviStr::findRev(const char *str,int idx,bool caseS) const
{
if((m_len + idx) < 0)return -1;
register char *p=m_ptr + m_len + idx;
@ -2729,10 +2729,10 @@ int KviStr::findFirstIdx(const char *str,bool caseS) const
{
// This function can't be used to search inside
// multibyte encoded strings... convert your
// code to TQString and use TQString::tqfindRev().
// code to TQString and use TQString::findRev().
// We must throw away KviStr at all in this case...
// return TQString(m_ptr).tqfind(TQString(str),0,caseS);;
// return TQString(m_ptr).find(TQString(str),0,caseS);;
// Both this KviStr and the const char * str are assumed
// to be in the proper (and same) encoding.
@ -2782,10 +2782,10 @@ int KviStr::findLastIdx(const char *str,bool caseS) const
{
// This function can't be used to search inside
// multibyte encoded strings... convert your
// code to TQString and use TQString::tqfindRev().
// code to TQString and use TQString::findRev().
// We must throw away KviStr at all in this case...
// return TQString(m_ptr).tqfindRev(TQString(str),-1,caseS);
// return TQString(m_ptr).findRev(TQString(str),-1,caseS);
__range_valid(str);
//Calc the len of the searched string
@ -2948,7 +2948,7 @@ KviStr & KviStr::emptyString()
}
bool KviStr::ext_tqcontains(register const char * data,const char * item,bool caseS)
bool KviStr::ext_contains(register const char * data,const char * item,bool caseS)
{
if(item && data)
{

@ -376,9 +376,9 @@ public:
//=============================================================================
// Returns true if at least one occurence of str is found
bool tqcontains(const char *str,bool caseS=true) const;
bool contains(const char *str,bool caseS=true) const;
// Returns true if at least one occurence of character c is found in this string
bool tqcontains(char c,bool caseS=true) const;
bool contains(char c,bool caseS=true) const;
// Returns the number of occurences of string str in this string.<br>
// Overlapped matches are counted.
int occurences(const char *str,bool caseS=true) const;
@ -405,9 +405,9 @@ public:
// str can NOT be 0 here.
int findLastIdx(const char *str,bool caseS = true) const;
int tqfind(char c,int startIdx) const;
int tqfind(const char * str,int startIdx,bool caseS = true) const;
int tqfindRev(const char * str,int startIdx,bool caseS = true) const;
int find(char c,int startIdx) const;
int find(const char * str,int startIdx,bool caseS = true) const;
int findRev(const char * str,int startIdx,bool caseS = true) const;
//=============================================================================
// Numbers
@ -462,7 +462,7 @@ public:
//=============================================================================
// FIXME: Should it be KviStrExt::contains namespace ?
static bool ext_tqcontains(register const char * data,const char * item,bool caseS = true);
static bool ext_contains(register const char * data,const char * item,bool caseS = true);
};
// FIXME: the functions below should end in the KviStr namespace ???

@ -80,7 +80,7 @@ void KviConfig::clearGroup(const TQString & szGroup)
{
m_bDirty = true;
m_pDict->remove(szGroup);
if(!m_pDict->tqfind(m_szGroup))m_szGroup = KVI_CONFIG_DEFAULT_GROUP; //removed the current one
if(!m_pDict->find(m_szGroup))m_szGroup = KVI_CONFIG_DEFAULT_GROUP; //removed the current one
}
void KviConfig::clearKey(const TQString & szKey)
@ -282,7 +282,7 @@ bool KviConfig::load()
TQString szGroup = m_bLocal8Bit ?
TQString::fromLocal8Bit(tmp.ptr(),tmp.len()) :
TQString::fromUtf8(tmp.ptr(),tmp.len());
p_group = m_pDict->tqfind(szGroup);
p_group = m_pDict->find(szGroup);
if(!p_group)
{
p_group = new KviConfigGroup(17,false);
@ -324,13 +324,13 @@ bool KviConfig::load()
p_group->setAutoDelete(true);
m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group);
}
p_group->tqreplace(szKey,pVal);
p_group->replace(szKey,pVal);
} else {
// we in fact need this (mercy :D)
// otherwise the empty options will be treated as non-existing ones
// and will get the defaults (which is bad)
TQString * pVal = new TQString(TQString());
p_group->tqreplace(szKey,pVal);
p_group->replace(szKey,pVal);
}
}
}
@ -390,7 +390,7 @@ bool KviConfig::load()
if(dataLine.hasData())
{
TQString szUtf8 = TQString::fromUtf8(dataLine.ptr());
p_group = m_pDict->tqfind(szUtf8);
p_group = m_pDict->find(szUtf8);
if(!p_group)
{
@ -422,7 +422,7 @@ bool KviConfig::load()
m_pDict->insert(KVI_CONFIG_DEFAULT_GROUP,p_group);
}
TQString szName = TQString::fromUtf8(name.ptr());
p_group->tqreplace(szName,p_data);
p_group->replace(szName,p_data);
}
}
break;
@ -550,18 +550,18 @@ void KviConfig::setGroup(const TQString & szGroup)
bool KviConfig::hasKey(const TQString & szKey)
{
KviConfigGroup * p_group = getCurrentGroup();
return (p_group->tqfind(szKey) != 0);
return (p_group->find(szKey) != 0);
}
bool KviConfig::hasGroup(const TQString & szGroup)
{
return (m_pDict->tqfind(szGroup) != 0);
return (m_pDict->find(szGroup) != 0);
}
KviConfigGroup * KviConfig::getCurrentGroup()
{
if(m_szGroup.isEmpty())m_szGroup = KVI_CONFIG_DEFAULT_GROUP;
KviConfigGroup * p_group = m_pDict->tqfind(m_szGroup);
KviConfigGroup * p_group = m_pDict->find(m_szGroup);
if(!p_group)
{
//create the group
@ -579,7 +579,7 @@ void KviConfig::writeEntry(const TQString & szKey,const TQString & szValue)
m_bDirty = true;
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data=new TQString(szValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
// FIXME: #warning "We have probs here ?"
@ -587,7 +587,7 @@ void KviConfig::writeEntry(const TQString & szKey,const TQString & szValue)
TQString KviConfig::readEntry(const TQString & szKey,const TQString & szDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)
{
m_szStrBuffer = szDefault;
@ -603,7 +603,7 @@ TQString KviConfig::readEntry(const TQString & szKey,const TQString & szDefault)
TQString KviConfig::readTQStringEntry(const char *szKey,const TQString &szDefault)
{
KviStrDict * p_group = getCurrentGroup();
KviStr * p_str = p_group->tqfind(szKey);
KviStr * p_str = p_group->find(szKey);
if(!p_str)return szDefault;
return TQString::fromUtf8(p_str->ptr());
}
@ -614,7 +614,7 @@ void KviConfig::writeEntry(const char *szKey,const TQString &szValue)
{
m_bDirty = true;
KviStrDict * p_group = getCurrentGroup();
p_group->tqreplace(szKey,new KviStr(szValue.utf8().data()));
p_group->replace(szKey,new KviStr(szValue.utf8().data()));
}
*/
@ -625,7 +625,7 @@ static TQString g_szConfigStringListSeparator(",\\[ITEM],");
TQStringList KviConfig::readStringListEntry(const TQString & szKey,const TQStringList &list)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return list;
#ifdef COMPILE_USE_QT4
return p_str->split(g_szConfigStringListSeparator);
@ -639,7 +639,7 @@ void KviConfig::writeEntry(const TQString & szKey,const TQStringList &list)
m_bDirty = true;
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data=new TQString(list.join(g_szConfigStringListSeparator));
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
////////////////////////////////// KviValueList<int>
@ -647,7 +647,7 @@ void KviConfig::writeEntry(const TQString & szKey,const TQStringList &list)
KviValueList<int> KviConfig::readIntListEntry(const TQString & szKey,const KviValueList<int> &list)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)
{
//debug("Returning default list for group %s and key %s",m_szGroup.latin1(),szKey.latin1());
@ -685,7 +685,7 @@ void KviConfig::writeEntry(const TQString & szKey,const KviValueList<int> &list)
}
//debug("Writing option list for group %s and key %s: %s",m_szGroup.latin1(),szKey.latin1(),szData.ptr());
p_group->tqreplace(szKey,new TQString(szData.ptr()));
p_group->replace(szKey,new TQString(szData.ptr()));
}
////////////////////////////////// KviPixmap
@ -698,13 +698,13 @@ void KviConfig::writeEntry(const TQString & szKey,const KviPixmap &pixmap)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data=new TQString();
KviStringConversion::toString(pixmap,*p_data);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
KviPixmap KviConfig::readPixmapEntry(const TQString & szKey,const KviPixmap &pixDef)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(p_str)
{
KviPixmap ret("");
@ -722,13 +722,13 @@ void KviConfig::writeEntry(const TQString & szKey,const KviMsgType &msg)
KviConfigGroup * p_group = getCurrentGroup();
TQString szData;
KviStringConversion::toString(msg,szData);
p_group->tqreplace(szKey,new TQString(szData));
p_group->replace(szKey,new TQString(szData));
}
KviMsgType KviConfig::readMsgTypeEntry(const TQString & szKey,const KviMsgType &msgDef)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return msgDef;
KviMsgType ret = msgDef;
KviStringConversion::fromString(*p_str,ret);
@ -742,14 +742,14 @@ void KviConfig::writeEntry(const TQString & szKey,const TQColor &clr)
m_bDirty = true;
KviConfigGroup * p_group = getCurrentGroup();
KviStr szData(KviStr::Format,"%d,%d,%d",clr.red(),clr.green(),clr.blue());
p_group->tqreplace(szKey,new TQString(szData.ptr()));
p_group->replace(szKey,new TQString(szData.ptr()));
}
TQColor KviConfig::readColorEntry(const TQString & szKey,const TQColor &clr)
{
KviConfigGroup * p_group = getCurrentGroup();
TQColor color(clr);
TQString * pointer_that_IS_initialized = p_group->tqfind(szKey);
TQString * pointer_that_IS_initialized = p_group->find(szKey);
if(pointer_that_IS_initialized)
@ -793,7 +793,7 @@ void KviConfig::writeEntry(const TQString & szKey,TQFont &fnt)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString();
KviStringConversion::toString(fnt,*p_data);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
@ -806,7 +806,7 @@ TQFont KviConfig::readFontEntry(const TQString & szKey,const TQFont &fnt)
{
TQFont font(fnt);
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(p_str)
{
//FontEntry=Arial,12,9,0,100,italic,underline,strikeout,
@ -824,13 +824,13 @@ void KviConfig::writeEntry(const TQString & szKey,bool bTrue)
m_bDirty = true;
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString(bTrue ? "true" : "false");
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
bool KviConfig::readBoolEntry(const TQString & szKey,bool bTrue)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return bTrue;
static TQString szTrue = "true";
return (KviTQString::toLower(*p_str) == szTrue);
@ -844,13 +844,13 @@ void KviConfig::writeEntry(const TQString & szKey,const TQRect &rct)
KviConfigGroup * p_group = getCurrentGroup();
TQString szBuf;
KviStringConversion::toString(rct,szBuf);
p_group->tqreplace(szKey,new TQString(szBuf));
p_group->replace(szKey,new TQString(szBuf));
}
TQRect KviConfig::readRectEntry(const TQString & szKey,const TQRect &rct)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * str = p_group->tqfind(szKey);
TQString * str = p_group->find(szKey);
if(!str)return rct;
TQRect ret;
return KviStringConversion::fromString(*str,ret) ? ret : rct;
@ -864,13 +864,13 @@ void KviConfig::writeEntry(const TQString & szKey,unsigned short usValue)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString();
p_data->setNum(usValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
unsigned short int KviConfig::readUShortEntry(const TQString & szKey,unsigned short int usDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return usDefault;
bool bOk;
unsigned short int usVal=p_str->toUShort(&bOk);
@ -887,13 +887,13 @@ void KviConfig::writeEntry(const char *szKey,unsigned long lValue)
KviStrDict * p_group = getCurrentGroup();
KviStr *p_data = new KviStr();
p_data->setNum(lValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
unsigned long KviConfig::readULongEntry(const char *szKey,unsigned long lDefault)
{
KviStrDict * p_group = getCurrentGroup();
KviStr * p_str = p_group->tqfind(szKey);
KviStr * p_str = p_group->find(szKey);
if(!p_str)return lDefault;
bool bOk;
unsigned long lVal=p_str->toULong(&bOk);
@ -909,13 +909,13 @@ void KviConfig::writeEntry(const TQString & szKey,int iValue)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString();
p_data->setNum(iValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
int KviConfig::readIntEntry(const TQString & szKey,int iDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return iDefault;
bool bOk;
int iVal=p_str->toInt(&bOk);
@ -930,13 +930,13 @@ void KviConfig::writeEntry(const TQString & szKey,unsigned int iValue)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString();
p_data->setNum(iValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
unsigned int KviConfig::readUIntEntry(const TQString & szKey,unsigned int iDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return iDefault;
bool bOk;
unsigned int iVal=p_str->toUInt(&bOk);
@ -951,13 +951,13 @@ void KviConfig::writeEntry(const TQString & szKey,char iValue)
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_data = new TQString();
p_data->setNum(iValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
char KviConfig::readCharEntry(const TQString & szKey,char iDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return iDefault;
bool bOk;
char iVal=(char)p_str->toInt(&bOk);
@ -972,13 +972,13 @@ void KviConfig::writeEntry(const TQString & szKey,unsigned char iValue)
KviConfigGroup * p_group = getCurrentGroup();
TQString *p_data = new TQString();
p_data->setNum(iValue);
p_group->tqreplace(szKey,p_data);
p_group->replace(szKey,p_data);
}
unsigned char KviConfig::readUCharEntry(const TQString & szKey,unsigned char iDefault)
{
KviConfigGroup * p_group = getCurrentGroup();
TQString * p_str = p_group->tqfind(szKey);
TQString * p_str = p_group->find(szKey);
if(!p_str)return iDefault;
bool bOk;
unsigned char iVal=(unsigned char)p_str->toUInt(&bOk);

@ -200,7 +200,7 @@
void KviCryptEngineManager::registerEngine(KviCryptEngineDescription * d)
{
m_pEngineDict->tqreplace(d->szName,d);
m_pEngineDict->replace(d->szName,d);
}
void KviCryptEngineManager::unregisterEngine(const TQString &szName)
@ -222,7 +222,7 @@
KviCryptEngine * KviCryptEngineManager::allocateEngine(const TQString &szName)
{
KviCryptEngineDescription * d = m_pEngineDict->tqfind(szName);
KviCryptEngineDescription * d = m_pEngineDict->find(szName);
if(!d)return 0;
KviCryptEngine * e = d->allocFunc();
if(!e)return 0;

@ -56,7 +56,7 @@ KviDataBuffer::~KviDataBuffer()
}
}
int KviDataBuffer::tqfind(const unsigned char * block,int uSize)
int KviDataBuffer::find(const unsigned char * block,int uSize)
{
if(uSize < 1)return -1;
if(uSize > m_uSize)return -1;
@ -85,7 +85,7 @@ int KviDataBuffer::tqfind(const unsigned char * block,int uSize)
return -1;
}
int KviDataBuffer::tqfind(unsigned char c)
int KviDataBuffer::find(unsigned char c)
{
const unsigned char * p = m_pData;
const unsigned char * e = p + m_uSize;

@ -49,8 +49,8 @@ public:
void addSize(int uSize){ resize(m_uSize + uSize); };
void append(const unsigned char * data,int uSize);
void append(const KviDataBuffer &b){ append(b.data(),b.size()); };
int tqfind(unsigned char c);
int tqfind(const unsigned char * block,int uSize);
int find(unsigned char c);
int find(const unsigned char * block,int uSize);
};
#endif //_KVI_DATABUFFER_H_

@ -62,7 +62,7 @@ void KviGarbageCollector::garbageSuicide()
debug("Ops... garbage suicide while no garbage list");
return;
}
int idx = m_pGarbageList->tqfindRef(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())));
int idx = m_pGarbageList->findRef(TQT_TQOBJECT(const_cast<TQT_BASE_OBJECT_NAME*>(sender())));
if(idx == -1)
{
debug("Ops... unregistered garbage suicide");

@ -25,7 +25,7 @@
//
// A class to manage multiple image libraries.
// The library is in fact a big image that tqcontains
// The library is in fact a big image that contains
// several rows of other smaller images of the same size.
// The images inside the 'library' are indexed in the following way:
//

@ -165,7 +165,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m)
} // else the current has no wildcards...skip
} else {
// the new tqmask has no wildcards....
if(mt->szFileMask.tqcontains('*'))
if(mt->szFileMask.contains('*'))
{
// current one has wildcards...insert
m_pMediaTypeList->insert(index,m);
@ -188,7 +188,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m)
// the masks with no wildcards go first
// longer masks go first
bool bHasWildcards = m->szFileMask.tqcontains('*');
bool bHasWildcards = m->szFileMask.contains('*');
int index = 0;
for(KviMediaType * mt = m_pMediaTypeList->first();mt;mt = m_pMediaTypeList->next())
{
@ -207,7 +207,7 @@ void KviMediaManager::insertMediaType(KviMediaType * m)
}
}
} else {
if(mt->szFileMask.tqcontains('*'))
if(mt->szFileMask.contains('*'))
{
m_pMediaTypeList->insert(index,m);
return;

@ -99,9 +99,9 @@ void KviRegisteredChannelDataBase::save(const char * filename)
}
}
KviRegisteredChannel * KviRegisteredChannelDataBase::tqfind(const char * name,const char * net)
KviRegisteredChannel * KviRegisteredChannelDataBase::find(const char * name,const char * net)
{
KviRegisteredChannelList * l = m_pChannelDict->tqfind(name);
KviRegisteredChannelList * l = m_pChannelDict->find(name);
if(!l)return 0;
for(KviRegisteredChannel * c = l->first();c;c = l->next())
{
@ -113,7 +113,7 @@ KviRegisteredChannel * KviRegisteredChannelDataBase::tqfind(const char * name,co
KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name,const char * nettqmask)
{
KviRegisteredChannelList * l = m_pChannelDict->tqfind(name);
KviRegisteredChannelList * l = m_pChannelDict->find(name);
if(!l)return 0;
for(KviRegisteredChannel * c = l->first();c;c = l->next())
{
@ -124,7 +124,7 @@ KviRegisteredChannel * KviRegisteredChannelDataBase::findExact(const char * name
void KviRegisteredChannelDataBase::remove(KviRegisteredChannel * c)
{
KviRegisteredChannelList * l = m_pChannelDict->tqfind(c->name().ptr());
KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr());
if(!l)return;
for(KviRegisteredChannel * ch = l->first();ch;ch = l->next())
{
@ -156,7 +156,7 @@ void KviRegisteredChannelDataBase::add(KviRegisteredChannel * c)
}
remove(old);
}
KviRegisteredChannelList * l = m_pChannelDict->tqfind(c->name().ptr());
KviRegisteredChannelList * l = m_pChannelDict->find(c->name().ptr());
if(!l)
{
l = new KviRegisteredChannelList;

@ -45,9 +45,9 @@ public:
KviPointerHashTable<const char *,KviStr> * propertyDict(){ return m_pPropertyDict; };
const KviStr & name(){ return m_szName; };
const KviStr & netMask(){ return m_szNetMask; };
KviStr * property(const char * name){ return m_pPropertyDict->tqfind(name); };
KviStr * property(const char * name){ return m_pPropertyDict->find(name); };
// val must be allocated with NEW!
void setProperty(const char * name,KviStr * val){ m_pPropertyDict->tqreplace(name,val); };
void setProperty(const char * name,KviStr * val){ m_pPropertyDict->replace(name,val); };
void removeProperty(const char * name){ m_pPropertyDict->remove(name); };
};
@ -62,7 +62,7 @@ protected:
KviPointerHashTable<const char *,KviRegisteredChannelList> * m_pChannelDict;
public:
KviPointerHashTable<const char *,KviRegisteredChannelList> * channelDict(){ return m_pChannelDict; };
KviRegisteredChannel * tqfind(const char * name,const char * net);
KviRegisteredChannel * find(const char * name,const char * net);
KviRegisteredChannel * findExact(const char * name,const char * nettqmask);
void remove(KviRegisteredChannel * c);
void add(KviRegisteredChannel * c);

@ -237,7 +237,7 @@ void KviRegisteredUser::setProperty(const TQString & name,const TQString & value
#endif
if(!val->isEmpty())
{
m_pPropertyDict->tqreplace(name,val);
m_pPropertyDict->replace(name,val);
} else {
delete val;
val = 0;
@ -251,7 +251,7 @@ bool KviRegisteredUser::getProperty(const TQString & name,TQString &value)
{
if(!m_pPropertyDict)return false;
if(name.isEmpty()) return false;
TQString * pValue = m_pPropertyDict->tqfind(name);
TQString * pValue = m_pPropertyDict->find(name);
if(pValue)value = *pValue;
else return false;
return true;
@ -261,7 +261,7 @@ const TQString & KviRegisteredUser::getProperty(const TQString & name)
{
if(!m_pPropertyDict)return KviTQString::empty;
if(name.isEmpty())return KviTQString::empty;
TQString * pValue = m_pPropertyDict->tqfind(name);
TQString * pValue = m_pPropertyDict->find(name);
if(pValue)return *pValue;
return KviTQString::empty;
}
@ -270,7 +270,7 @@ bool KviRegisteredUser::getBoolProperty(const TQString & name,bool def)
{
if(!m_pPropertyDict)return def;
if(name.isEmpty()) return def;
TQString * pValue = m_pPropertyDict->tqfind(name);
TQString * pValue = m_pPropertyDict->find(name);
if(pValue)
{
// be flexible , allow more "true" values (pragma)
@ -331,9 +331,9 @@ KviRegisteredUserDataBase::~KviRegisteredUserDataBase()
KviRegisteredUser * KviRegisteredUserDataBase::addUser(const TQString & name)
{
if(name.isEmpty()) return false;
if(m_pUserDict->tqfind(name))return 0;
if(m_pUserDict->find(name))return 0;
KviRegisteredUser * u = new KviRegisteredUser(name);
m_pUserDict->tqreplace(u->name(),u); //u->name() because we're NOT copying keys!
m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys!
emit(userAdded(name));
return u;
}
@ -341,20 +341,20 @@ KviRegisteredUser * KviRegisteredUserDataBase::addUser(const TQString & name)
KviRegisteredUserGroup * KviRegisteredUserDataBase::addGroup(const TQString & name)
{
if(name.isEmpty()) return false;
if(m_pGroupDict->tqfind(name))return 0;
if(m_pGroupDict->find(name))return 0;
KviRegisteredUserGroup * pGroup = new KviRegisteredUserGroup(name);
m_pGroupDict->tqreplace(pGroup->name(),pGroup); //u->name() because we're NOT copying keys!
m_pGroupDict->replace(pGroup->name(),pGroup); //u->name() because we're NOT copying keys!
return pGroup;
}
KviRegisteredUser * KviRegisteredUserDataBase::getUser(const TQString & name)
{
if(name.isEmpty()) return 0;
KviRegisteredUser * u = m_pUserDict->tqfind(name);
KviRegisteredUser * u = m_pUserDict->find(name);
if(!u)
{
u = new KviRegisteredUser(name);
m_pUserDict->tqreplace(u->name(),u); //u->name() because we're NOT copying keys!
m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys!
}
return u;
}
@ -378,7 +378,7 @@ static void append_mask_to_list(KviRegisteredMaskList *l,KviRegisteredUser *u,Kv
KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,KviIrcMask * tqmask)
{
if(!u || !tqmask) return 0;
__range_valid(u == m_pUserDict->tqfind(u->name()));
__range_valid(u == m_pUserDict->find(u->name()));
KviRegisteredMaskList * l;
if(tqmask->hasWildNick())
@ -396,7 +396,7 @@ KviRegisteredUser * KviRegisteredUserDataBase::addMask(KviRegisteredUser * u,Kvi
// masks with more info go first in the list
l = m_pWildMaskList;
} else {
l = m_pMaskDict->tqfind(tqmask->nick());
l = m_pMaskDict->find(tqmask->nick());
if(l)
{
// FIXME: #warning "Here we could compare the host and username only: nick matches for sure"
@ -486,7 +486,7 @@ void KviRegisteredUserDataBase::copyFrom(KviRegisteredUserDataBase * db)
bool KviRegisteredUserDataBase::removeUser(const TQString & name)
{
if(name.isEmpty()) return false;
KviRegisteredUser *