rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


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

@ -126,7 +126,7 @@ class Player(object):
if mode and mode != self.displayName: if mode and mode != self.displayName:
self._format['intro']=self._format[mode] self._format['intro']=self._format[mode]
else: else:
self._format['intro']=self._format[self.type.tqreplace(',','').split()[0]] self._format['intro']=self._format[self.type.replace(',','').split()[0]]
return string.Template(outputFormat).safe_substitute(self._format) return string.Template(outputFormat).safe_substitute(self._format)
return '' return ''
@ -167,7 +167,7 @@ class Player(object):
try: try:
input = input.decode('latin-1') input = input.decode('latin-1')
except UnicodeError: except UnicodeError:
input = input.decode('ascii', 'tqreplace') input = input.decode('ascii', 'replace')
except NameError: except NameError:
pass pass
return input.encode('utf-8') return input.encode('utf-8')

@ -146,7 +146,7 @@ void Autoreplace_Config::saveSettings()
for(unsigned int index=0;index<newList.count();index++) for(unsigned int index=0;index<newList.count();index++)
{ {
// write the current entry's pattern and replacement (adds a "#" to preserve blanks at the end of the line) // write the current entry's pattern and replacement (adds a "#" to preserve blanks at the end of the line)
config->writeEntry(TQString("Autotqreplace%1").tqarg(index),newList[index]+'#'); config->writeEntry(TQString("Autoreplace%1").tqarg(index),newList[index]+'#');
} // for } // for
} }
// if there were no entries at all, write a dummy entry to prevent KConfigXT from "optimizing" // if there were no entries at all, write a dummy entry to prevent KConfigXT from "optimizing"

@ -122,7 +122,7 @@ void AwayManager::identityOnline(int identityId)
IdentityPtr identity = Preferences::identityById(identityId); IdentityPtr identity = Preferences::identityById(identityId);
if (identity && identity->getAutomaticAway() && if (identity && identity->getAutomaticAway() &&
!m_identitiesOnAutoAway.tqcontains(identityId)) !m_identitiesOnAutoAway.contains(identityId))
{ {
m_identitiesOnAutoAway.append(identityId); m_identitiesOnAutoAway.append(identityId);
@ -132,7 +132,7 @@ void AwayManager::identityOnline(int identityId)
void AwayManager::identityOffline(int identityId) void AwayManager::identityOffline(int identityId)
{ {
if (m_identitiesOnAutoAway.tqcontains(identityId)) if (m_identitiesOnAutoAway.contains(identityId))
{ {
m_identitiesOnAutoAway.remove(identityId); m_identitiesOnAutoAway.remove(identityId);
@ -245,7 +245,7 @@ void AwayManager::implementIdleAutoAway(bool activity)
{ {
IdentityPtr identity = server->getIdentity(); IdentityPtr identity = server->getIdentity();
if (m_identitiesOnAutoAway.tqcontains(identity->id()) && identity->getAutomaticUnaway() if (m_identitiesOnAutoAway.contains(identity->id()) && identity->getAutomaticUnaway()
&& server->isConnected() && server->isAway()) && server->isConnected() && server->isAway())
{ {
server->requestUnaway(); server->requestUnaway();
@ -272,7 +272,7 @@ void AwayManager::implementIdleAutoAway(bool activity)
{ {
int identityId = server->getIdentity()->id(); int identityId = server->getIdentity()->id();
if (identitiesIdleTimeExceeded.tqcontains(identityId) && server->isConnected() && !server->isAway()) if (identitiesIdleTimeExceeded.contains(identityId) && server->isConnected() && !server->isAway())
server->requestAway(); server->requestAway();
} }
} }
@ -289,7 +289,7 @@ void AwayManager::setManagedIdentitiesAway()
for (server = serverList.first(); server; server = serverList.next()) for (server = serverList.first(); server; server = serverList.next())
{ {
if (m_identitiesOnAutoAway.tqcontains(server->getIdentity()->id()) && server->isConnected() && !server->isAway()) if (m_identitiesOnAutoAway.contains(server->getIdentity()->id()) && server->isConnected() && !server->isAway())
server->requestAway(); server->requestAway();
} }
} }
@ -303,7 +303,7 @@ void AwayManager::setManagedIdentitiesUnaway()
{ {
IdentityPtr identity = server->getIdentity(); IdentityPtr identity = server->getIdentity();
if (m_identitiesOnAutoAway.tqcontains(identity->id()) && identity->getAutomaticUnaway() if (m_identitiesOnAutoAway.contains(identity->id()) && identity->getAutomaticUnaway()
&& server->isConnected() && server->isAway()) && server->isConnected() && server->isAway())
{ {
server->requestUnaway(); server->requestUnaway();

@ -15,7 +15,7 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Mouser 1/14/05 // Mouser 1/14/05
// I'm not sure this implementation of cbc is exactly the same as other cbc // I'm not sure this implementation of cbc is exactly the same as other cbc
// algorithms you may tqfind, though the different is insignificant and just // algorithms you may find, though the different is insignificant and just
// requires you to call your other algorithm slightly differently. // requires you to call your other algorithm slightly differently.
// This blowfish cbc class basically pretends that the IV is 00000000 but // This blowfish cbc class basically pretends that the IV is 00000000 but
// but that the first 8byte block of the plaintext to encrypt is treated // but that the first 8byte block of the plaintext to encrypt is treated

@ -15,7 +15,7 @@
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Mouser 1/14/05 // Mouser 1/14/05
// I'm not sure this implementation of cbc is exactly the same as other cbc // I'm not sure this implementation of cbc is exactly the same as other cbc
// algorithms you may tqfind, though the difference is insignificant and just // algorithms you may find, though the difference is insignificant and just
// requires you to call your other algorithm slightly differently. // requires you to call your other algorithm slightly differently.
// This blowfish cbc class basically pretends that the IV is 00000000 but // This blowfish cbc class basically pretends that the IV is 00000000 but
// but that the first 8byte block of the plaintext to encrypt is treated // but that the first 8byte block of the plaintext to encrypt is treated

@ -661,18 +661,18 @@ void Channel::popupCommand(int id)
if (!pattern.isEmpty()) if (!pattern.isEmpty())
{ {
pattern.tqreplace("%c",getName()); pattern.replace("%c",getName());
TQString command; TQString command;
if (pattern.tqcontains("%l")) if (pattern.contains("%l"))
{ {
TQStringList list; TQStringList list;
for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it) for (TQStringList::Iterator it=nickList.begin(); it!=nickList.end(); ++it)
list.append((*it)); list.append((*it));
command = pattern.tqreplace("%l", list.join(" ")); command = pattern.replace("%l", list.join(" "));
if (raw) if (raw)
m_server->queue(command); m_server->queue(command);
@ -688,7 +688,7 @@ void Channel::popupCommand(int id)
for (unsigned int index = 0; index<patternList.count(); index++) for (unsigned int index = 0; index<patternList.count(); index++)
{ {
command = patternList[index]; command = patternList[index];
command.tqreplace("%u", (*it)); command.replace("%u", (*it));
if (raw) if (raw)
m_server->queue(command); m_server->queue(command);
@ -817,7 +817,7 @@ void Channel::completeNick()
{ {
TQString lookNick = nicknameList.at(completionPosition)->getChannelNick()->getNickname(); TQString lookNick = nicknameList.at(completionPosition)->getChannelNick()->getNickname();
if(!prefixCharacter.isEmpty() && lookNick.tqcontains(prefixCharacter)) if(!prefixCharacter.isEmpty() && lookNick.contains(prefixCharacter))
{ {
lookNick = lookNick.section( prefixCharacter,1 ); lookNick = lookNick.section( prefixCharacter,1 );
} }
@ -904,7 +904,7 @@ bool Channel::autoJoin()
Konversation::ChannelList channelList = m_server->getServerGroup()->channelList(); Konversation::ChannelList channelList = m_server->getServerGroup()->channelList();
if (!channelList.empty()) if (!channelList.empty())
return channelList.tqfind(channelSettings()) != channelList.end(); return channelList.find(channelSettings()) != channelList.end();
else else
return false; return false;
} }
@ -1183,7 +1183,7 @@ void Channel::quickButtonClicked(const TQString &buttonText)
TQString out=m_server->parseWildcards(buttonText,m_server->getNickname(),getName(),getPassword(),getSelectedNickList(),TQString()); TQString out=m_server->parseWildcards(buttonText,m_server->getNickname(),getName(),getPassword(),getSelectedNickList(),TQString());
// are there any newlines in the definition? // are there any newlines in the definition?
if(out.tqfind('\n')!=-1) if(out.find('\n')!=-1)
sendChannelText(out); sendChannelText(out);
// single line without newline needs to be copied into input line // single line without newline needs to be copied into input line
else else
@ -1295,7 +1295,7 @@ void Channel::removeNick(ChannelNickPtr channelNick, const TQString &reason, boo
if(!displayReason.isEmpty()) if(!displayReason.isEmpty())
{ {
// if the reason contains text markup characters, play it safe and reset all // if the reason contains text markup characters, play it safe and reset all
if(displayReason.tqfind(TQRegExp("[\\0000-\\0037]")) != -1) if(displayReason.find(TQRegExp("[\\0000-\\0037]")) != -1)
displayReason += "\017"; displayReason += "\017";
} }
@ -1366,7 +1366,7 @@ void Channel::kickNick(ChannelNickPtr channelNick, const TQString &kicker, const
if(!displayReason.isEmpty()) if(!displayReason.isEmpty())
{ {
// if the reason contains text markup characters, play it safe and reset all // if the reason contains text markup characters, play it safe and reset all
if(displayReason.tqfind(TQRegExp("[\\0000-\\0037]")) != -1) if(displayReason.find(TQRegExp("[\\0000-\\0037]")) != -1)
displayReason += "\017"; displayReason += "\017";
} }
@ -2071,7 +2071,7 @@ void Channel::updateModeWidgets(char mode, bool plus, const TQString &parameter)
for(TQStringList::iterator it = removable.begin(); it != removable.end(); ++it) for(TQStringList::iterator it = removable.begin(); it != removable.end(); ++it)
{ {
m_modeList.remove(m_modeList.tqfind((*it))); m_modeList.remove(m_modeList.find((*it)));
} }
} }
emit modesChanged(); emit modesChanged();
@ -2114,9 +2114,9 @@ void Channel::updateQuickButtons(const TQStringList &newButtonList)
quickButton->setDefinition(buttonText); quickButton->setDefinition(buttonText);
// Add tool tips // Add tool tips
TQString toolTip=buttonText.tqreplace("&","&amp;"). TQString toolTip=buttonText.replace("&","&amp;").
tqreplace("<","&lt;"). replace("<","&lt;").
tqreplace(">","&gt;"); replace(">","&gt;");
TQToolTip::add(quickButton,toolTip); TQToolTip::add(quickButton,toolTip);
@ -2871,7 +2871,7 @@ TQString NickList::completeNick(const TQString& pattern, bool& complete, TQStrin
NickList foundNicks; NickList foundNicks;
foundNicks.setCompareMethod(NickList::TimeStamp); foundNicks.setCompareMethod(NickList::TimeStamp);
if((pattern.tqfind(TQRegExp("^(\\d|\\w)")) != -1) && skipNonAlfaNum) if((pattern.find(TQRegExp("^(\\d|\\w)")) != -1) && skipNonAlfaNum)
{ {
prefix = "^([^\\d\\w]|[\\_]){0,}"; prefix = "^([^\\d\\w]|[\\_]){0,}";
} }
@ -2884,12 +2884,12 @@ TQString NickList::completeNick(const TQString& pattern, bool& complete, TQStrin
{ {
newNick = it.current()->getChannelNick()->getNickname(); newNick = it.current()->getChannelNick()->getNickname();
if(!prefix.isEmpty() && newNick.tqcontains(prefixCharacter)) if(!prefix.isEmpty() && newNick.contains(prefixCharacter))
{ {
newNick = newNick.section( prefixCharacter,1 ); newNick = newNick.section( prefixCharacter,1 );
} }
if(newNick.tqfind(regexp) != -1) if(newNick.find(regexp) != -1)
{ {
foundNicks.append(it.current()); foundNicks.append(it.current());
} }
@ -2956,5 +2956,5 @@ bool NickList::containsNick(const TQString& nickname)
#include "channel.moc" #include "channel.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -236,7 +236,7 @@ void ChannelListPanel::saveList()
{ {
TQString channelName; TQString channelName;
channelName.fill(' ',maxChannelWidth); channelName.fill(' ',maxChannelWidth);
channelName.tqreplace(0,item->text(0).length(),item->text(0)); channelName.replace(0,item->text(0).length(),item->text(0));
TQString nicksPad; TQString nicksPad;
nicksPad.fill(' ',maxNicksWidth); nicksPad.fill(' ',maxNicksWidth);
@ -440,12 +440,12 @@ void ChannelListPanel::applyFilterToItem(TQListViewItem* item)
{ {
if(getChannelTarget()) if(getChannelTarget())
{ {
if(item->text(0).tqfind(TQRegExp(getFilterText(),false,!getRegExp()))==-1) visible=false; if(item->text(0).find(TQRegExp(getFilterText(),false,!getRegExp()))==-1) visible=false;
} }
if(getTopicTarget()) if(getTopicTarget())
{ {
if(item->text(2).tqfind(TQRegExp(getFilterText(),false,!getRegExp()))==-1) visible=false; if(item->text(2).find(TQRegExp(getFilterText(),false,!getRegExp()))==-1) visible=false;
} }
} }
@ -537,8 +537,8 @@ void ChannelListPanel::contextMenu (KListView* /* l */, TQListViewItem* i, const
else if(href.startsWith("ftp.")) href="ftp://"+href; else if(href.startsWith("ftp.")) href="ftp://"+href;
// Replace all spaces with %20 in href // Replace all spaces with %20 in href
href.tqreplace(' ', "%20"); href.replace(' ', "%20");
href.tqreplace('&', "&&"); href.replace('&', "&&");
// next search begins right after the link // next search begins right after the link
pos+=url.length(); pos+=url.length();
@ -561,8 +561,8 @@ void ChannelListPanel::contextMenu (KListView* /* l */, TQListViewItem* i, const
int selected = showURLmenu->exec(p); int selected = showURLmenu->exec(p);
if (selected!=-1) if (selected!=-1)
{ {
TQMenuItem* item = showURLmenu->tqfindItem( selected ); TQMenuItem* item = showURLmenu->findItem( selected );
new KRun(KURL(item->text().tqreplace("&&","&"))); new KRun(KURL(item->text().replace("&&","&")));
} }
delete showURLmenu; delete showURLmenu;

@ -160,7 +160,7 @@ namespace Konversation
TQString ChannelOptionsDialog::topic() TQString ChannelOptionsDialog::topic()
{ {
return m_widget->topicEdit->text().tqreplace("\n"," "); return m_widget->topicEdit->text().replace("\n"," ");
} }
void ChannelOptionsDialog::refreshTopicHistory() void ChannelOptionsDialog::refreshTopicHistory()
@ -388,7 +388,7 @@ namespace Konversation
void ChannelOptionsDialog::removeBan(const TQString& ban) void ChannelOptionsDialog::removeBan(const TQString& ban)
{ {
delete m_widget->banList->tqfindItem(ban, 0); delete m_widget->banList->findItem(ban, 0);
} }
void ChannelOptionsDialog::banEdited(TQListViewItem *edited) void ChannelOptionsDialog::banEdited(TQListViewItem *edited)

@ -226,7 +226,7 @@ void ChatWindow::setLogfileName(const TQString& name)
else if (m_server) else if (m_server)
{ {
// make sure that no path delimiters are in the name // make sure that no path delimiters are in the name
logName = TQString(TQString(m_server->getDisplayName().lower()).append('_').append(name).append(".log")).tqreplace('/','_'); logName = TQString(TQString(m_server->getDisplayName().lower()).append('_').append(name).append(".log")).replace('/','_');
} }
// load backlog to show // load backlog to show
@ -283,12 +283,12 @@ void ChatWindow::setLogfileName(const TQString& name)
if(backlog.tqdevice()->at() == filePosition) backlog.tqdevice()->at(filePosition + 1); if(backlog.tqdevice()->at() == filePosition) backlog.tqdevice()->at(filePosition + 1);
// if a tab character is present in the line // if a tab character is present in the line
if(backlogLine.tqfind('\t') != -1) if(backlogLine.find('\t') != -1)
{ {
// extract first column from log // extract first column from log
TQString backlogFirst = backlogLine.left(backlogLine.tqfind('\t')); TQString backlogFirst = backlogLine.left(backlogLine.find('\t'));
// cut first column from line // cut first column from line
backlogLine = backlogLine.mid(backlogLine.tqfind('\t') + 1); backlogLine = backlogLine.mid(backlogLine.find('\t') + 1);
// Logfile is in utf8 so we don't need to do encoding stuff here // Logfile is in utf8 so we don't need to do encoding stuff here
// append backlog with time and first column to text view // append backlog with time and first column to text view
firstColumnsInPacket << backlogFirst; firstColumnsInPacket << backlogFirst;

@ -68,7 +68,7 @@ namespace Konversation
link = "<a href=\"#%1\">%2</a>"; link = "<a href=\"#%1\">%2</a>";
} }
if(filteredLine.tqcontains("#")) if(filteredLine.contains("#"))
{ {
TQRegExp chanExp("(^|\\s|^\"|\\s\"|,|'|\\(|\\:|!|@|%|\\+)(#[^,\\s;\\)\\:\\/\\(\\<\\>]*[^.,\\s;\\)\\:\\/\\(\"\''\\<\\>])"); TQRegExp chanExp("(^|\\s|^\"|\\s\"|,|'|\\(|\\:|!|@|%|\\+)(#[^,\\s;\\)\\:\\/\\(\\<\\>]*[^.,\\s;\\)\\:\\/\\(\"\''\\<\\>])");
while((pos = chanExp.search(filteredLine, pos)) >= 0) while((pos = chanExp.search(filteredLine, pos)) >= 0)
@ -78,8 +78,8 @@ namespace Konversation
pos += chanExp.cap(1).length(); pos += chanExp.cap(1).length();
// HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit // HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit
insertText = link.tqarg(TQString(href).tqreplace('\\', " "), href); insertText = link.tqarg(TQString(href).replace('\\', " "), href);
filteredLine.tqreplace(pos, urlLen, insertText); filteredLine.replace(pos, urlLen, insertText);
pos += insertText.length(); pos += insertText.length();
} }
} }
@ -104,7 +104,7 @@ namespace Konversation
TQString append; TQString append;
// check if the matched text is already replaced as a channel // check if the matched text is already replaced as a channel
if ( filteredLine.tqfindRev( "<a", pos ) > filteredLine.tqfindRev( "</a>", pos ) ) if ( filteredLine.findRev( "<a", pos ) > filteredLine.findRev( "</a>", pos ) )
{ {
++pos; ++pos;
continue; continue;
@ -131,7 +131,7 @@ namespace Konversation
// Don't consider trailing closing parenthesis part of link when // Don't consider trailing closing parenthesis part of link when
// there's an opening parenthesis preceding the beginning of the // there's an opening parenthesis preceding the beginning of the
// URL or there is no opening parenthesis in the URL at all. // URL or there is no opening parenthesis in the URL at all.
if (href.right(1) == ")" && (filteredLine.mid(pos-1,1) == "(" || !href.tqcontains("("))) if (href.right(1) == ")" && (filteredLine.mid(pos-1,1) == "(" || !href.contains("(")))
{ {
href.truncate(href.length()-1); href.truncate(href.length()-1);
append.prepend(")"); append.prepend(")");
@ -151,15 +151,15 @@ namespace Konversation
// Use \x0b as a placeholder for & so we can readd them after changing all & in the normal text to &amp; // Use \x0b as a placeholder for & so we can readd them after changing all & in the normal text to &amp;
// HACK Replace % with \x03 in the url to keep TQt from doing stupid things // HACK Replace % with \x03 in the url to keep TQt from doing stupid things
insertText = link.tqarg(protocol, TQString(href).tqreplace('&', "\x0b").tqreplace('%', "\x03"), href) + append; insertText = link.tqarg(protocol, TQString(href).replace('&', "\x0b").replace('%', "\x03"), href) + append;
filteredLine.tqreplace(pos, urlLen, insertText); filteredLine.replace(pos, urlLen, insertText);
pos += insertText.length(); pos += insertText.length();
KonversationApplication::instance()->storeUrl(fromNick, href); KonversationApplication::instance()->storeUrl(fromNick, href);
} }
// Change & to &amp; to prevent html entities to do strange things to the text // Change & to &amp; to prevent html entities to do strange things to the text
filteredLine.tqreplace('&', "&amp;"); filteredLine.replace('&', "&amp;");
filteredLine.tqreplace("\x0b", "&"); filteredLine.replace("\x0b", "&");
// kdDebug() << "Took (msecs) : " << timer.elapsed() << " for " << filteredLine << endl; // kdDebug() << "Took (msecs) : " << timer.elapsed() << " for " << filteredLine << endl;

@ -330,7 +330,7 @@ const TQMap<int, TQStringList> Preferences::notifyList() { return self()->mNotif
const TQStringList Preferences::notifyListByGroupName(const TQString& groupName) const TQStringList Preferences::notifyListByGroupName(const TQString& groupName)
{ {
int id=serverGroupIdByName(groupName); int id=serverGroupIdByName(groupName);
if (id && self()->mNotifyList.tqfind(id) != self()->mNotifyList.end()) if (id && self()->mNotifyList.find(id) != self()->mNotifyList.end())
return self()->mNotifyList[id]; return self()->mNotifyList[id];
else else
return TQStringList(); return TQStringList();
@ -343,7 +343,7 @@ const TQString Preferences::notifyStringByGroupName(const TQString& groupName)
bool Preferences::addNotify(int serverGroupId, const TQString& newPattern) bool Preferences::addNotify(int serverGroupId, const TQString& newPattern)
{ {
if (!self()->mNotifyList[serverGroupId].tqcontains(newPattern)) if (!self()->mNotifyList[serverGroupId].contains(newPattern))
{ {
TQStringList nicknameList = self()->mNotifyList[serverGroupId]; TQStringList nicknameList = self()->mNotifyList[serverGroupId];
nicknameList.append(newPattern); nicknameList.append(newPattern);
@ -358,7 +358,7 @@ bool Preferences::removeNotify(const TQString& groupName, const TQString& patter
int id=serverGroupIdByName(groupName); int id=serverGroupIdByName(groupName);
if(!id) return false; if(!id) return false;
if (self()->mNotifyList.tqfind(id) != self()->mNotifyList.end()) if (self()->mNotifyList.find(id) != self()->mNotifyList.end())
{ {
TQStringList nicknameList = self()->mNotifyList[id]; TQStringList nicknameList = self()->mNotifyList[id];
nicknameList.remove(pattern); nicknameList.remove(pattern);
@ -373,18 +373,18 @@ bool Preferences::removeNotify(const TQString& groupName, const TQString& patter
bool Preferences::isNotify(int serverGroupId, const TQString& pattern) bool Preferences::isNotify(int serverGroupId, const TQString& pattern)
{ {
if (self()->mNotifyList.tqfind(serverGroupId) != self()->mNotifyList.end()) if (self()->mNotifyList.find(serverGroupId) != self()->mNotifyList.end())
{ {
TQStringList nicknameList = self()->mNotifyList[serverGroupId]; TQStringList nicknameList = self()->mNotifyList[serverGroupId];
if (nicknameList.tqcontains(pattern)) return true; if (nicknameList.contains(pattern)) return true;
} }
return false; return false;
} }
bool Preferences::hasNotifyList(int serverGroupId) bool Preferences::hasNotifyList(int serverGroupId)
{ {
if (self()->mNotifyList.tqfind(serverGroupId) != self()->mNotifyList.end()) if (self()->mNotifyList.find(serverGroupId) != self()->mNotifyList.end())
return true; return true;
else else
return false; return false;
@ -562,8 +562,8 @@ const TQString Preferences::channelEncoding(const TQString& server,const TQStrin
const TQString Preferences::channelEncoding(int serverGroupId,const TQString& channel) const TQString Preferences::channelEncoding(int serverGroupId,const TQString& channel)
{ {
if(self()->mChannelEncodingsMap.tqcontains(serverGroupId)) if(self()->mChannelEncodingsMap.contains(serverGroupId))
if(self()->mChannelEncodingsMap[serverGroupId].tqcontains(channel.lower())) if(self()->mChannelEncodingsMap[serverGroupId].contains(channel.lower()))
return self()->mChannelEncodingsMap[serverGroupId][channel.lower()]; return self()->mChannelEncodingsMap[serverGroupId][channel.lower()];
return TQString(); return TQString();
} }
@ -598,7 +598,7 @@ TQString Preferences::webBrowserCmd()
{ {
// add %u to command if it's not in there // add %u to command if it's not in there
TQString cmd=self()->mWebBrowserCmd; TQString cmd=self()->mWebBrowserCmd;
if(cmd.tqfind("%u")==-1) cmd+=" %u"; if(cmd.find("%u")==-1) cmd+=" %u";
return cmd; return cmd;
} }

@ -146,7 +146,7 @@ void ConnectionManager::handleConnectionStateChange(Server* server, Konversation
if (state == Konversation::SSConnected) if (state == Konversation::SSConnected)
{ {
if (!m_activeIdentities.tqcontains(identityId)) if (!m_activeIdentities.contains(identityId))
{ {
m_activeIdentities.append(identityId); m_activeIdentities.append(identityId);
@ -155,7 +155,7 @@ void ConnectionManager::handleConnectionStateChange(Server* server, Konversation
} }
else if (state != Konversation::SSConnecting) else if (state != Konversation::SSConnecting)
{ {
if (m_activeIdentities.tqcontains(identityId)) if (m_activeIdentities.contains(identityId))
{ {
m_activeIdentities.remove(identityId); m_activeIdentities.remove(identityId);
@ -191,7 +191,7 @@ void ConnectionManager::handleReconnect(Server* server)
{ {
Konversation::ServerList serverList = settings.serverGroup()->serverList(); Konversation::ServerList serverList = settings.serverGroup()->serverList();
int index = serverList.tqfindIndex(settings.server()); int index = serverList.findIndex(settings.server());
int size = serverList.size(); int size = serverList.size();
if (index == size - 1 || index == -1) if (index == size - 1 || index == -1)
@ -246,7 +246,7 @@ void ConnectionManager::decodeIrcUrl(const TQString& url, ConnectionSettings& se
mangledUrlSegments = TQStringList::split('/', mangledUrl, false); mangledUrlSegments = TQStringList::split('/', mangledUrl, false);
// Check for ",isserver". // Check for ",isserver".
if (mangledUrlSegments[0].tqcontains(',')) if (mangledUrlSegments[0].contains(','))
{ {
TQStringList addressSegments; TQStringList addressSegments;
bool checkIfServerGroup = true; bool checkIfServerGroup = true;
@ -271,7 +271,7 @@ void ConnectionManager::decodeIrcUrl(const TQString& url, ConnectionSettings& se
if (!channel.isEmpty()) if (!channel.isEmpty())
{ {
// Add default prefix to channel if necessary. // Add default prefix to channel if necessary.
if (!channel.tqcontains(TQRegExp("^[#+&]{1}"))) if (!channel.contains(TQRegExp("^[#+&]{1}")))
channel = '#' + channel; channel = '#' + channel;
channelSettings.setName(channel); channelSettings.setName(channel);
@ -321,7 +321,7 @@ void ConnectionManager::decodeAddress(const TQString& address, ConnectionSetting
// Full-length IPv6 address with port // Full-length IPv6 address with port
// Example: RFC 2732 notation: [2001:0DB8:0000:0000:0000:0000:1428:57ab]:6666 // Example: RFC 2732 notation: [2001:0DB8:0000:0000:0000:0000:1428:57ab]:6666
// Example: Non-RFC 2732 notation: 2001:0DB8:0000:0000:0000:0000:1428:57ab:6666 // Example: Non-RFC 2732 notation: 2001:0DB8:0000:0000:0000:0000:1428:57ab:6666
if (address.tqcontains(':')==8) if (address.contains(':')==8)
{ {
host = address.section(':',0,-2).remove("[").remove("]"); host = address.section(':',0,-2).remove("[").remove("]");
port = address.section(':',-1); port = address.section(':',-1);
@ -330,7 +330,7 @@ void ConnectionManager::decodeAddress(const TQString& address, ConnectionSetting
// Example: Without port, RFC 2732 notation: [2001:0DB8:0000:0000:0000:0000:1428:57ab] // Example: Without port, RFC 2732 notation: [2001:0DB8:0000:0000:0000:0000:1428:57ab]
// Example: Without port, Non-RFC 2732 notation: 2001:0DB8:0000:0000:0000:0000:1428:57ab // Example: Without port, Non-RFC 2732 notation: 2001:0DB8:0000:0000:0000:0000:1428:57ab
// Example: With port, RFC 2732 notation: [2001:0DB8::1428:57ab]:6666 // Example: With port, RFC 2732 notation: [2001:0DB8::1428:57ab]:6666
else if (address.tqcontains(':')>=4) else if (address.contains(':')>=4)
{ {
// Last segment does not end with ], but the next to last does; // Last segment does not end with ], but the next to last does;
// Assume not-full-length IPv6 address with port // Assume not-full-length IPv6 address with port
@ -349,7 +349,7 @@ void ConnectionManager::decodeAddress(const TQString& address, ConnectionSetting
// IPv4 address or ordinary hostname with port // IPv4 address or ordinary hostname with port
// Example: IPv4 address with port: 123.123.123.123:6666 // Example: IPv4 address with port: 123.123.123.123:6666
// Example: Hostname with port: irc.bla.org:6666 // Example: Hostname with port: irc.bla.org:6666
else if (address.tqcontains(':')==1) else if (address.contains(':')==1)
{ {
host = address.section(':',0,-2); host = address.section(':',0,-2);
port = address.section(':',-1); port = address.section(':',-1);
@ -550,7 +550,7 @@ TQPtrList<Server> ConnectionManager::getServerList()
Server* ConnectionManager::getServerByConnectionId(int connectionId) Server* ConnectionManager::getServerByConnectionId(int connectionId)
{ {
if (m_connectionList.tqcontains(connectionId)) if (m_connectionList.contains(connectionId))
return m_connectionList[connectionId]; return m_connectionList[connectionId];
else else
return 0; return 0;

@ -233,7 +233,7 @@ void DccChat::readData()
if( (*itLine).startsWith( "\x01" ) ) if( (*itLine).startsWith( "\x01" ) )
{ {
// cut out the CTCP command // cut out the CTCP command
TQString ctcp = (*itLine).mid( 1, (*itLine).tqfind( 1, 1 ) - 1 ); TQString ctcp = (*itLine).mid( 1, (*itLine).find( 1, 1 ) - 1 );
TQString ctcpCommand = ctcp.section( " ", 0, 0 ); TQString ctcpCommand = ctcp.section( " ", 0, 0 );
TQString ctcpArgument = ctcp.section( " ", 1 ); TQString ctcpArgument = ctcp.section( " ", 1 );

@ -150,14 +150,14 @@ void DccResumeDialog::suggestNewName() // slot
TQString basename = m_urlreqFileURL->url().section("/", -1); TQString basename = m_urlreqFileURL->url().section("/", -1);
KURL baseURL(m_urlreqFileURL->url().section("/", 0, -2)); KURL baseURL(m_urlreqFileURL->url().section("/", 0, -2));
int index = basename.tqfind( '.' ); int index = basename.find( '.' );
if ( index != -1 ) if ( index != -1 )
{ {
dotSuffix = basename.mid( index ); dotSuffix = basename.mid( index );
basename.truncate( index ); basename.truncate( index );
} }
int pos = basename.tqfindRev( '_' ); int pos = basename.findRev( '_' );
if(pos != -1 ) if(pos != -1 )
{ {
TQString tmp = basename.mid( pos+1 ); TQString tmp = basename.mid( pos+1 );
@ -170,7 +170,7 @@ void DccResumeDialog::suggestNewName() // slot
else else
{ {
// yes there's already a number behind the _ so increment it by one // yes there's already a number behind the _ so increment it by one
basename.tqreplace( pos+1, tmp.length(), TQString::number(number+1) ); basename.replace( pos+1, tmp.length(), TQString::number(number+1) );
suggestedName = basename + dotSuffix; suggestedName = basename + dotSuffix;
} }
} }

@ -210,7 +210,7 @@ TQString DccTransfer::sanitizeFileName( const TQString& fileName )
{ {
TQString fileNameTmp = TQFileInfo( fileName ).fileName(); TQString fileNameTmp = TQFileInfo( fileName ).fileName();
if ( fileNameTmp.startsWith( "." ) ) if ( fileNameTmp.startsWith( "." ) )
fileNameTmp.tqreplace( 0, 1, '_' ); // Don't create hidden files fileNameTmp.replace( 0, 1, '_' ); // Don't create hidden files
if ( fileNameTmp.isEmpty() ) if ( fileNameTmp.isEmpty() )
fileNameTmp = "unnamed"; fileNameTmp = "unnamed";
return fileNameTmp; return fileNameTmp;

@ -346,7 +346,7 @@ void DccTransferPanel::clearDcc()
bool itemSelected = false; bool itemSelected = false;
while( selected.current() ) while( selected.current() )
{ {
if (selected.current()->itemBelow() && !lst.tqcontainsRef(selected.current()->itemBelow())) if (selected.current()->itemBelow() && !lst.containsRef(selected.current()->itemBelow()))
{ {
m_listView->setSelected(selected.current()->itemBelow(),true); m_listView->setSelected(selected.current()->itemBelow(),true);
m_listView->setCurrentItem(selected.current()->itemBelow()); m_listView->setCurrentItem(selected.current()->itemBelow());

@ -196,12 +196,12 @@ bool DccTransferSend::queue()
} }
} }
//FIXME: if "\\\"" works well on other IRC clients, tqreplace "\"" with "\\\"" //FIXME: if "\\\"" works well on other IRC clients, replace "\"" with "\\\""
m_fileName.tqreplace( "\"", "_" ); m_fileName.replace( "\"", "_" );
if (Preferences::dccSpaceToUnderscore()) if (Preferences::dccSpaceToUnderscore())
m_fileName.tqreplace( " ", "_" ); m_fileName.replace( " ", "_" );
else { else {
if (m_fileName.tqcontains(" ") > 0) if (m_fileName.contains(" ") > 0)
m_fileName = "\"" + m_fileName + "\""; m_fileName = "\"" + m_fileName + "\"";
} }

@ -66,7 +66,7 @@ KDialogBase::Ok,true)
{ {
TQString name = (*it)->name(); TQString name = (*it)->name();
if (!networkNames.tqcontains(name)) if (!networkNames.contains(name))
{ {
networkNames.append(name); networkNames.append(name);
} }

@ -160,7 +160,7 @@ namespace Konversation
for(EmotIconMap::iterator it = self()->m_emotIconMap.begin(); it != self()->m_emotIconMap.end(); ++it) for(EmotIconMap::iterator it = self()->m_emotIconMap.begin(); it != self()->m_emotIconMap.end(); ++it)
{ {
TQRegExp regExp(TQString("(^|\\s)%1($|\\s)").tqarg(it.data())); TQRegExp regExp(TQString("(^|\\s)%1($|\\s)").tqarg(it.data()));
filteredTxt.tqreplace(regExp, " <img width=\"" + TQString::number(fm.height()) + "\" height=\"" + TQString::number(fm.height()) filteredTxt.replace(regExp, " <img width=\"" + TQString::number(fm.height()) + "\" height=\"" + TQString::number(fm.height())
+ "\" src=\"" + it.key() + "\" alt=\"" + it.data() + "\">&nbsp;"); + "\" src=\"" + it.key() + "\" alt=\"" + it.data() + "\">&nbsp;");
} }

@ -627,7 +627,7 @@ namespace Konversation
IdentityPtr IdentityDialog::setCurrentIdentity(IdentityPtr identity) IdentityPtr IdentityDialog::setCurrentIdentity(IdentityPtr identity)
{ {
int index = Preferences::identityList().tqfindIndex(identity); int index = Preferences::identityList().findIndex(identity);
setCurrentIdentity(index); setCurrentIdentity(index);
return m_currentIdentity; return m_currentIdentity;

@ -57,7 +57,7 @@ void InputFilter::parseLine(const TQString& a_newLine)
// Remove white spaces at the end and beginning // Remove white spaces at the end and beginning
newLine = newLine.stripWhiteSpace(); newLine = newLine.stripWhiteSpace();
// Find end of middle parameter list // Find end of middle parameter list
int pos = newLine.tqfind(" :"); int pos = newLine.find(" :");
// Was there a trailing parameter? // Was there a trailing parameter?
if(pos != -1) if(pos != -1)
{ {
@ -75,7 +75,7 @@ void InputFilter::parseLine(const TQString& a_newLine)
if(newLine[0] == ':') if(newLine[0] == ':')
{ {
// Find end of prefix // Find end of prefix
pos = newLine.tqfind(' '); pos = newLine.find(' ');
// Copy prefix // Copy prefix
prefix = newLine.mid(1, pos - 1); prefix = newLine.mid(1, pos - 1);
// Remove prefix from line // Remove prefix from line
@ -83,7 +83,7 @@ void InputFilter::parseLine(const TQString& a_newLine)
} }
// Find end of command // Find end of command
pos = newLine.tqfind(' '); pos = newLine.find(' ');
// Copy command (all lowercase to make parsing easier) // Copy command (all lowercase to make parsing easier)
TQString command = newLine.left(pos).lower(); TQString command = newLine.left(pos).lower();
// Are there parameters left in the string? // Are there parameters left in the string?
@ -100,7 +100,7 @@ void InputFilter::parseLine(const TQString& a_newLine)
Q_ASSERT(server); Q_ASSERT(server);
// Server command, if no "!" was found in prefix // Server command, if no "!" was found in prefix
if((prefix.tqfind('!') == -1) && (prefix != server->getNickname())) if((prefix.find('!') == -1) && (prefix != server->getNickname()))
{ {
parseServerCommand(prefix, command, parameterList, trailing); parseServerCommand(prefix, command, parameterList, trailing);
@ -117,7 +117,7 @@ void InputFilter::parseClientCommand(const TQString &prefix, const TQString &com
Q_ASSERT(konv_app); Q_ASSERT(konv_app);
Q_ASSERT(server); Q_ASSERT(server);
// Extract nickname from prefix // Extract nickname from prefix
int pos = prefix.tqfind("!"); int pos = prefix.find("!");
TQString sourceNick = prefix.left(pos); TQString sourceNick = prefix.left(pos);
TQString sourceHosttqmask = prefix.mid(pos + 1); TQString sourceHosttqmask = prefix.mid(pos + 1);
// remember hosttqmask for this nick, it could have changed // remember hosttqmask for this nick, it could have changed
@ -135,11 +135,11 @@ void InputFilter::parseClientCommand(const TQString &prefix, const TQString &com
if(trailing.at(0)==TQChar(0x01)) if(trailing.at(0)==TQChar(0x01))
{ {
// cut out the CTCP command // cut out the CTCP command
TQString ctcp = trailing.mid(1,trailing.tqfind(1,1)-1); TQString ctcp = trailing.mid(1,trailing.find(1,1)-1);
TQString ctcpCommand=ctcp.left(ctcp.tqfind(" ")).lower(); TQString ctcpCommand=ctcp.left(ctcp.find(" ")).lower();
TQString ctcpArgument=ctcp.mid(ctcp.tqfind(" ")+1); TQString ctcpArgument=ctcp.mid(ctcp.find(" ")+1);
ctcpArgument=static_cast<KonversationApplication*>(kapp)->doAutotqreplace(ctcpArgument,false); ctcpArgument=static_cast<KonversationApplication*>(kapp)->doAutoreplace(ctcpArgument,false);
// If it was a ctcp action, build an action string // If it was a ctcp action, build an action string
if(ctcpCommand=="action" && isChan) if(ctcpCommand=="action" && isChan)
@ -157,7 +157,7 @@ void InputFilter::parseClientCommand(const TQString &prefix, const TQString &com
if(sourceNick != server->getNickname()) if(sourceNick != server->getNickname())
{ {
if(ctcpArgument.lower().tqfind(TQRegExp("(^|[^\\d\\w])" if(ctcpArgument.lower().find(TQRegExp("(^|[^\\d\\w])"
+ TQRegExp::escape(server->loweredNickname()) + TQRegExp::escape(server->loweredNickname())
+ "([^\\d\\w]|$)")) !=-1 ) + "([^\\d\\w]|$)")) !=-1 )
{ {
@ -258,11 +258,11 @@ void InputFilter::parseClientCommand(const TQString &prefix, const TQString &com
TQString dccType=ctcpArgument.lower().section(' ',0,0); TQString dccType=ctcpArgument.lower().section(' ',0,0);
// Support file names with spaces // Support file names with spaces
TQString dccArguments = ctcpArgument.mid(ctcpArgument.tqfind(" ")+1); TQString dccArguments = ctcpArgument.mid(ctcpArgument.find(" ")+1);
TQStringList dccArgumentList; TQStringList dccArgumentList;
if ((dccArguments.tqcontains('\"') >= 2) && (dccArguments.startsWith("\""))) { if ((dccArguments.contains('\"') >= 2) && (dccArguments.startsWith("\""))) {
int lastQuotePos = dccArguments.tqfindRev("\""); int lastQuotePos = dccArguments.findRev("\"");
if (dccArguments[lastQuotePos+1] == ' ') { if (dccArguments[lastQuotePos+1] == ' ') {
TQString fileName = dccArguments.mid(1, lastQuotePos-1); TQString fileName = dccArguments.mid(1, lastQuotePos-1);
dccArguments = dccArguments.mid(lastQuotePos+2); dccArguments = dccArguments.mid(lastQuotePos+2);
@ -494,7 +494,7 @@ void InputFilter::parseClientCommand(const TQString &prefix, const TQString &com
// TODO: Try to remember channel keys for autojoins and manual joins, so // TODO: Try to remember channel keys for autojoins and manual joins, so
// we can get %k to work // we can get %k to work
if(channelName.tqfind(' ')!=-1) if(channelName.find(' ')!=-1)
{ {
key=channelName.section(' ',1,1); key=channelName.section(' ',1,1);
channelName=channelName.section(' ',0,0); channelName=channelName.section(' ',0,0);
@ -696,7 +696,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
{ {
TQString host; TQString host;
if(trailing.tqcontains("@")) if(trailing.contains("@"))
host = trailing.section("@",1); host = trailing.section("@",1);
// re-set nickname, since the server may have truncated it // re-set nickname, since the server may have truncated it
@ -739,7 +739,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
{ {
TQString property, value; TQString property, value;
int pos; int pos;
if ((pos=(*it).tqfind( '=' )) !=-1) if ((pos=(*it).find( '=' )) !=-1)
{ {
property = (*it).left(pos); property = (*it).left(pos);
value = (*it).mid(pos+1); value = (*it).mid(pos+1);
@ -750,7 +750,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
} }
if (property=="PREFIX") if (property=="PREFIX")
{ {
pos = value.tqfind(')',1); pos = value.find(')',1);
if(pos==-1) if(pos==-1)
{ {
server->setPrefixes(TQString(), value); server->setPrefixes(TQString(), value);
@ -1181,7 +1181,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
{ {
// escape html tags // escape html tags
TQString escapedRealName(trailing); TQString escapedRealName(trailing);
escapedRealName.tqreplace("<","&lt;").tqreplace(">","&gt;"); escapedRealName.replace("<","&lt;").replace(">","&gt;");
server->appendMessageToFrontmost(i18n("Whois"), server->appendMessageToFrontmost(i18n("Whois"),
i18n("%1 is %2@%3 (%4)") i18n("%1 is %2@%3 (%4)")
.tqarg(parameterList[1]) .tqarg(parameterList[1])
@ -1279,7 +1279,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
{ {
if(!whoRequestList.isEmpty()) if(!whoRequestList.isEmpty())
{ // for safety { // for safety
TQStringList::iterator it = whoRequestList.tqfind(parameterList[1].lower()); TQStringList::iterator it = whoRequestList.find(parameterList[1].lower());
if(it != whoRequestList.end()) if(it != whoRequestList.end())
{ {
@ -1741,7 +1741,7 @@ void InputFilter::parseServerCommand(const TQString &prefix, const TQString &com
case RPL_CAPAB: // Special freenode reply afaik case RPL_CAPAB: // Special freenode reply afaik
{ {
// Disable as we don't use this for anything yet // Disable as we don't use this for anything yet
if(trailing.tqcontains("IDENTIFY-MSG")) if(trailing.contains("IDENTIFY-MSG"))
{ {
server->enableIdentifyMsg(true); server->enableIdentifyMsg(true);
break; break;
@ -1805,7 +1805,7 @@ void InputFilter::parseModes(const TQString &sourceNick, const TQStringList &par
else else
{ {
// Check if this was a parameter mode // Check if this was a parameter mode
if(parameterModes.tqfind(mode)!=-1) if(parameterModes.find(mode)!=-1)
{ {
// Check if the mode actually wants a parameter. -k and -l do not! // Check if the mode actually wants a parameter. -k and -l do not!
if(plus || (!plus && (mode!='k') && (mode!='l'))) if(plus || (!plus && (mode!='k') && (mode!='l')))
@ -1841,7 +1841,7 @@ bool InputFilter::isAChannel(const TQString &check)
{ {
Q_ASSERT(server); Q_ASSERT(server);
// if we ever see the assert, we need the ternary // if we ever see the assert, we need the ternary
return server? server->isAChannel(check) : TQString("#&").tqcontains(check.at(0)); return server? server->isAChannel(check) : TQString("#&").contains(check.at(0));
} }
bool InputFilter::isIgnore(const TQString &sender, Ignore::Type type) bool InputFilter::isIgnore(const TQString &sender, Ignore::Type type)
@ -1853,7 +1853,7 @@ bool InputFilter::isIgnore(const TQString &sender, Ignore::Type type)
for(unsigned int index =0; index<list.count(); index++) for(unsigned int index =0; index<list.count(); index++)
{ {
Ignore* item = list.at(index); Ignore* item = list.at(index);
TQRegExp ignoreItem(TQString(TQRegExp::escape(item->getName())).tqreplace("\\*", "(.*)"),false); TQRegExp ignoreItem(TQString(TQRegExp::escape(item->getName())).replace("\\*", "(.*)"),false);
if (ignoreItem.exactMatch(sender) && (item->getFlags() & type)) if (ignoreItem.exactMatch(sender) && (item->getFlags() & type))
doIgnore = true; doIgnore = true;
if (ignoreItem.exactMatch(sender) && (item->getFlags() & Ignore::Exception)) if (ignoreItem.exactMatch(sender) && (item->getFlags() & Ignore::Exception))
@ -1888,7 +1888,7 @@ int InputFilter::getAutomaticRequest(const TQString& command, const TQString& na
void InputFilter::addWhoRequest(const TQString& name) { whoRequestList << name.lower(); } void InputFilter::addWhoRequest(const TQString& name) { whoRequestList << name.lower(); }
bool InputFilter::isWhoRequestUnderProcess(const TQString& name) { return (whoRequestList.tqcontains(name.lower())>0); } bool InputFilter::isWhoRequestUnderProcess(const TQString& name) { return (whoRequestList.contains(name.lower())>0); }
void InputFilter::setLagMeasuring(bool state) { lagMeasuring=state; } void InputFilter::setLagMeasuring(bool state) { lagMeasuring=state; }
@ -1898,7 +1898,7 @@ void InputFilter::parsePrivMsg(const TQString& prefix,
const TQStringList& parameterList, const TQStringList& parameterList,
const TQString& trailing) const TQString& trailing)
{ {
int pos = prefix.tqfind("!"); int pos = prefix.find("!");
TQString source; TQString source;
TQString sourceHosttqmask; TQString sourceHosttqmask;
TQString message(trailing); TQString message(trailing);
@ -1914,7 +1914,7 @@ void InputFilter::parsePrivMsg(const TQString& prefix,
} }
KonversationApplication* konv_app = static_cast<KonversationApplication*>(kapp); KonversationApplication* konv_app = static_cast<KonversationApplication*>(kapp);
message = konv_app->doAutotqreplace(message, false); message = konv_app->doAutoreplace(message, false);
if(isAChannel(parameterList[0])) if(isAChannel(parameterList[0]))
{ {
@ -1931,7 +1931,7 @@ void InputFilter::parsePrivMsg(const TQString& prefix,
TQRegExp::escape(server->loweredNickname()) + TQRegExp::escape(server->loweredNickname()) +
"([^\\d\\w]|$)"); "([^\\d\\w]|$)");
regexp.setCaseSensitive(false); regexp.setCaseSensitive(false);
if(message.tqfind(regexp) !=-1 ) if(message.find(regexp) !=-1 )
{ {
konv_app->notificationHandler()->nick(channel, konv_app->notificationHandler()->nick(channel,
source, message); source, message);
@ -1964,7 +1964,7 @@ void InputFilter::parsePrivMsg(const TQString& prefix,
TQRegExp::escape(server->loweredNickname()) + TQRegExp::escape(server->loweredNickname()) +
"([^\\d\\w]|$)"); "([^\\d\\w]|$)");
regexp.setCaseSensitive(false); regexp.setCaseSensitive(false);
if(message.tqfind(regexp) !=-1 ) if(message.find(regexp) !=-1 )
{ {
konv_app->notificationHandler()->nick(query, konv_app->notificationHandler()->nick(query,
source, message); source, message);
@ -1981,5 +1981,5 @@ void InputFilter::parsePrivMsg(const TQString& prefix,
#include "inputfilter.moc" #include "inputfilter.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -63,7 +63,7 @@ namespace Konversation
{ {
// simplify ambiguousName // simplify ambiguousName
TQString simplifiedAmbiguousName( ambiguousName.lower() ); TQString simplifiedAmbiguousName( ambiguousName.lower() );
simplifiedAmbiguousName.tqreplace( TQRegExp( "[^a-z0-9]" ), "" ); simplifiedAmbiguousName.replace( TQRegExp( "[^a-z0-9]" ), "" );
// search m_simplifiedShortNames // search m_simplifiedShortNames
int index = 0; int index = 0;
@ -75,7 +75,7 @@ namespace Konversation
} }
// search m_shortNameAliases // search m_shortNameAliases
if ( m_shortNameAliases.tqcontains( simplifiedAmbiguousName ) ) if ( m_shortNameAliases.contains( simplifiedAmbiguousName ) )
return m_shortNameAliases[ simplifiedAmbiguousName ]; return m_shortNameAliases[ simplifiedAmbiguousName ];
// failed // failed
@ -96,7 +96,7 @@ namespace Konversation
bool IRCCharsets::isValidEncoding( const TQString& shortName ) bool IRCCharsets::isValidEncoding( const TQString& shortName )
{ {
return ( m_shortNames.tqcontains( shortName ) > 0 ); return ( m_shortNames.contains( shortName ) > 0 );
} }
TQString IRCCharsets::encodingForLocale() TQString IRCCharsets::encodingForLocale()
@ -151,7 +151,7 @@ namespace Konversation
else else
{ {
m_shortNames.append( encodingName ); m_shortNames.append( encodingName );
m_simplifiedShortNames.append( encodingName.tqreplace( reSimplify, "" ) ); m_simplifiedShortNames.append( encodingName.replace( reSimplify, "" ) );
if(encodingName == "jis7") // Add iso-2022-jp which is same as jis7 but not in TQt if(encodingName == "jis7") // Add iso-2022-jp which is same as jis7 but not in TQt
{ {

@ -258,7 +258,7 @@ void IRCInput::keyPressEvent(TQKeyEvent* e)
} }
else else
{ {
setText(static_cast<KonversationApplication*>(kapp)->doAutotqreplace(text(),true)); setText(static_cast<KonversationApplication*>(kapp)->doAutoreplace(text(),true));
emit submit(); emit submit();
} }
} }
@ -394,32 +394,32 @@ void IRCInput::paste()
bool signal=false; bool signal=false;
// tqreplace \r with \n to make xterm pastes happy // replace \r with \n to make xterm pastes happy
pasteText.tqreplace("\r","\n"); pasteText.replace("\r","\n");
// remove blank lines // remove blank lines
while(pasteText.tqcontains("\n\n")) while(pasteText.contains("\n\n"))
pasteText.tqreplace("\n\n","\n"); pasteText.replace("\n\n","\n");
TQRegExp reTopSpace("^ *\n"); TQRegExp reTopSpace("^ *\n");
while(pasteText.tqcontains(reTopSpace)) while(pasteText.contains(reTopSpace))
pasteText.remove(reTopSpace); pasteText.remove(reTopSpace);
TQRegExp reBottomSpace("\n *$"); TQRegExp reBottomSpace("\n *$");
while(pasteText.tqcontains(reBottomSpace)) while(pasteText.contains(reBottomSpace))
pasteText.remove(reBottomSpace); pasteText.remove(reBottomSpace);
// Escape % when var expansion is enabled // Escape % when var expansion is enabled
if (!Preferences::disableExpansion()) if (!Preferences::disableExpansion())
{ {
pasteText.tqreplace ('%', "%%"); pasteText.replace ('%', "%%");
} }
// does the text contain at least one newline character? // does the text contain at least one newline character?
if(pasteText.tqfind('\n')!=-1) if(pasteText.find('\n')!=-1)
{ {
// make comparisons easier (avoid signed / unsigned warnings) // make comparisons easier (avoid signed / unsigned warnings)
unsigned int pos=pasteText.tqfind('\n'); unsigned int pos=pasteText.find('\n');
unsigned int rpos=pasteText.tqfindRev('\n'); unsigned int rpos=pasteText.findRev('\n');
// emit the signal if there's a line break in the middle of the text // emit the signal if there's a line break in the middle of the text
if(pos>0 && pos!=(pasteText.length()-1)) if(pos>0 && pos!=(pasteText.length()-1))
@ -468,7 +468,7 @@ bool IRCInput::checkPaste(TQString& text)
int doPaste=KMessageBox::Yes; int doPaste=KMessageBox::Yes;
//text is now preconditioned when you get here //text is now preconditioned when you get here
int lines=text.tqcontains('\n'); int lines=text.contains('\n');
if(text.length()>256 || lines) if(text.length()>256 || lines)
{ {

@ -109,7 +109,7 @@ IRCView::IRCView(TQWidget* tqparent, Server* newServer) : KTextBrowser(tqparent)
m_popup->setItemVisible(copyUrlMenuSeparator, false); m_popup->setItemVisible(copyUrlMenuSeparator, false);
m_popup->insertItem(SmallIconSet("editcopy"),i18n("&Copy"),Copy); m_popup->insertItem(SmallIconSet("editcopy"),i18n("&Copy"),Copy);
m_popup->insertItem(i18n("Select All"),SelectAll); m_popup->insertItem(i18n("Select All"),SelectAll);
m_popup->insertItem(SmallIcon("tqfind"),i18n("Find Text..."),Search); m_popup->insertItem(SmallIcon("find"),i18n("Find Text..."),Search);
setServer(newServer); setServer(newServer);
@ -205,14 +205,14 @@ void IRCView::highlightedSlot(const TQString& _link)
{ {
TQString link = _link; TQString link = _link;
// HACK Replace % with \x03 in the url to keep TQt from doing stupid things // HACK Replace % with \x03 in the url to keep TQt from doing stupid things
link = link.tqreplace ('\x03', "%"); link = link.replace ('\x03', "%");
//Hack to handle the fact that we get a decoded url //Hack to handle the fact that we get a decoded url
link = KURL::fromPathOrURL(link).url(); link = KURL::fromPathOrURL(link).url();
// HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit // HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit
if(link.startsWith("#")) if(link.startsWith("#"))
{ {
link = link.tqreplace(' ', "\\"); link = link.replace(' ', "\\");
} }
//we just saw this a second ago. no need to reemit. //we just saw this a second ago. no need to reemit.
@ -317,7 +317,7 @@ void IRCView::openLink(const TQString& url, bool newTab)
else else
{ {
TQString cmd = Preferences::webBrowserCmd(); TQString cmd = Preferences::webBrowserCmd();
cmd.tqreplace("%u", url); cmd.replace("%u", url);
KProcess *proc = new KProcess; KProcess *proc = new KProcess;
TQStringList cmdAndArgs = KShell::splitArgs(cmd); TQStringList cmdAndArgs = KShell::splitArgs(cmd);
*proc << cmdAndArgs; *proc << cmdAndArgs;
@ -333,7 +333,7 @@ void IRCView::openLink(const TQString& url, bool newTab)
else if (url.startsWith("##") && m_server && m_server->isConnected()) else if (url.startsWith("##") && m_server && m_server->isConnected())
{ {
TQString channel(url); TQString channel(url);
channel.tqreplace("##", "#"); channel.replace("##", "#");
m_server->sendJoinCommand(channel); m_server->sendJoinCommand(channel);
} }
//FIXME: Don't do user links in DCC Chats to begin with since they don't have a server. //FIXME: Don't do user links in DCC Chats to begin with since they don't have a server.
@ -351,9 +351,9 @@ void IRCView::replaceDecoration(TQString& line, char decoration, char replacemen
int pos; int pos;
bool decorated = false; bool decorated = false;
while((pos=line.tqfind(decoration))!=-1) while((pos=line.find(decoration))!=-1)
{ {
line.tqreplace(pos,1,(decorated) ? TQString("</%1>").tqarg(replacement) : TQString("<%1>").tqarg(replacement)); line.replace(pos,1,(decorated) ? TQString("</%1>").tqarg(replacement) : TQString("<%1>").tqarg(replacement));
decorated = !decorated; decorated = !decorated;
} }
} }
@ -373,9 +373,9 @@ bool doHighlight, bool parseURL, bool self)
// TODO: Use TQStyleSheet::escape() here // TODO: Use TQStyleSheet::escape() here
// Replace all < with &lt; // Replace all < with &lt;
filteredLine.tqreplace("<","\x0blt;"); filteredLine.replace("<","\x0blt;");
// Replace all > with &gt; // Replace all > with &gt;
filteredLine.tqreplace(">", "\x0bgt;"); filteredLine.replace(">", "\x0bgt;");
#if 0 #if 0
if(!Preferences::disableExpansion()) if(!Preferences::disableExpansion())
@ -392,7 +392,7 @@ bool doHighlight, bool parseURL, bool self)
{ {
replacement = boldRe.cap(1); replacement = boldRe.cap(1);
replacement = "\x02"+replacement+"\x02"; replacement = "\x02"+replacement+"\x02";
filteredLine.tqreplace(position,replacement.length()+2,replacement); filteredLine.replace(position,replacement.length()+2,replacement);
} }
position += boldRe.matchedLength(); position += boldRe.matchedLength();
} }
@ -405,14 +405,14 @@ bool doHighlight, bool parseURL, bool self)
{ {
replacement = underRe.cap(1); replacement = underRe.cap(1);
replacement = "\x1f"+replacement+"\x1f"; replacement = "\x1f"+replacement+"\x1f";
filteredLine.tqreplace(position,replacement.length()+2,replacement); filteredLine.replace(position,replacement.length()+2,replacement);
} }
position += underRe.matchedLength(); position += underRe.matchedLength();
} }
} }
#endif #endif
if(filteredLine.tqfind("\x07") != -1) if(filteredLine.find("\x07") != -1)
{ {
if(Preferences::beep()) if(Preferences::beep())
{ {
@ -420,7 +420,7 @@ bool doHighlight, bool parseURL, bool self)
} }
} }
// tqreplace \003 and \017 codes with rich text color codes // replace \003 and \017 codes with rich text color codes
// captures 1 2 23 4 4 3 1 // captures 1 2 23 4 4 3 1
TQRegExp colorRegExp("(\003([0-9]|0[0-9]|1[0-5]|)(,([0-9]|0[0-9]|1[0-5])|,|)|\017)"); TQRegExp colorRegExp("(\003([0-9]|0[0-9]|1[0-5]|)(,([0-9]|0[0-9]|1[0-5])|,|)|\017)");
@ -458,7 +458,7 @@ bool doHighlight, bool parseURL, bool self)
firstColor = false; firstColor = false;
} }
filteredLine.tqreplace(pos, colorRegExp.cap(0).length(), colorString); filteredLine.replace(pos, colorRegExp.cap(0).length(), colorString);
} }
if(!firstColor) if(!firstColor)
@ -480,8 +480,8 @@ bool doHighlight, bool parseURL, bool self)
else else
{ {
// Change & to &amp; to prevent html entities to do strange things to the text // Change & to &amp; to prevent html entities to do strange things to the text
filteredLine.tqreplace('&', "&amp;"); filteredLine.replace('&', "&amp;");
filteredLine.tqreplace("\x0b", "&"); filteredLine.replace("\x0b", "&");
} }
filteredLine = Konversation::EmotIcon::filter(filteredLine, fontMetrics()); filteredLine = Konversation::EmotIcon::filter(filteredLine, fontMetrics());
@ -503,7 +503,7 @@ bool doHighlight, bool parseURL, bool self)
TQString highlightColor; TQString highlightColor;
if(Preferences::highlightNick() && if(Preferences::highlightNick() &&
filteredLine.lower().tqfind(TQRegExp("(^|[^\\d\\w])" + filteredLine.lower().find(TQRegExp("(^|[^\\d\\w])" +
TQRegExp::escape(ownNick.lower()) + TQRegExp::escape(ownNick.lower()) +
"([^\\d\\w]|$)")) != -1) "([^\\d\\w]|$)")) != -1)
{ {
@ -527,9 +527,9 @@ bool doHighlight, bool parseURL, bool self)
TQRegExp needleReg=highlight->getPattern(); TQRegExp needleReg=highlight->getPattern();
needleReg.setCaseSensitive(false); needleReg.setCaseSensitive(false);
// highlight regexp in text // highlight regexp in text
patternFound = ((filteredLine.tqfind(needleReg) != -1) || patternFound = ((filteredLine.find(needleReg) != -1) ||
// highlight regexp in nickname // highlight regexp in nickname
(whoSent.tqfind(needleReg) != -1)); (whoSent.find(needleReg) != -1));
// remember captured patterns for later // remember captured patterns for later
captures=needleReg.tqcapturedTexts(); captures=needleReg.tqcapturedTexts();
@ -539,9 +539,9 @@ bool doHighlight, bool parseURL, bool self)
{ {
TQString needle=highlight->getPattern(); TQString needle=highlight->getPattern();
// highlight patterns in text // highlight patterns in text
patternFound = ((filteredLine.tqfind(needle, 0, false) != -1) || patternFound = ((filteredLine.find(needle, 0, false) != -1) ||
// highlight patterns in nickname // highlight patterns in nickname
(whoSent.tqfind(needle, 0, false) != -1)); (whoSent.find(needle, 0, false) != -1));
} }
if(!patternFound) if(!patternFound)
@ -570,12 +570,12 @@ bool doHighlight, bool parseURL, bool self)
konvApp->notificationHandler()->highlight(m_chatWin, whoSent, line); konvApp->notificationHandler()->highlight(m_chatWin, whoSent, line);
m_autoTextToSend = highlight->getAutoText(); m_autoTextToSend = highlight->getAutoText();
// tqreplace %0 - %9 in regex groups // replace %0 - %9 in regex groups
for(unsigned int capture=0;capture<captures.count();capture++) for(unsigned int capture=0;capture<captures.count();capture++)
{ {
m_autoTextToSend.tqreplace(TQString("%%1").tqarg(capture),captures[capture]); m_autoTextToSend.replace(TQString("%%1").tqarg(capture),captures[capture]);
} }
m_autoTextToSend.tqreplace(TQRegExp("%[0-9]"),TQString()); m_autoTextToSend.replace(TQRegExp("%[0-9]"),TQString());
} }
} }
@ -593,7 +593,7 @@ bool doHighlight, bool parseURL, bool self)
} }
// Replace pairs of spaces with "<space>&nbsp;" to preserve some semblance of text wrapping // Replace pairs of spaces with "<space>&nbsp;" to preserve some semblance of text wrapping
filteredLine.tqreplace(" "," \xA0"); filteredLine.replace(" "," \xA0");
return filteredLine; return filteredLine;
} }
@ -604,7 +604,7 @@ TQString IRCView::createNickLine(const TQString& nick, bool encapsulateNick, boo
if(Preferences::useClickableNicks()) if(Preferences::useClickableNicks())
{ {
// HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit // HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit
nickLine = "<a href=\"#" + TQString(nick).tqreplace('\\', " ") + "\">%2</a>"; nickLine = "<a href=\"#" + TQString(nick).replace('\\', " ") + "\">%2</a>";
} }
if(privMsg) if(privMsg)
@ -1017,8 +1017,8 @@ void IRCView::appendBacklogMessage(const TQString& firstColumn,const TQString& r
} }
// Nicks are in "<nick>" format so replace the "<>" // Nicks are in "<nick>" format so replace the "<>"
nick.tqreplace("<","&lt;"); nick.replace("<","&lt;");
nick.tqreplace(">","&gt;"); nick.replace(">","&gt;");
TQString line; TQString line;
@ -1272,7 +1272,7 @@ void IRCView::contentsContextMenuEvent(TQContextMenuEvent* ev)
// HACK Replace % with \x03 in the url to keep TQt from doing stupid things // HACK Replace % with \x03 in the url to keep TQt from doing stupid things
m_highlightedURL = anchorAt(viewportToContents(mapFromGlobal(TQCursor::pos()))); m_highlightedURL = anchorAt(viewportToContents(mapFromGlobal(TQCursor::pos())));
m_highlightedURL = m_highlightedURL.tqreplace('\x03', "%"); m_highlightedURL = m_highlightedURL.replace('\x03', "%");
// Hack to counter the fact that we're given an decoded url // Hack to counter the fact that we're given an decoded url
m_highlightedURL = KURL::fromPathOrURL(m_highlightedURL).url(); m_highlightedURL = KURL::fromPathOrURL(m_highlightedURL).url();
@ -1281,7 +1281,7 @@ void IRCView::contentsContextMenuEvent(TQContextMenuEvent* ev)
if(m_highlightedURL.startsWith("#")) if(m_highlightedURL.startsWith("#"))
{ {
// HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit // HACK:Use space as a placeholder for \ as TQt tries to be clever and does a replace to / in urls in TQTextEdit
m_highlightedURL = m_highlightedURL.tqreplace(' ', "\\"); m_highlightedURL = m_highlightedURL.replace(' ', "\\");
} }
if (!block) if (!block)
@ -1543,7 +1543,7 @@ void IRCView::searchAgain()
} }
} }
if(!tqfind(m_pattern, m_caseSensitive, m_wholeWords, m_forward, &m_findParagraph, &m_findIndex)) if(!find(m_pattern, m_caseSensitive, m_wholeWords, m_forward, &m_findParagraph, &m_findIndex))
{ {
KMessageBox::information(this,i18n("No matches found for \"%1\".").tqarg(m_pattern),i18n("Information")); KMessageBox::information(this,i18n("No matches found for \"%1\".").tqarg(m_pattern),i18n("Information"));
} }
@ -1610,7 +1610,7 @@ bool IRCView::searchNext(bool reversed)
} }
} }
return tqfind(m_pattern, m_caseSensitive, m_wholeWords, fwd, return find(m_pattern, m_caseSensitive, m_wholeWords, fwd,
&m_findParagraph, &m_findIndex); &m_findParagraph, &m_findIndex);
} }
@ -1787,5 +1787,5 @@ void IRCView::saveLinkAs(const TQString& url)
#include "ircview.moc" #include "ircview.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -99,7 +99,7 @@ void KonvDCOP::actionToAll(const TQString &message)
void KonvDCOP::say(const TQString& _server,const TQString& _target,const TQString& _command) void KonvDCOP::say(const TQString& _server,const TQString& _target,const TQString& _command)
{ {
//Sadly, copy on write doesn't exist with TQString::tqreplace //Sadly, copy on write doesn't exist with TQString::replace
TQString server(_server), target(_target), command(_command); TQString server(_server), target(_target), command(_command);
// TODO: this just masks a greater problem - Server::addQuery will return a query for '' --argonel // TODO: this just masks a greater problem - Server::addQuery will return a query for '' --argonel
@ -108,8 +108,8 @@ void KonvDCOP::say(const TQString& _server,const TQString& _target,const TQStrin
kdDebug() << "KonvDCOP::say() requires 3 arguments." << endl; kdDebug() << "KonvDCOP::say() requires 3 arguments." << endl;
else else
{ {
command.tqreplace('\n',"\\n"); command.replace('\n',"\\n");
command.tqreplace('\r',"\\r"); command.replace('\r',"\\r");
target.remove('\n'); target.remove('\n');
target.remove('\r'); target.remove('\r');
server.remove('\n'); server.remove('\n');

@ -115,7 +115,7 @@ int KonversationApplication::newInstance()
bool changed = false; bool changed = false;
for ( TQStringList::ConstIterator it = scripts.begin(); it != scripts.end(); ++it ) for ( TQStringList::ConstIterator it = scripts.begin(); it != scripts.end(); ++it )
{ {
if(!aliasList.tqcontains(*it)) { if(!aliasList.contains(*it)) {
changed = true; changed = true;
aliasList.append(*it); aliasList.append(*it);
} }
@ -462,10 +462,10 @@ void KonversationApplication::readOptions()
TQStringList autoreplaceList(Preferences::autoreplaceList()); TQStringList autoreplaceList(Preferences::autoreplaceList());
// Read all entries // Read all entries
index=0; index=0;
while(config->hasKey(TQString("Autotqreplace%1").tqarg(index))) while(config->hasKey(TQString("Autoreplace%1").tqarg(index)))
{ {
// read entry and get length of the string // read entry and get length of the string
TQString entry=config->readEntry(TQString("Autotqreplace%1").tqarg(index++)); TQString entry=config->readEntry(TQString("Autoreplace%1").tqarg(index++));
unsigned int length=entry.length()-1; unsigned int length=entry.length()-1;
// if there's a "#" in the end, strip it (used to preserve blanks at the end of the replacement text) // if there's a "#" in the end, strip it (used to preserve blanks at the end of the replacement text)
// there should always be one, but older versions did not do it, so we check first // there should always be one, but older versions did not do it, so we check first
@ -747,7 +747,7 @@ void KonversationApplication::storeUrl(const TQString& who,const TQString& newUr
if(url.startsWith("www.")) url="http://"+url; if(url.startsWith("www.")) url="http://"+url;
else if(url.startsWith("ftp.")) url="ftp://"+url; else if(url.startsWith("ftp.")) url="ftp://"+url;
url=url.tqreplace("&amp;","&"); url=url.replace("&amp;","&");
// check that we don't add the same URL twice // check that we don't add the same URL twice
deleteUrl(who,url); deleteUrl(who,url);
@ -792,7 +792,7 @@ void KonversationApplication::splitNick_Server(const TQString& nick_server, TQSt
{ {
//kaddresbook uses the utf separator 0xE120, so treat that as a separator as well //kaddresbook uses the utf separator 0xE120, so treat that as a separator as well
TQString nickServer = nick_server; TQString nickServer = nick_server;
nickServer.tqreplace(TQChar(0xE120), "@"); nickServer.replace(TQChar(0xE120), "@");
ircnick = nickServer.section("@",0,0); ircnick = nickServer.section("@",0,0);
serverOrGroup = nickServer.section("@",1); serverOrGroup = nickServer.section("@",1);
} }
@ -816,7 +816,7 @@ NickInfoPtr KonversationApplication::getNickInfo(const TQString &ircnick, const
} }
// auto replace on input/output // auto replace on input/output
TQString KonversationApplication::doAutotqreplace(const TQString& text,bool output) TQString KonversationApplication::doAutoreplace(const TQString& text,bool output)
{ {
// get autoreplace list // get autoreplace list
TQStringList autoreplaceList=Preferences::autoreplaceList(); TQStringList autoreplaceList=Preferences::autoreplaceList();
@ -851,21 +851,21 @@ TQString KonversationApplication::doAutotqreplace(const TQString& text,bool outp
do { do {
replacement = definition.section(',',3); replacement = definition.section(',',3);
// find matches // find matches
index = line.tqfind(needleReg, index); index = line.find(needleReg, index);
if(index != -1) if(index != -1)
{ {
// remember captured patterns // remember captured patterns
TQStringList captures = needleReg.tqcapturedTexts(); TQStringList captures = needleReg.tqcapturedTexts();
// tqreplace %0 - %9 in regex groups // replace %0 - %9 in regex groups
for(unsigned int capture=0;capture<captures.count();capture++) for(unsigned int capture=0;capture<captures.count();capture++)
{ {
replacement.tqreplace(TQString("%%1").tqarg(capture),captures[capture]); replacement.replace(TQString("%%1").tqarg(capture),captures[capture]);
} }
replacement.tqreplace(TQRegExp("%[0-9]"),TQString()); replacement.replace(TQRegExp("%[0-9]"),TQString());
// replace input with replacement // replace input with replacement
line.tqreplace(index, captures[0].length(), replacement); line.replace(index, captures[0].length(), replacement);
index += replacement.length(); index += replacement.length();
} }
} while(index >= 0 && index < (int)line.length()); } while(index >= 0 && index < (int)line.length());
@ -874,7 +874,7 @@ TQString KonversationApplication::doAutotqreplace(const TQString& text,bool outp
{ {
TQRegExp needleReg("\\b" + TQRegExp::escape(pattern) + "\\b"); TQRegExp needleReg("\\b" + TQRegExp::escape(pattern) + "\\b");
needleReg.setCaseSensitive(false); needleReg.setCaseSensitive(false);
line.tqreplace(needleReg,replacement); line.replace(needleReg,replacement);
} }
} }
} }
@ -884,5 +884,5 @@ TQString KonversationApplication::doAutotqreplace(const TQString& text,bool outp
#include "konversationapplication.moc" #include "konversationapplication.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -117,7 +117,7 @@ class KonversationApplication : public KUniqueApplication
Konversation::NotificationHandler* notificationHandler() const { return m_notificationHandler; } Konversation::NotificationHandler* notificationHandler() const { return m_notificationHandler; }
// auto replacement for input or output lines // auto replacement for input or output lines
TQString doAutotqreplace(const TQString& text,bool output); TQString doAutoreplace(const TQString& text,bool output);
int newInstance(); int newInstance();
@ -166,5 +166,5 @@ class KonversationApplication : public KUniqueApplication
#endif #endif
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -93,7 +93,7 @@ void KonviBookmarkMenu::fillBookmarkMenu()
bm = parentBookmark.next(bm) ) bm = parentBookmark.next(bm) )
{ {
TQString text = bm.text(); TQString text = bm.text();
text.tqreplace( '&', "&&" ); text.replace( '&', "&&" );
if ( !separatorInserted && m_bIsRoot) // inserted before the first konq bookmark, to avoid the separator if no konq bookmark if ( !separatorInserted && m_bIsRoot) // inserted before the first konq bookmark, to avoid the separator if no konq bookmark
{ {
m_parentMenu->insertSeparator(); m_parentMenu->insertSeparator();

@ -182,7 +182,7 @@ void KonviConfigDialog::setupManagerConnections(KConfigDialogManager *manager)
KonviConfigDialog* KonviConfigDialog::exists(const char* name) KonviConfigDialog* KonviConfigDialog::exists(const char* name)
{ {
return openDialogs.tqfind(name); return openDialogs.find(name);
} }
bool KonviConfigDialog::showDialog(const char* name) bool KonviConfigDialog::showDialog(const char* name)

@ -146,7 +146,7 @@ KonviSettingsDialog::KonviSettingsDialog( TQWidget *tqparent) :
connect(m_confAliasWdg, TQT_SIGNAL(modified()), this, TQT_SLOT(modifiedSlot())); connect(m_confAliasWdg, TQT_SIGNAL(modified()), this, TQT_SLOT(modifiedSlot()));
//Behaviour/Auto Replace //Behaviour/Auto Replace
m_confAutoreplaceWdg = new Autoreplace_Config( this, "Autotqreplace" ); m_confAutoreplaceWdg = new Autoreplace_Config( this, "Autoreplace" );
pagePath.clear(); pagePath.clear();
pagePath << i18n("Behavior") << i18n("Auto Replace"); pagePath << i18n("Behavior") << i18n("Auto Replace");
addPage ( m_confAutoreplaceWdg, pagePath, "kview", i18n("Auto Replace") ); addPage ( m_confAutoreplaceWdg, pagePath, "kview", i18n("Auto Replace") );
@ -190,7 +190,7 @@ KonviSettingsDialog::KonviSettingsDialog( TQWidget *tqparent) :
m_confWatchedNicknamesWdg = new WatchedNicknames_Config( this, "WatchedNicknames" ); m_confWatchedNicknamesWdg = new WatchedNicknames_Config( this, "WatchedNicknames" );
pagePath.clear(); pagePath.clear();
pagePath << i18n("Notifications") << i18n("Watched Nicknames"); pagePath << i18n("Notifications") << i18n("Watched Nicknames");
addPage ( m_confWatchedNicknamesWdg, pagePath, "ktqfind", i18n("Watched Nicknames") ); addPage ( m_confWatchedNicknamesWdg, pagePath, "kfind", i18n("Watched Nicknames") );
// remember index so we can open this page later from outside // remember index so we can open this page later from outside
m_watchedNicknamesIndex=lastAddedIndex(); m_watchedNicknamesIndex=lastAddedIndex();
connect(m_confWatchedNicknamesWdg, TQT_SIGNAL(modified()), this, TQT_SLOT(modifiedSlot())); connect(m_confWatchedNicknamesWdg, TQT_SIGNAL(modified()), this, TQT_SLOT(modifiedSlot()));

@ -109,7 +109,7 @@ namespace Konversation
TQStringList::iterator end = addresses.end(); TQStringList::iterator end = addresses.end();
for ( TQStringList::iterator it = addresses.begin(); it != end; ++it ) for ( TQStringList::iterator it = addresses.begin(); it != end; ++it )
{ {
if(!(*it).tqcontains(TQChar( 0xE120))) if(!(*it).contains(TQChar( 0xE120)))
nicks.append(*it); nicks.append(*it);
else else
{ {

@ -154,8 +154,8 @@ void LogfileReader::saveLog()
i18n("Choose Destination Folder")); i18n("Choose Destination Folder"));
if(!destination.isEmpty()) if(!destination.isEmpty())
{ {
// tqreplace # with %25 to make it URL conforming // replace # with %25 to make it URL conforming
KIO::Job* job=KIO::copy(KURL(fileName.tqreplace("#","%23")), KIO::Job* job=KIO::copy(KURL(fileName.replace("#","%23")),
KURL(destination), KURL(destination),
true); true);

@ -71,7 +71,7 @@ void MultilineTextEdit::drawWhitespaces()
line=text(paragraph); line=text(paragraph);
// start looking for whitespaces from the beginning // start looking for whitespaces from the beginning
pos=0; pos=0;
while((pos=line.tqfind(regex,pos))!=-1) while((pos=line.find(regex,pos))!=-1)
{ {
// whitespace found is not the carriage return at the end of the line? // whitespace found is not the carriage return at the end of the line?
if(pos<((int)line.length()-1)) if(pos<((int)line.length()-1))

@ -249,12 +249,12 @@ int Nick::getSortingValue() const
int flags; int flags;
TQString sortingOrder = Preferences::sortOrder(); TQString sortingOrder = Preferences::sortOrder();
if(getChannelNick()->isOwner()) flags=sortingOrder.tqfind('q'); if(getChannelNick()->isOwner()) flags=sortingOrder.find('q');
else if(getChannelNick()->isAdmin()) flags=sortingOrder.tqfind('p'); else if(getChannelNick()->isAdmin()) flags=sortingOrder.find('p');
else if(getChannelNick()->isOp() ) flags=sortingOrder.tqfind('o'); else if(getChannelNick()->isOp() ) flags=sortingOrder.find('o');
else if(getChannelNick()->isHalfOp()) flags=sortingOrder.tqfind('h'); else if(getChannelNick()->isHalfOp()) flags=sortingOrder.find('h');
else if(getChannelNick()->hasVoice()) flags=sortingOrder.tqfind('v'); else if(getChannelNick()->hasVoice()) flags=sortingOrder.find('v');
else flags=sortingOrder.tqfind('-'); else flags=sortingOrder.find('-');
return flags; return flags;
} }

@ -344,7 +344,7 @@ void NickInfo::tooltipTableData(TQTextStream &tooltip) const
else if(!getRealName().isEmpty() && getRealName().lower() != loweredNickname()) else if(!getRealName().isEmpty() && getRealName().lower() != loweredNickname())
{ {
TQString escapedRealName( getRealName() ); TQString escapedRealName( getRealName() );
escapedRealName.tqreplace("<","&lt;").tqreplace(">","&gt;"); escapedRealName.replace("<","&lt;").replace(">","&gt;");
tooltip << escapedRealName; tooltip << escapedRealName;
dirty = true; dirty = true;
} }

@ -47,7 +47,7 @@ class NickInfo : public TQObject, public KShared
TQString loweredNickname() const; TQString loweredNickname() const;
TQString getHosttqmask() const; TQString getHosttqmask() const;
/** Currently return whether the user has set themselves to away with /away. /** Currently return whether the user has set themselves to away with /away.
* May be changed in the future to parse the nick string and see if it tqcontains * May be changed in the future to parse the nick string and see if it contains
* "|away" or "|afk" or something. * "|away" or "|afk" or something.
*/ */
bool isAway() const; bool isAway() const;

@ -284,7 +284,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
networkRoot->setText(nlvcServerName, serverName); networkRoot->setText(nlvcServerName, serverName);
// Update list of servers in the network that are connected. // Update list of servers in the network that are connected.
TQStringList serverList = TQStringList::split(",", networkRoot->text(nlvcAdditionalInfo)); TQStringList serverList = TQStringList::split(",", networkRoot->text(nlvcAdditionalInfo));
if (!serverList.tqcontains(serverName)) serverList.append(serverName); if (!serverList.contains(serverName)) serverList.append(serverName);
networkRoot->setText(nlvcAdditionalInfo, serverList.join(",")); networkRoot->setText(nlvcAdditionalInfo, serverList.join(","));
// Get item in nicklistview for the Offline branch. // Get item in nicklistview for the Offline branch.
TQListViewItem* offlineRoot = findItemType(networkRoot, NicksOnlineItem::OfflineItem); TQListViewItem* offlineRoot = findItemType(networkRoot, NicksOnlineItem::OfflineItem);
@ -382,7 +382,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
while (child) while (child)
{ {
TQListViewItem* nextChild = child->nextSibling(); TQListViewItem* nextChild = child->nextSibling();
if (channelList.tqfind(child->text(nlvcNick)) == channelList.end()) if (channelList.find(child->text(nlvcNick)) == channelList.end())
delete child; delete child;
child = nextChild; child = nextChild;
} }
@ -420,7 +420,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
if (static_cast<NicksOnlineItem*>(item)->type() != NicksOnlineItem::OfflineItem) if (static_cast<NicksOnlineItem*>(item)->type() != NicksOnlineItem::OfflineItem)
{ {
TQString nickname = item->text(nlvcNick); TQString nickname = item->text(nlvcNick);
if ((watchList.tqfind(nickname) == watchList.end()) && if ((watchList.find(nickname) == watchList.end()) &&
(serverName == item->text(nlvcServerName))) delete item; (serverName == item->text(nlvcServerName))) delete item;
} }
item = nextItem; item = nextItem;
@ -432,7 +432,7 @@ void NicksOnline::updateServerOnlineList(Server* servr)
{ {
TQListViewItem* nextItem = item->nextSibling(); TQListViewItem* nextItem = item->nextSibling();
TQString nickname = item->text(nlvcNick); TQString nickname = item->text(nlvcNick);
if ((watchList.tqfind(nickname) == watchList.end()) && if ((watchList.find(nickname) == watchList.end()) &&
(serverName == item->text(nlvcServerName))) delete item; (serverName == item->text(nlvcServerName))) delete item;
item = nextItem; item = nextItem;
} }
@ -623,7 +623,7 @@ const TQString& nickname)
Server* server = KonversationApplication::instance()->getConnectionManager()->getServerByName(serverName); Server* server = KonversationApplication::instance()->getConnectionManager()->getServerByName(serverName);
if (!server) return 0; if (!server) return 0;
TQString networkName = server->getDisplayName(); TQString networkName = server->getDisplayName();
TQListViewItem* networkRoot = m_nickListView->tqfindItem(networkName, nlvcNetwork); TQListViewItem* networkRoot = m_nickListView->findItem(networkName, nlvcNetwork);
if (!networkRoot) return 0; if (!networkRoot) return 0;
TQListViewItem* nickRoot = findItemChild(networkRoot, nickname, NicksOnlineItem::NicknameItem); TQListViewItem* nickRoot = findItemChild(networkRoot, nickname, NicksOnlineItem::NicknameItem);
return nickRoot; return nickRoot;
@ -971,5 +971,5 @@ void NicksOnline::childAdjustFocus() {}
#include "nicksonline.moc" #include "nicksonline.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -130,10 +130,10 @@ void OSDWidget::showOSD( const TQString &text, bool preemptive )
{ {
TQString plaintext = text.copy(); TQString plaintext = text.copy();
plaintext.tqreplace(TQRegExp("</?(?:font|a|b|i)\\b[^>]*>"), TQString("")); plaintext.replace(TQRegExp("</?(?:font|a|b|i)\\b[^>]*>"), TQString(""));
plaintext.tqreplace(TQString("&lt;"), TQString("<")); plaintext.replace(TQString("&lt;"), TQString("<"));
plaintext.tqreplace(TQString("&gt;"), TQString(">")); plaintext.replace(TQString("&gt;"), TQString(">"));
plaintext.tqreplace(TQString("&amp;"), TQString("&")); plaintext.replace(TQString("&amp;"), TQString("&"));
if ( preemptive || !timerMin.isActive() ) if ( preemptive || !timerMin.isActive() )
{ {

@ -76,17 +76,17 @@ namespace Konversation
TQString aliasReplace; TQString aliasReplace;
// cut alias replacement from definition // cut alias replacement from definition
if ( aliasList[index].tqcontains("%p") ) if ( aliasList[index].contains("%p") )
aliasReplace = aliasList[index].section(' ',1); aliasReplace = aliasList[index].section(' ',1);
else else
aliasReplace = aliasList[index].section(' ',1 )+' '+line.section(' ',1 ); aliasReplace = aliasList[index].section(' ',1 )+' '+line.section(' ',1 );
// protect "%%" // protect "%%"
aliasReplace.tqreplace("%%","%\x01"); aliasReplace.replace("%%","%\x01");
// tqreplace %p placeholder with rest of line // replace %p placeholder with rest of line
aliasReplace.tqreplace("%p",line.section(' ',1)); aliasReplace.replace("%p",line.section(' ',1));
// restore "%<1>" as "%%" // restore "%<1>" as "%%"
aliasReplace.tqreplace("%\x01","%%"); aliasReplace.replace("%\x01","%%");
// modify line // modify line
line=aliasReplace; line=aliasReplace;
// return "replaced" // return "replaced"
@ -191,17 +191,17 @@ namespace Konversation
if(!Preferences::disableExpansion()) if(!Preferences::disableExpansion())
{ {
// replace placeholders // replace placeholders
inputLine.tqreplace("%%","%\x01"); // make sure to protect double %% inputLine.replace("%%","%\x01"); // make sure to protect double %%
inputLine.tqreplace("%B","\x02"); // tqreplace %B with bold char inputLine.replace("%B","\x02"); // replace %B with bold char
inputLine.tqreplace("%C","\x03"); // tqreplace %C with color char inputLine.replace("%C","\x03"); // replace %C with color char
inputLine.tqreplace("%G","\x07"); // tqreplace %G with ASCII BEL 0x07 inputLine.replace("%G","\x07"); // replace %G with ASCII BEL 0x07
inputLine.tqreplace("%I","\x09"); // tqreplace %I with italics char inputLine.replace("%I","\x09"); // replace %I with italics char
inputLine.tqreplace("%O","\x0f"); // tqreplace %O with reset to default char inputLine.replace("%O","\x0f"); // replace %O with reset to default char
inputLine.tqreplace("%S","\x13"); // tqreplace %S with strikethru char inputLine.replace("%S","\x13"); // replace %S with strikethru char
// inputLine.tqreplace(TQRegExp("%?"),"\x15"); // inputLine.replace(TQRegExp("%?"),"\x15");
inputLine.tqreplace("%R","\x16"); // tqreplace %R with reverse char inputLine.replace("%R","\x16"); // replace %R with reverse char
inputLine.tqreplace("%U","\x1f"); // tqreplace %U with underline char inputLine.replace("%U","\x1f"); // replace %U with underline char
inputLine.tqreplace("%\x01","%"); // restore double %% as single % inputLine.replace("%\x01","%"); // restore double %% as single %
} }
TQString line=inputLine.lower(); TQString line=inputLine.lower();
@ -373,7 +373,7 @@ namespace Konversation
{ {
OutputFilterResult result; OutputFilterResult result;
if(channelName.tqcontains(",")) // Protect against #foo,0 tricks if(channelName.contains(",")) // Protect against #foo,0 tricks
channelName = channelName.remove(",0"); channelName = channelName.remove(",0");
//else if(channelName == "0") // FIXME IRC RFC 2812 section 3.2.1 //else if(channelName == "0") // FIXME IRC RFC 2812 section 3.2.1
@ -409,7 +409,7 @@ namespace Konversation
if(isAChannel(destination)) if(isAChannel(destination))
{ {
// get nick to kick // get nick to kick
TQString victim = parameter.left(parameter.tqfind(" ")); TQString victim = parameter.left(parameter.find(" "));
if(victim.isEmpty()) if(victim.isEmpty())
{ {
@ -460,7 +460,7 @@ namespace Konversation
if(isAChannel(parameter)) if(isAChannel(parameter))
{ {
// get channel name // get channel name
TQString channel = parameter.left(parameter.tqfind(" ")); TQString channel = parameter.left(parameter.find(" "));
// get part reason (if any) // get part reason (if any)
TQString reason = parameter.mid(channel.length() + 1); TQString reason = parameter.mid(channel.length() + 1);
@ -512,7 +512,7 @@ namespace Konversation
if(isAChannel(parameter)) if(isAChannel(parameter))
{ {
// get channel name // get channel name
TQString channel=parameter.left(parameter.tqfind(" ")); TQString channel=parameter.left(parameter.find(" "));
// get topic (if any) // get topic (if any)
TQString topic=parameter.mid(channel.length()+1); TQString topic=parameter.mid(channel.length()+1);
// if no topic given, retrieve topic // if no topic given, retrieve topic
@ -614,7 +614,7 @@ namespace Konversation
OutputFilterResult OutputFilter::parseNotice(const TQString &parameter) OutputFilterResult OutputFilter::parseNotice(const TQString &parameter)
{ {
OutputFilterResult result; OutputFilterResult result;
TQString recipient = parameter.left(parameter.tqfind(" ")); TQString recipient = parameter.left(parameter.find(" "));
TQString message = parameter.mid(recipient.length()+1); TQString message = parameter.mid(recipient.length()+1);
if(parameter.isEmpty() || message.isEmpty()) if(parameter.isEmpty() || message.isEmpty())
@ -731,7 +731,7 @@ namespace Konversation
OutputFilterResult OutputFilter::parseSMsg(const TQString &parameter) OutputFilterResult OutputFilter::parseSMsg(const TQString &parameter)
{ {
OutputFilterResult result; OutputFilterResult result;
TQString recipient = parameter.left(parameter.tqfind(" ")); TQString recipient = parameter.left(parameter.find(" "));
TQString message = parameter.mid(recipient.length() + 1); TQString message = parameter.mid(recipient.length() + 1);
if(message.startsWith(commandChar + "me")) if(message.startsWith(commandChar + "me"))
@ -842,7 +842,7 @@ namespace Konversation
else else
{ {
TQString tmpParameter = parameter; TQString tmpParameter = parameter;
TQStringList parameterList = TQStringList::split(' ', tmpParameter.tqreplace("\\ ", "%20")); TQStringList parameterList = TQStringList::split(' ', tmpParameter.replace("\\ ", "%20"));
TQString dccType = parameterList[0].lower(); TQString dccType = parameterList[0].lower();
@ -959,7 +959,7 @@ namespace Konversation
OutputFilterResult result; OutputFilterResult result;
/*TQString newFileName(fileName); /*TQString newFileName(fileName);
newFileName.tqreplace(" ", "_");*/ newFileName.replace(" ", "_");*/
result.toServer = "PRIVMSG " + sender + " :" + '\x01' + "DCC RESUME " + fileName + ' ' + port + ' ' result.toServer = "PRIVMSG " + sender + " :" + '\x01' + "DCC RESUME " + fileName + ' ' + port + ' '
+ TQString::number(startAt) + '\x01'; + TQString::number(startAt) + '\x01';
@ -1040,7 +1040,7 @@ namespace Konversation
{ {
TQStringList parameterList = TQStringList::split(' ', parameter); TQStringList parameterList = TQStringList::split(' ', parameter);
if(parameterList[0].tqfind("../") == -1) if(parameterList[0].find("../") == -1)
{ {
emit launchScript(destination, parameter); emit launchScript(destination, parameter);
} }
@ -1323,7 +1323,7 @@ namespace Konversation
{ {
for(unsigned int index=0;index<parameterList.count();index++) for(unsigned int index=0;index<parameterList.count();index++)
{ {
if(!parameterList[index].tqcontains('!')) if(!parameterList[index].contains('!'))
{ {
parameterList[index] += "!*"; parameterList[index] += "!*";
} }
@ -1368,7 +1368,7 @@ namespace Konversation
for (TQStringList::Iterator it = unignoreList.begin(); it != unignoreList.end(); ++it) for (TQStringList::Iterator it = unignoreList.begin(); it != unignoreList.end(); ++it)
{ {
// If pattern looks incomplete, try to complete it // If pattern looks incomplete, try to complete it
if (!(*it).tqcontains('!')) if (!(*it).contains('!'))
{ {
TQString fixedPattern = (*it); TQString fixedPattern = (*it);
fixedPattern += "!*"; fixedPattern += "!*";
@ -1471,7 +1471,7 @@ namespace Konversation
{ {
Q_ASSERT(m_server); Q_ASSERT(m_server);
// XXX if we ever see the assert, we need the ternary // XXX if we ever see the assert, we need the ternary
return m_server? m_server->isAChannel(check) : TQString("#&").tqcontains(check.at(0)); return m_server? m_server->isAChannel(check) : TQString("#&").contains(check.at(0));
} }
OutputFilterResult OutputFilter::usage(const TQString& string) OutputFilterResult OutputFilter::usage(const TQString& string)
@ -1542,7 +1542,7 @@ namespace Konversation
emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1], splitted[2]); emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1], splitted[2]);
else if (splitted.count() == 2) else if (splitted.count() == 2)
{ {
if (splitted[0].tqcontains(TQRegExp(":[0-9]+$"))) if (splitted[0].contains(TQRegExp(":[0-9]+$")))
emit connectTo(Konversation::CreateNewConnection, splitted[0], "", splitted[1]); emit connectTo(Konversation::CreateNewConnection, splitted[0], "", splitted[1]);
else else
emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1]); emit connectTo(Konversation::CreateNewConnection, splitted[0], splitted[1]);
@ -1638,7 +1638,7 @@ namespace Konversation
{ {
TQString parameter(prametr.isEmpty()?destination:prametr); TQString parameter(prametr.isEmpty()?destination:prametr);
if(parameter.isEmpty() || parameter.tqcontains(' ')) if(parameter.isEmpty() || parameter.contains(' '))
return usage(i18n("Usage: %1delkey <nick> or <channel> deletes the encryption key for nick or channel").tqarg(commandChar)); return usage(i18n("Usage: %1delkey <nick> or <channel> deletes the encryption key for nick or channel").tqarg(commandChar));
m_server->setKeyForRecipient(parameter, ""); m_server->setKeyForRecipient(parameter, "");
@ -1717,7 +1717,7 @@ namespace Konversation
// FIXME: The reason we detect the host by occurrence of a dot is the large penalty // FIXME: The reason we detect the host by occurrence of a dot is the large penalty
// we would incur by using inputfilter to find out if there's a user==target on the // we would incur by using inputfilter to find out if there's a user==target on the
// server - once we have a better API for this, switch to it. // server - once we have a better API for this, switch to it.
else if (target.tqcontains('.')) else if (target.contains('.'))
{ {
KNetwork::KResolverResults resolved = KNetwork::KResolver::resolve(target,""); KNetwork::KResolverResults resolved = KNetwork::KResolver::resolve(target,"");
if(resolved.error() == KResolver::NoError && resolved.size() > 0) if(resolved.error() == KResolver::NoError && resolved.size() > 0)
@ -1786,5 +1786,5 @@ namespace Konversation
} }
#include "outputfilter.moc" #include "outputfilter.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -663,7 +663,7 @@ void Query::quitNick(const TQString& reason)
} }
else else
{ {
if (displayReason.tqfind(TQRegExp("[\\0000-\\0037]"))!=-1) if (displayReason.find(TQRegExp("[\\0000-\\0037]"))!=-1)
displayReason+="\017"; displayReason+="\017";
appendCommandMessage(i18n("Quit"),i18n("%1 has left this server (%2).").tqarg(getName()).tqarg(displayReason),false); appendCommandMessage(i18n("Quit"),i18n("%1 has left this server (%2).").tqarg(getName()).tqarg(displayReason),false);

@ -463,7 +463,7 @@ bool& isOp,bool& isHalfop,bool& hasVoice)
if (nickname.isEmpty()) return; if (nickname.isEmpty()) return;
while ((modeIndex = m_serverNickPrefixes.tqfind(nickname[0])) != -1) while ((modeIndex = m_serverNickPrefixes.find(nickname[0])) != -1)
{ {
if(nickname.isEmpty()) if(nickname.isEmpty())
return; return;
@ -741,7 +741,7 @@ void Server::notifyResponse(const TQString& nicksOnline)
//Are any nicks gone offline //Are any nicks gone offline
for (it = m_prevISONList.begin(); it != m_prevISONList.end(); ++it) for (it = m_prevISONList.begin(); it != m_prevISONList.end(); ++it)
{ {
if (lcActual.tqfind(' ' + (*it) + ' ', 0, false) == -1) if (lcActual.find(' ' + (*it) + ' ', 0, false) == -1)
{ {
setNickOffline(*it); setNickOffline(*it);
nicksOnlineChanged = true; nicksOnlineChanged = true;
@ -751,7 +751,7 @@ void Server::notifyResponse(const TQString& nicksOnline)
//Are any nicks gone online //Are any nicks gone online
for (it = actualList.begin(); it != actualList.end(); ++it) for (it = actualList.begin(); it != actualList.end(); ++it)
{ {
if (lcPrevISON.tqfind(' ' + (*it) + ' ', 0, false) == -1) { if (lcPrevISON.find(' ' + (*it) + ' ', 0, false) == -1) {
setWatchedNickOnline(*it); setWatchedNickOnline(*it);
nicksOnlineChanged = true; nicksOnlineChanged = true;
} }
@ -798,7 +798,7 @@ void Server::autoCommandsAndChannels()
TQString connectCommands = getServerGroup()->connectCommands(); TQString connectCommands = getServerGroup()->connectCommands();
if (!getNickname().isEmpty()) if (!getNickname().isEmpty())
connectCommands.tqreplace("%nick", getNickname()); connectCommands.replace("%nick", getNickname());
TQStringList connectCommandsList = TQStringList::split(";", connectCommands); TQStringList connectCommandsList = TQStringList::split(";", connectCommands);
TQStringList::iterator iter; TQStringList::iterator iter;
@ -831,7 +831,7 @@ void Server::resetNickSelection()
//for equivalence testing in case the identity gets changed underneath us //for equivalence testing in case the identity gets changed underneath us
m_referenceNicklist = getIdentity()->getNicknameList(); m_referenceNicklist = getIdentity()->getNicknameList();
//where in this identities nicklist will we have started? //where in this identities nicklist will we have started?
int start = m_referenceNicklist.tqfindIndex(getNickname()); int start = m_referenceNicklist.findIndex(getNickname());
int len = m_referenceNicklist.count(); int len = m_referenceNicklist.count();
//we first use this list of indices *after* we've already tried the current nick, which we don't want //we first use this list of indices *after* we've already tried the current nick, which we don't want
@ -877,7 +877,7 @@ void Server::processIncomingData()
if (m_rawLog) if (m_rawLog)
{ {
TQString toRaw = front; TQString toRaw = front;
m_rawLog->appendRaw("&gt;&gt; " + toRaw.tqreplace("&","&amp;").tqreplace("<","&lt;").tqreplace(">","&gt;").tqreplace(TQRegExp("\\s"), "&nbsp;")); m_rawLog->appendRaw("&gt;&gt; " + toRaw.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;").replace(TQRegExp("\\s"), "&nbsp;"));
} }
m_inputFilter.parseLine(front); m_inputFilter.parseLine(front);
m_processingIncoming = false; m_processingIncoming = false;
@ -921,7 +921,7 @@ void Server::incoming()
// split buffer to lines // split buffer to lines
TQValueList<TQCString> qcsBufferLines; TQValueList<TQCString> qcsBufferLines;
int lastLFposition = -1; int lastLFposition = -1;
for( int nextLFposition ; ( nextLFposition = qcsBuffer.tqfind('\n', lastLFposition+1) ) != -1 ; lastLFposition = nextLFposition ) for( int nextLFposition ; ( nextLFposition = qcsBuffer.find('\n', lastLFposition+1) ) != -1 ; lastLFposition = nextLFposition )
qcsBufferLines << qcsBuffer.mid(lastLFposition+1, nextLFposition-lastLFposition-1); qcsBufferLines << qcsBuffer.mid(lastLFposition+1, nextLFposition-lastLFposition-1);
// remember the incomplete line (split by packets) // remember the incomplete line (split by packets)
@ -943,10 +943,10 @@ void Server::incoming()
{ {
if( lineSplit[0][0] == ':' ) // does this message have a prefix? if( lineSplit[0][0] == ':' ) // does this message have a prefix?
{ {
if( !lineSplit[0].tqcontains('!') ) // is this a server(global) message? if( !lineSplit[0].contains('!') ) // is this a server(global) message?
isServerMessage = true; isServerMessage = true;
else else
senderNick = lineSplit[0].mid(1, lineSplit[0].tqfind('!')-1); senderNick = lineSplit[0].mid(1, lineSplit[0].find('!')-1);
lineSplit.pop_front(); // remove prefix lineSplit.pop_front(); // remove prefix
} }
@ -1056,7 +1056,7 @@ int Server::_send_internal(TQString outputLine)
{ {
TQStringList outputLineSplit=TQStringList::split(" ", outputLine); TQStringList outputLineSplit=TQStringList::split(" ", outputLine);
//Lets cache the uppercase command so we don't miss or reiterate too much //Lets cache the uppercase command so we don't miss or reiterate too much
int outboundCommand=outcmds.tqfindIndex(outputLineSplit[0].upper()); int outboundCommand=outcmds.findIndex(outputLineSplit[0].upper());
if (outputLine.at(outputLine.length()-1) == '\n') if (outputLine.at(outputLine.length()-1) == '\n')
{ {
@ -1099,7 +1099,7 @@ int Server::_send_internal(TQString outputLine)
TQString blowfishKey=getKeyForRecipient(outputLineSplit[1]); TQString blowfishKey=getKeyForRecipient(outputLineSplit[1]);
if (!blowfishKey.isEmpty() && outboundCommand >1) if (!blowfishKey.isEmpty() && outboundCommand >1)
{ {
int colon = outputLine.tqfind(':'); int colon = outputLine.find(':');
if (colon > -1) if (colon > -1)
{ {
colon++; colon++;
@ -1136,7 +1136,7 @@ int Server::_send_internal(TQString outputLine)
TQ_LONG sout = m_socket->writeBlock(encoded, encoded.length()); TQ_LONG sout = m_socket->writeBlock(encoded, encoded.length());
if (m_rawLog) if (m_rawLog)
m_rawLog->appendRaw("&lt;&lt; " + outputLine.tqreplace("&","&amp;").tqreplace("<","&lt;").tqreplace(">","&gt;")); m_rawLog->appendRaw("&lt;&lt; " + outputLine.replace("&","&amp;").replace("<","&lt;").replace(">","&gt;"));
return sout; return sout;
} }
@ -1279,7 +1279,7 @@ void Server::ctcpReply(const TQString &receiver,const TQString &text)
NickInfoPtr Server::getNickInfo(const TQString& nickname) NickInfoPtr Server::getNickInfo(const TQString& nickname)
{ {
TQString lcNickname(nickname.lower()); TQString lcNickname(nickname.lower());
if (m_allNicks.tqcontains(lcNickname)) if (m_allNicks.contains(lcNickname))
{ {
NickInfoPtr nickinfo = m_allNicks[lcNickname]; NickInfoPtr nickinfo = m_allNicks[lcNickname];
Q_ASSERT(nickinfo); Q_ASSERT(nickinfo);
@ -1310,7 +1310,7 @@ const NickInfoMap* Server::getAllNicks() { return &m_allNicks; }
const ChannelNickMap *Server::getJoinedChannelMembers(const TQString& channelName) const const ChannelNickMap *Server::getJoinedChannelMembers(const TQString& channelName) const
{ {
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
if (m_joinedChannels.tqcontains(lcChannelName)) if (m_joinedChannels.contains(lcChannelName))
return m_joinedChannels[lcChannelName]; return m_joinedChannels[lcChannelName];
else else
return 0; return 0;
@ -1322,7 +1322,7 @@ const ChannelNickMap *Server::getJoinedChannelMembers(const TQString& channelNam
const ChannelNickMap *Server::getUnjoinedChannelMembers(const TQString& channelName) const const ChannelNickMap *Server::getUnjoinedChannelMembers(const TQString& channelName) const
{ {
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
if (m_unjoinedChannels.tqcontains(lcChannelName)) if (m_unjoinedChannels.contains(lcChannelName))
return m_unjoinedChannels[lcChannelName]; return m_unjoinedChannels[lcChannelName];
else else
return 0; return 0;
@ -1348,7 +1348,7 @@ ChannelNickPtr Server::getChannelNick(const TQString& channelName, const TQStrin
const ChannelNickMap *channelNickMap = getChannelMembers(channelName); const ChannelNickMap *channelNickMap = getChannelMembers(channelName);
if (channelNickMap) if (channelNickMap)
{ {
if (channelNickMap->tqcontains(lcNickname)) if (channelNickMap->contains(lcNickname))
return (*channelNickMap)[lcNickname]; return (*channelNickMap)[lcNickname];
else else
return 0; return 0;
@ -1375,7 +1375,7 @@ ChannelNickPtr Server::setChannelNick(const TQString& channelName, const TQStrin
// Create a lower case nick list from the watch list. // Create a lower case nick list from the watch list.
TQStringList watchLowerList=TQStringList::split(' ',watchlist.lower()); TQStringList watchLowerList=TQStringList::split(' ',watchlist.lower());
// If on the watch list, add channel and nick to unjoinedChannels list. // If on the watch list, add channel and nick to unjoinedChannels list.
if (watchLowerList.tqfind(lcNickname) != watchLowerList.end()) if (watchLowerList.find(lcNickname) != watchLowerList.end())
{ {
channelNick = addNickToUnjoinedChannelsList(channelName, nickname); channelNick = addNickToUnjoinedChannelsList(channelName, nickname);
channelNick->setMode(mode); channelNick->setMode(mode);
@ -1395,7 +1395,7 @@ TQStringList Server::getNickJoinedChannels(const TQString& nickname)
ChannelMembershipMap::ConstIterator channel; ChannelMembershipMap::ConstIterator channel;
for( channel = m_joinedChannels.begin(); channel != m_joinedChannels.end(); ++channel ) for( channel = m_joinedChannels.begin(); channel != m_joinedChannels.end(); ++channel )
{ {
if (channel.data()->tqcontains(lcNickname)) channellist.append(channel.key()); if (channel.data()->contains(lcNickname)) channellist.append(channel.key());
} }
return channellist; return channellist;
} }
@ -1408,11 +1408,11 @@ TQStringList Server::getNickChannels(const TQString& nickname)
ChannelMembershipMap::ConstIterator channel; ChannelMembershipMap::ConstIterator channel;
for( channel = m_joinedChannels.begin(); channel != m_joinedChannels.end(); ++channel ) for( channel = m_joinedChannels.begin(); channel != m_joinedChannels.end(); ++channel )
{ {
if (channel.data()->tqcontains(lcNickname)) channellist.append(channel.key()); if (channel.data()->contains(lcNickname)) channellist.append(channel.key());
} }
for( channel = m_unjoinedChannels.begin(); channel != m_unjoinedChannels.end(); ++channel ) for( channel = m_unjoinedChannels.begin(); channel != m_unjoinedChannels.end(); ++channel )
{ {
if (channel.data()->tqcontains(lcNickname)) channellist.append(channel.key()); if (channel.data()->contains(lcNickname)) channellist.append(channel.key());
} }
return channellist; return channellist;
} }
@ -1610,7 +1610,7 @@ void Server::requestDccSend(const TQString &a_recipient)
Nick* lookNick=nicks.first(); Nick* lookNick=nicks.first();
while(lookNick) while(lookNick)
{ {
if(!nickList.tqcontains(lookNick->getChannelNick()->getNickname())) nickList.append(lookNick->getChannelNick()->getNickname()); if(!nickList.contains(lookNick->getChannelNick()->getNickname())) nickList.append(lookNick->getChannelNick()->getNickname());
lookNick=nicks.next(); lookNick=nicks.next();
} }
lookChannel=m_channelList.next(); lookChannel=m_channelList.next();
@ -1620,7 +1620,7 @@ void Server::requestDccSend(const TQString &a_recipient)
class Query* lookQuery=m_queryList.first(); class Query* lookQuery=m_queryList.first();
while(lookQuery) while(lookQuery)
{ {
if(!nickList.tqcontains(lookQuery->getName())) nickList.append(lookQuery->getName()); if(!nickList.contains(lookQuery->getName())) nickList.append(lookQuery->getName());
lookQuery=m_queryList.next(); lookQuery=m_queryList.next();
} }
@ -1755,7 +1755,7 @@ void Server::dccResumeGetRequest(const TQString &sender, const TQString &fileNam
{ {
Konversation::OutputFilterResult result; Konversation::OutputFilterResult result;
if (fileName.tqcontains(" ") > 0) if (fileName.contains(" ") > 0)
result = getOutputFilter()->resumeRequest(sender,"\""+fileName+"\"",port,startAt); result = getOutputFilter()->resumeRequest(sender,"\""+fileName+"\"",port,startAt);
else else
result = getOutputFilter()->resumeRequest(sender,fileName,port,startAt); result = getOutputFilter()->resumeRequest(sender,fileName,port,startAt);
@ -2033,7 +2033,7 @@ void Server::updateChannelMode(const TQString &updater, const TQString &channelN
// "q" is the likely answer.. UnrealIRCd and euIRCd use it. // "q" is the likely answer.. UnrealIRCd and euIRCd use it.
// TODO these need to become dynamic // TODO these need to become dynamic
TQString userModes="vhoqa"; // voice halfop op owner admin TQString userModes="vhoqa"; // voice halfop op owner admin
int modePos = userModes.tqfind(mode); int modePos = userModes.find(mode);
if (modePos > 0) if (modePos > 0)
{ {
ChannelNickPtr updateeNick = getChannelNick(channelName, parameter); ChannelNickPtr updateeNick = getChannelNick(channelName, parameter);
@ -2164,7 +2164,7 @@ ChannelNickPtr Server::addNickToJoinedChannelsList(const TQString& channelName,
// Move the channel from unjoined list (if present) to joined list. // Move the channel from unjoined list (if present) to joined list.
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
ChannelNickMap *channel; ChannelNickMap *channel;
if (m_unjoinedChannels.tqcontains(lcChannelName)) if (m_unjoinedChannels.contains(lcChannelName))
{ {
channel = m_unjoinedChannels[lcChannelName]; channel = m_unjoinedChannels[lcChannelName];
m_unjoinedChannels.remove(lcChannelName); m_unjoinedChannels.remove(lcChannelName);
@ -2174,7 +2174,7 @@ ChannelNickPtr Server::addNickToJoinedChannelsList(const TQString& channelName,
else else
{ {
// Create a new list in the joined channels if not already present. // Create a new list in the joined channels if not already present.
if (!m_joinedChannels.tqcontains(lcChannelName)) if (!m_joinedChannels.contains(lcChannelName))
{ {
channel = new ChannelNickMap; channel = new ChannelNickMap;
m_joinedChannels.insert(lcChannelName, channel); m_joinedChannels.insert(lcChannelName, channel);
@ -2185,7 +2185,7 @@ ChannelNickPtr Server::addNickToJoinedChannelsList(const TQString& channelName,
} }
// Add NickInfo to channel list if not already in the list. // Add NickInfo to channel list if not already in the list.
ChannelNickPtr channelNick; ChannelNickPtr channelNick;
if (!channel->tqcontains(lcNickname)) if (!channel->contains(lcNickname))
{ {
channelNick = new ChannelNick(nickInfo, false, false, false, false, false); channelNick = new ChannelNick(nickInfo, false, false, false, false, false);
Q_ASSERT(channelNick); Q_ASSERT(channelNick);
@ -2242,7 +2242,7 @@ ChannelNickPtr Server::addNickToUnjoinedChannelsList(const TQString& channelName
// Move the channel from joined list (if present) to unjoined list. // Move the channel from joined list (if present) to unjoined list.
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
ChannelNickMap *channel; ChannelNickMap *channel;
if (m_joinedChannels.tqcontains(lcChannelName)) if (m_joinedChannels.contains(lcChannelName))
{ {
channel = m_joinedChannels[lcChannelName]; channel = m_joinedChannels[lcChannelName];
m_joinedChannels.remove(lcChannelName); m_joinedChannels.remove(lcChannelName);
@ -2252,7 +2252,7 @@ ChannelNickPtr Server::addNickToUnjoinedChannelsList(const TQString& channelName
else else
{ {
// Create a new list in the unjoined channels if not already present. // Create a new list in the unjoined channels if not already present.
if (!m_unjoinedChannels.tqcontains(lcChannelName)) if (!m_unjoinedChannels.contains(lcChannelName))
{ {
channel = new ChannelNickMap; channel = new ChannelNickMap;
m_unjoinedChannels.insert(lcChannelName, channel); m_unjoinedChannels.insert(lcChannelName, channel);
@ -2263,7 +2263,7 @@ ChannelNickPtr Server::addNickToUnjoinedChannelsList(const TQString& channelName
} }
// Add NickInfo to unjoinedChannels list if not already in the list. // Add NickInfo to unjoinedChannels list if not already in the list.
ChannelNickPtr channelNick; ChannelNickPtr channelNick;
if (!channel->tqcontains(lcNickname)) if (!channel->contains(lcNickname))
{ {
channelNick = new ChannelNick(nickInfo, false, false, false, false, false); channelNick = new ChannelNick(nickInfo, false, false, false, false, false);
channel->insert(lcNickname, channelNick); channel->insert(lcNickname, channelNick);
@ -2331,7 +2331,7 @@ bool Server::setNickOffline(const TQString& nickname)
if (nickInfo && wasOnline) if (nickInfo && wasOnline)
{ {
// Delete from query list, if present. // Delete from query list, if present.
if (m_queryNicks.tqcontains(lcNickname)) m_queryNicks.remove(lcNickname); if (m_queryNicks.contains(lcNickname)) m_queryNicks.remove(lcNickname);
// Delete the nickname from all channels (joined or unjoined). // Delete the nickname from all channels (joined or unjoined).
TQStringList nickChannels = getNickChannels(lcNickname); TQStringList nickChannels = getNickChannels(lcNickname);
TQStringList::iterator itEnd = nickChannels.end(); TQStringList::iterator itEnd = nickChannels.end();
@ -2343,7 +2343,7 @@ bool Server::setNickOffline(const TQString& nickname)
} }
// Delete NickInfo. // Delete NickInfo.
if (m_allNicks.tqcontains(lcNickname)) m_allNicks.remove(lcNickname); if (m_allNicks.contains(lcNickname)) m_allNicks.remove(lcNickname);
// If the nick was in the watch list, emit various signals and messages. // If the nick was in the watch list, emit various signals and messages.
if (isWatchedNick(nickname)) setWatchedNickOffline(nickname, nickInfo); if (isWatchedNick(nickname)) setWatchedNickOffline(nickname, nickInfo);
@ -2366,7 +2366,7 @@ bool Server::deleteNickIfUnlisted(const TQString &nickname)
// Don't delete our own nickinfo. // Don't delete our own nickinfo.
if (lcNickname == loweredNickname()) return false; if (lcNickname == loweredNickname()) return false;
if (!m_queryNicks.tqcontains(lcNickname)) if (!m_queryNicks.contains(lcNickname))
{ {
TQStringList nickChannels = getNickChannels(nickname); TQStringList nickChannels = getNickChannels(nickname);
if (nickChannels.isEmpty()) if (nickChannels.isEmpty())
@ -2390,10 +2390,10 @@ void Server::removeChannelNick(const TQString& channelName, const TQString& nick
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
TQString lcNickname = nickname.lower(); TQString lcNickname = nickname.lower();
ChannelNickMap *channel; ChannelNickMap *channel;
if (m_joinedChannels.tqcontains(lcChannelName)) if (m_joinedChannels.contains(lcChannelName))
{ {
channel = m_joinedChannels[lcChannelName]; channel = m_joinedChannels[lcChannelName];
if (channel->tqcontains(lcNickname)) if (channel->contains(lcNickname))
{ {
channel->remove(lcNickname); channel->remove(lcNickname);
doSignal = true; doSignal = true;
@ -2404,10 +2404,10 @@ void Server::removeChannelNick(const TQString& channelName, const TQString& nick
} }
else else
{ {
if (m_unjoinedChannels.tqcontains(lcChannelName)) if (m_unjoinedChannels.contains(lcChannelName))
{ {
channel = m_unjoinedChannels[lcChannelName]; channel = m_unjoinedChannels[lcChannelName];
if (channel->tqcontains(lcNickname)) if (channel->contains(lcNickname))
{ {
channel->remove(lcNickname); channel->remove(lcNickname);
doSignal = true; doSignal = true;
@ -2453,7 +2453,7 @@ bool Server::isWatchedNick(const TQString& nickname)
// Get watch list from preferences. // Get watch list from preferences.
TQString watchlist= ' ' + getWatchListString() + ' '; TQString watchlist= ' ' + getWatchListString() + ' ';
// Search case-insensitivly // Search case-insensitivly
return (watchlist.tqfind(' ' + nickname + ' ', 0, 0) != -1); return (watchlist.find(' ' + nickname + ' ', 0, 0) != -1);
} }
/** /**
@ -2468,7 +2468,7 @@ void Server::removeJoinedChannel(const TQString& channelName)
TQStringList watchListLower = getWatchList(); TQStringList watchListLower = getWatchList();
TQString lcChannelName = channelName.lower(); TQString lcChannelName = channelName.lower();
// Move the channel nick list from the joined to unjoined lists. // Move the channel nick list from the joined to unjoined lists.
if (m_joinedChannels.tqcontains(lcChannelName)) if (m_joinedChannels.contains(lcChannelName))
{ {
doSignal = true; doSignal = true;
ChannelNickMap* channel = m_joinedChannels[lcChannelName]; ChannelNickMap* channel = m_joinedChannels[lcChannelName];
@ -2482,7 +2482,7 @@ void Server::removeJoinedChannel(const TQString& channelName)
for ( member = channel->begin(); member != channel->end() ;) for ( member = channel->begin(); member != channel->end() ;)
{ {
TQString lcNickname = member.key(); TQString lcNickname = member.key();
if (watchListLower.tqfind(lcNickname) == watchListLower.end()) if (watchListLower.find(lcNickname) == watchListLower.end())
{ {
// Remove the unwatched nickname from the unjoined channel. // Remove the unwatched nickname from the unjoined channel.
channel->remove(member); channel->remove(member);
@ -2536,7 +2536,7 @@ void Server::renameNickInfo(NickInfoPtr nickInfo, const TQString& newname)
} }
// Rename key in Query list. // Rename key in Query list.
if (m_queryNicks.tqcontains(lcNickname)) if (m_queryNicks.contains(lcNickname))
{ {
m_queryNicks.remove(lcNickname); m_queryNicks.remove(lcNickname);
m_queryNicks.insert(lcNewname, nickInfo); m_queryNicks.insert(lcNewname, nickInfo);
@ -2826,7 +2826,7 @@ const TQString& /*parameter*/)
int index = 0, found = 0; int index = 0, found = 0;
TQChar toExpand; TQChar toExpand;
while ((found = toParse.tqfind('%',index)) != -1) while ((found = toParse.find('%',index)) != -1)
{ {
// append part before the % // append part before the %
out.append(toParse.mid(index,found-index)); out.append(toParse.mid(index,found-index));
@ -2836,7 +2836,7 @@ const TQString& /*parameter*/)
toExpand = toParse.at(index++); toExpand = toParse.at(index++);
if (toExpand == 's') if (toExpand == 's')
{ {
found = toParse.tqfind('%',index); found = toParse.find('%',index);
if (found == -1) // no other % (not valid) if (found == -1) // no other % (not valid)
break; break;
separator = toParse.mid(index,found-index); separator = toParse.mid(index,found-index);
@ -2917,7 +2917,7 @@ void Server::scriptExecutionError(const TQString& name)
bool Server::isAChannel(const TQString &channel) const bool Server::isAChannel(const TQString &channel) const
{ {
return (getChannelTypes().tqcontains(channel.at(0)) > 0); return (getChannelTypes().contains(channel.at(0)) > 0);
} }
void Server::addRawLog(bool show) void Server::addRawLog(bool show)
@ -3185,7 +3185,7 @@ void Server::setAway(bool away)
if (identity && identity->getShowAwayMessage()) if (identity && identity->getShowAwayMessage())
{ {
TQString message = identity->getAwayMessage(); TQString message = identity->getAwayMessage();
sendToAllChannels(message.tqreplace(TQRegExp("%s", false), m_awayReason)); sendToAllChannels(message.replace(TQRegExp("%s", false), m_awayReason));
} }
if (identity && identity->getInsertRememberLineOnAway()) if (identity && identity->getInsertRememberLineOnAway())
@ -3210,7 +3210,7 @@ void Server::setAway(bool away)
if (identity && identity->getShowAwayMessage()) if (identity && identity->getShowAwayMessage())
{ {
TQString message = identity->getReturnMessage(); TQString message = identity->getReturnMessage();
sendToAllChannels(message.tqreplace(TQRegExp("%t", false), awayTime())); sendToAllChannels(message.replace(TQRegExp("%t", false), awayTime()));
} }
} }
else else
@ -3344,5 +3344,5 @@ void Server::updateEncoding()
#include "server.moc" #include "server.moc"
// kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; tqreplace-tabs on; // kate: space-indent on; tab-width 4; indent-width 4; mixed-indent off; replace-tabs on;
// vim: set et sw=4 ts=4 cino=l1,cs,U1: // vim: set et sw=4 ts=4 cino=l1,cs,U1:

@ -207,7 +207,7 @@ namespace Konversation
// Track the server the Server List dialog told us to edit // Track the server the Server List dialog told us to edit
// and find out which server to select in the listbox // and find out which server to select in the listbox
m_editedServer = true; m_editedServer = true;
m_editedServerIndex = m_serverList.tqfindIndex(server); m_editedServerIndex = m_serverList.findIndex(server);
m_mainWidget->m_serverLBox->setCurrentItem(m_editedServerIndex); m_mainWidget->m_serverLBox->setCurrentItem(m_editedServerIndex);
editServer(); editServer();

@ -133,7 +133,7 @@ namespace Konversation
if (before.name().isEmpty()) if (before.name().isEmpty())
m_channelList.append(channel); m_channelList.append(channel);
else else
m_channelList.insert(m_channelList.tqfind(before), channel); m_channelList.insert(m_channelList.find(before), channel);
} }
void ServerGroupSettings::removeChannel(const ChannelSettings& channel) void ServerGroupSettings::removeChannel(const ChannelSettings& channel)

@ -78,7 +78,7 @@ KABC::Addressee ServerISON::getOfflineNickAddressee(TQString& nickname)
TQString lcNickname = nickname.lower(); TQString lcNickname = nickname.lower();
if(m_ISONList_invalid) if(m_ISONList_invalid)
recalculateAddressees(); recalculateAddressees();
if (m_offlineNickToAddresseeMap.tqcontains(lcNickname)) if (m_offlineNickToAddresseeMap.contains(lcNickname))
return m_offlineNickToAddresseeMap[lcNickname]; return m_offlineNickToAddresseeMap[lcNickname];
else else
return KABC::Addressee(); return KABC::Addressee();
@ -127,7 +127,7 @@ void ServerISON::recalculateAddressees()
// First check if we already know that this addressee is online. // First check if we already know that this addressee is online.
// If so, add all the nicks of the addressee that are online, but do not // If so, add all the nicks of the addressee that are online, but do not
// add the offline nicks. There is no point in monitoring such nicks. // add the offline nicks. There is no point in monitoring such nicks.
if (addresseeToOnlineNickMap.tqcontains(uid)) if (addresseeToOnlineNickMap.contains(uid))
{ {
TQStringList nicknames = addresseeToOnlineNickMap[uid]; TQStringList nicknames = addresseeToOnlineNickMap[uid];
TQStringList::iterator itEnd = nicknames.end(); TQStringList::iterator itEnd = nicknames.end();
@ -212,7 +212,7 @@ void ServerISON::nickInfoChanged(Server* /*server*/, const NickInfoPtr /*nickInf
//We need to call recalculateAddressees before returning m_ISONList //We need to call recalculateAddressees before returning m_ISONList
//Maybe we could do something like: //Maybe we could do something like:
//if(m_ISONList.tqcontains(nickInfo->getNickName())) return; //if(m_ISONList.contains(nickInfo->getNickName())) return;
m_ISONList_invalid = true; m_ISONList_invalid = true;
} }
@ -227,7 +227,7 @@ bool joined, bool parted, const TQString& nickname)
{ {
// Whenever a nick on the watch list leaves the last joined channel, must recalculate lists. // Whenever a nick on the watch list leaves the last joined channel, must recalculate lists.
// The nick will be added to the ISON list. // The nick will be added to the ISON list.
if (joined && parted && m_watchList.tqcontains(nickname)) if (joined && parted && m_watchList.contains(nickname))
if (m_server->getNickJoinedChannels(nickname).isEmpty()) m_ISONList_invalid = true; if (m_server->getNickJoinedChannels(nickname).isEmpty()) m_ISONList_invalid = true;
} }

@ -84,7 +84,7 @@ namespace Konversation
pressPosition=e->pos(); pressPosition=e->pos();
urlToDrag = anchorAt(pressPosition); urlToDrag = anchorAt(pressPosition);
// HACK Replace % with \x03 in the url to keep TQt from doing stupid things // HACK Replace % with \x03 in the url to keep TQt from doing stupid things
urlToDrag = urlToDrag.tqreplace ('\x03', "%"); urlToDrag = urlToDrag.replace ('\x03', "%");
// Hack to counter the fact that we're given an decoded url // Hack to counter the fact that we're given an decoded url
urlToDrag = KURL::fromPathOrURL(urlToDrag).url(); urlToDrag = KURL::fromPathOrURL(urlToDrag).url();
if (!urlToDrag.isNull()) if (!urlToDrag.isNull())
@ -140,7 +140,7 @@ namespace Konversation
else if (link.startsWith("#") && m_server && m_server->isConnected()) else if (link.startsWith("#") && m_server && m_server->isConnected())
{ {
TQString channel(link); TQString channel(link);
channel.tqreplace("##","#"); channel.replace("##","#");
m_server->sendJoinCommand(channel); m_server->sendJoinCommand(channel);
} }
// Always use KDE default mailer. // Always use KDE default mailer.
@ -151,7 +151,7 @@ namespace Konversation
else else
{ {
TQString cmd = Preferences::webBrowserCmd(); TQString cmd = Preferences::webBrowserCmd();
cmd.tqreplace("%u",KURL::fromPathOrURL(link).url()); cmd.replace("%u",KURL::fromPathOrURL(link).url());
KProcess *proc = new KProcess; KProcess *proc = new KProcess;
TQStringList cmdAndArgs = KShell::splitArgs(cmd); TQStringList cmdAndArgs = KShell::splitArgs(cmd);
*proc << cmdAndArgs; *proc << cmdAndArgs;
@ -252,9 +252,9 @@ namespace Konversation
TQFontMetrics fm(currentFont()); TQFontMetrics fm(currentFont());
TQString text = m_fullText; TQString text = m_fullText;
// text.tqreplace("&", "&amp;"). Not needed as we do it in tagURLs // text.replace("&", "&amp;"). Not needed as we do it in tagURLs
text.tqreplace("<", "\x0blt;"). // tagUrls will tqreplace \x0b with & text.replace("<", "\x0blt;"). // tagUrls will replace \x0b with &
tqreplace(">", "\x0bgt;"); replace(">", "\x0bgt;");
text = tagURLs(text, "", false); text = tagURLs(text, "", false);
if(height() < (fm.lineSpacing() * 2)) if(height() < (fm.lineSpacing() * 2))

@ -143,7 +143,7 @@ void UrlCatcher::openUrl(TQListViewItem* item)
else else
{ {
TQString cmd = Preferences::webBrowserCmd(); TQString cmd = Preferences::webBrowserCmd();
cmd.tqreplace("%u", url); cmd.replace("%u", url);
KProcess *proc = new KProcess; KProcess *proc = new KProcess;
TQStringList cmdAndArgs = KShell::splitArgs(cmd); TQStringList cmdAndArgs = KShell::splitArgs(cmd);
*proc << cmdAndArgs; *proc << cmdAndArgs;

@ -519,7 +519,7 @@ void ViewContainer::updateViewActions(int index)
action = actionCollection()->action("clear_window"); action = actionCollection()->action("clear_window");
if (action) action->setEnabled(insertSupported); if (action) action->setEnabled(insertSupported);
action = actionCollection()->action("edit_tqfind"); action = actionCollection()->action("edit_find");
if (action) if (action)
{ {
action->setText(i18n("Find Text...")); action->setText(i18n("Find Text..."));
@ -539,7 +539,7 @@ void ViewContainer::updateViewActions(int index)
if (m_frontServer) if (m_frontServer)
{ {
TQString name = m_frontServer->getDisplayName(); TQString name = m_frontServer->getDisplayName();
name = name.tqreplace('&', "&&"); name = name.replace('&', "&&");
channelListAction->setEnabled(true); channelListAction->setEnabled(true);
channelListAction->setChecked(m_frontServer->getChannelListPanel()); channelListAction->setChecked(m_frontServer->getChannelListPanel());
channelListAction->setText(i18n("Channel &List for %1").tqarg(name)); channelListAction->setText(i18n("Channel &List for %1").tqarg(name));
@ -561,7 +561,7 @@ void ViewContainer::updateViewActions(int index)
else else
{ {
TQString name = view->getName(); TQString name = view->getName();
name = name.tqreplace('&', "&&"); name = name.replace('&', "&&");
action->setText(i18n("&Open Logfile for %1").tqarg(name)); action->setText(i18n("&Open Logfile for %1").tqarg(name));
} }
} }
@ -629,7 +629,7 @@ void ViewContainer::updateViewActions(int index)
action = actionCollection()->action("clear_tabs"); action = actionCollection()->action("clear_tabs");
if (action) action->setEnabled(false); if (action) action->setEnabled(false);
action = actionCollection()->action("edit_tqfind"); action = actionCollection()->action("edit_find");
if (action) action->setEnabled(false); if (action) action->setEnabled(false);
action = actionCollection()->action("edit_find_next"); action = actionCollection()->action("edit_find_next");
@ -823,7 +823,7 @@ void ViewContainer::setViewNotification(ChatWindow* view, const Konversation::Ta
if (!view || view == m_tabWidget->currentPage()) if (!view || view == m_tabWidget->currentPage())
return; return;
if (type < Konversation::tnfControl && (m_activeViewOrderList.tqfind(view) == m_activeViewOrderList.end())) if (type < Konversation::tnfControl && (m_activeViewOrderList.find(view) == m_activeViewOrderList.end()))
m_activeViewOrderList.append(view); m_activeViewOrderList.append(view);
if (!Preferences::tabNotificationsLeds() && !Preferences::tabNotificationsText()) if (!Preferences::tabNotificationsLeds() && !Preferences::tabNotificationsText())
@ -1111,7 +1111,7 @@ void ViewContainer::unsetViewNotification(ChatWindow* view)
m_tabWidget->setTabColor(view, textColor); m_tabWidget->setTabColor(view, textColor);
} }
TQValueList<ChatWindow*>::iterator it = m_activeViewOrderList.tqfind(view); TQValueList<ChatWindow*>::iterator it = m_activeViewOrderList.find(view);
if (it != m_activeViewOrderList.end()) if (it != m_activeViewOrderList.end())
m_activeViewOrderList.remove(it); m_activeViewOrderList.remove(it);
@ -1564,7 +1564,7 @@ void ViewContainer::cleanupAfterClose(ChatWindow* view)
} }
// Remove the view from the active view list if it's still on it // Remove the view from the active view list if it's still on it
TQValueList<ChatWindow*>::iterator it = m_activeViewOrderList.tqfind(view); TQValueList<ChatWindow*>::iterator it = m_activeViewOrderList.find(view);
if (it != m_activeViewOrderList.end()) if (it != m_activeViewOrderList.end())
m_activeViewOrderList.remove(it); m_activeViewOrderList.remove(it);
@ -1755,7 +1755,7 @@ TQString ViewContainer::currentViewURL(bool passNetwork)
port = ':'+TQString::number(m_frontServer->getPort()); port = ':'+TQString::number(m_frontServer->getPort());
} }
if (server.tqcontains(':')) // IPv6 if (server.contains(':')) // IPv6
server = '['+server+']'; server = '['+server+']';
url = "irc://"+server+port+'/'+channel; url = "irc://"+server+port+'/'+channel;

@ -953,7 +953,7 @@ void ViewTree::paintEmptyArea(TQPainter* p, const TQRect& rect)
int y = last->itemPos() + last->height(); int y = last->itemPos() + last->height();
int x = visibleWidth(); int x = visibleWidth();
if (!rect.tqcontains(x-1, y+2)) if (!rect.contains(x-1, y+2))
return; return;
TQColor bgColor = paletteBackgroundColor(); TQColor bgColor = paletteBackgroundColor();

@ -90,7 +90,7 @@ void WatchedNicknames_Config::addNetworkBranch(Konversation::ServerGroupSettings
ValueListViewItem* groupItem=new ValueListViewItem(serverGroupList->id(),notifyListView,notifyListView->lastChild(),serverGroupList->name()); ValueListViewItem* groupItem=new ValueListViewItem(serverGroupList->id(),notifyListView,notifyListView->lastChild(),serverGroupList->name());
// get the group iterator to find all servers in the group // get the group iterator to find all servers in the group
TQMapConstIterator<int, TQStringList> groupIt=notifyList.tqfind(serverGroupList->id()); TQMapConstIterator<int, TQStringList> groupIt=notifyList.find(serverGroupList->id());
// get list of nicks for the current group // get list of nicks for the current group
TQStringList nicks=groupIt.data(); TQStringList nicks=groupIt.data();

Loading…
Cancel
Save