rename the following methods:

tqfind find
tqreplace replace
tqcontains contains


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 100dcb6968
commit 2a99db3ebc

@ -161,7 +161,7 @@ void FileSelectDlg::accept()
{
TQString groupName = m_cmbGroups->currentText();
Group* group = m_gman->tqfind(groupName);
Group* group = m_gman->find(groupName);
if(group)
{
group->addTorrent(tc);

@ -97,7 +97,7 @@ bool FilterBar::matchesFilter(kt::TorrentInterface* tc)
if (m_name_filter.length() == 0)
return true;
else
return tc->getStats().torrent_name.tqcontains(m_name_filter,cs);
return tc->getStats().torrent_name.contains(m_name_filter,cs);
}
void FilterBar::slotChangeFilter(const TQString& nameFilter)

@ -99,7 +99,7 @@ namespace kt
Group* GroupManager::newGroup(const TQString & name)
{
if (tqfind(name))
if (find(name))
return 0;
Group* g = new TorrentGroup(name);
@ -109,7 +109,7 @@ namespace kt
bool GroupManager::canRemove(const Group* g) const
{
return default_groups.tqfind(g->groupName()) == 0;
return default_groups.find(g->groupName()) == 0;
}
@ -180,7 +180,7 @@ namespace kt
throw;
}
if (!tqfind(g->groupName()))
if (!find(g->groupName()))
insert(g->groupName(),g);
else
delete g;
@ -203,7 +203,7 @@ namespace kt
void GroupManager::renameGroup(const TQString & old_name,const TQString & new_name)
{
Group* g = tqfind(old_name);
Group* g = find(old_name);
if (!g)
return;
@ -216,6 +216,6 @@ namespace kt
Group* GroupManager::findDefault(const TQString & name)
{
return default_groups.tqfind(name);
return default_groups.find(name);
}
}

@ -161,7 +161,7 @@ namespace kt
if (name.isNull() || name.length() == 0)
return;
if (gman->tqfind(name))
if (gman->find(name))
{
KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name));
return;
@ -177,7 +177,7 @@ namespace kt
if (!current_item)
return;
Group* g = groups.tqfind(current_item);
Group* g = groups.find(current_item);
if (!g)
return;
@ -200,7 +200,7 @@ namespace kt
if (!current_item)
return;
Group* g = groups.tqfind(current_item);
Group* g = groups.find(current_item);
if (!g)
return;
@ -212,7 +212,7 @@ namespace kt
if (g->groupName() == name)
return;
if (gman->tqfind(name))
if (gman->find(name))
{
KMessageBox::error(this,i18n("The group %1 already exists.").tqarg(name));
}
@ -252,7 +252,7 @@ namespace kt
Group* g = 0;
if (current_item)
g = groups.tqfind(current_item);
g = groups.find(current_item);
if (!g ||!gman->canRemove(g))
{
@ -278,7 +278,7 @@ namespace kt
if (!li)
return;
Group* g = groups.tqfind(li);
Group* g = groups.find(li);
if (g)
{
current = g;
@ -292,7 +292,7 @@ namespace kt
if (!li)
return;
TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.tqfind(li));
TorrentGroup* g = dynamic_cast<TorrentGroup*>(groups.find(li));
if (g)
{
TQValueList<TorrentInterface*> sel;
@ -329,7 +329,7 @@ namespace kt
void GroupView::onGroupsSubMenuItemActivated(KTorrentView* v,const TQString & group)
{
Group* g = gman->tqfind(group);
Group* g = gman->find(group);
if (g)
{
v->addSelectionToGroup(g);
@ -339,7 +339,7 @@ namespace kt
const Group* GroupView::findGroup(const TQString & name) const
{
Group* g = gman->tqfind(name);
Group* g = gman->find(name);
if (!g)
g = gman->findDefault(name);
@ -351,7 +351,7 @@ namespace kt
if (!current_item)
return;
Group* g = groups.tqfind(current_item);
Group* g = groups.find(current_item);
if (g)
openNewTab(g);
}

@ -65,7 +65,7 @@ void IPFilterWidget::btnAdd_clicked()
if(v.validate( ip, var ) == TQValidator::Acceptable)
{
if(lstPeers->tqfindItem(ip, 0) == 0)
if(lstPeers->findItem(ip, 0) == 0)
new KListViewItem(lstPeers, ip);
}
else

@ -363,7 +363,7 @@ void KTorrent::addTabPage(TQWidget* page,const TQPixmap & icon,
void KTorrent::removeTabPage(TQWidget* page)
{
if (!m_tab_map.tqcontains(page))
if (!m_tab_map.contains(page))
return;
m_tab_map.erase(page);
@ -558,7 +558,7 @@ void KTorrent::setupActions()
i18n("Check Data Integrity"),
TQString(),0,m_view_man,TQT_SLOT(checkDataIntegrity()),actionCollection(),"check_data");
m_tqfind = KStdAction::find(TQT_TQOBJECT(this),TQT_SLOT(tqfind()),actionCollection());
m_find = KStdAction::find(TQT_TQOBJECT(this),TQT_SLOT(find()),actionCollection());
//Plug actions to systemtray context menu
m_startall_systray->plug(m_systray_icon->contextMenu());
@ -1006,7 +1006,7 @@ void KTorrent::statusBarMsgExpired()
m_statusInfo->clear();
}
void KTorrent::tqfind()
void KTorrent::find()
{
KTorrentView* v = m_view_man->getCurrentView();
if (v)

@ -182,7 +182,7 @@ private slots:
void currentTabChanged(TQWidget* w);
void openDefaultView();
void statusBarMsgExpired();
void tqfind();
void find();
private:
void setupAccel();
@ -231,7 +231,7 @@ private:
KAction* m_queueaction;
KAction* m_datacheck;
KAction* m_ipfilter;
KAction* m_tqfind;
KAction* m_find;
KProgress* m_status_prog;
};

@ -347,7 +347,7 @@ void KTorrentCore::downloadFinishedSilently(KIO::Job *job)
else
{
TQString dir;
if (custom_save_locations.tqcontains(j))
if (custom_save_locations.contains(j))
{
// we have a custom save location so save to that
dir = custom_save_locations[j].path();

@ -485,7 +485,7 @@ void KTorrentView::addTorrent(TorrentInterface* tc)
void KTorrentView::removeTorrent(TorrentInterface* tc)
{
TQMap<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.tqfind(tc);
TQMap<kt::TorrentInterface*,KTorrentViewItem*>::iterator i = items.find(tc);
if (i != items.end())
{
KTorrentViewItem* tvi = i.data();

@ -78,7 +78,7 @@ Button::~Button()
if (r.search(m_realText) > -1)
{
TQString text = m_realText;
if (text.tqcontains(r2))
if (text.contains(r2))
text.remove(r2);
config->writeEntry(TQString("button_%1").tqarg(text), r.cap(1));
}
@ -304,7 +304,7 @@ void Button::contextMenuEvent(TQContextMenuEvent *e)
/* TQPopupMenu menu;
m_assignAccelAction->plug(&menu);
if (m_realText.tqcontains(TQRegExp("^&[0-9]\\s")))
if (m_realText.contains(TQRegExp("^&[0-9]\\s")))
m_clearAccelAction->plug(&menu);
emit contextMenu( &menu );
@ -341,7 +341,7 @@ TQString Button::realTextWithoutAccel() const
{
TQString text = m_realText;
TQRegExp r("^&[0-9]\\s");
if (text.tqcontains(r))
if (text.contains(r))
text.remove(r);
return text;
}

@ -249,7 +249,7 @@ void ButtonBar::deshrink(int preferredDimension, int actualDimension)
int i = 0;
for (TQValueList<uint>::iterator it = texts.begin(); it != texts.end(); ++it, i++)
{
if (m_buttons[i]->text().tqcontains("..."))
if (m_buttons[i]->text().contains("..."))
(*it)++;
newTextLength += *it;
}
@ -309,7 +309,7 @@ Button *ButtonBar::firstButton()
Button *ButtonBar::nextTo(Button *button)
{
ButtonList::iterator it = m_buttons.tqfind(button);
ButtonList::iterator it = m_buttons.find(button);
Button *next = 0;
if ((*it) == m_buttons.last())
next = m_buttons.first();
@ -326,7 +326,7 @@ Button *ButtonBar::nextTo(Button *button)
Button *ButtonBar::prevTo(Button *button)
{
ButtonList::iterator it = m_buttons.tqfind(button);
ButtonList::iterator it = m_buttons.find(button);
Button *prev = 0;
if (it == m_buttons.begin())
prev = m_buttons.last();

@ -404,7 +404,7 @@ void DDockWindow::moveToDockBottom()
void DDockWindow::moveToDock(DDockWindow::Position position )
{
if ( m_widgets.tqcontains( m_lastContextMenuButton ) )
if ( m_widgets.contains( m_lastContextMenuButton ) )
{
mainWindow()->moveWidget( position, m_widgets[ m_lastContextMenuButton ], m_lastContextMenuButton->realTextWithoutAccel() );
}

@ -121,10 +121,10 @@ void DMainWindow::addWidget(DTabWidget *tab, TQWidget *widget, const TQString &t
void DMainWindow::removeWidget(TQWidget *widget)
{
if (!m_widgets.tqcontains(widget))
if (!m_widgets.contains(widget))
return; //not a widget in main window
if (m_widgetTabs.tqcontains(widget))
if (m_widgetTabs.contains(widget))
{
DTabWidget *tab = m_widgetTabs[widget];
if (tab->indexOf(widget) >= 0)
@ -193,12 +193,12 @@ void DMainWindow::invalidateActiveTabWidget()
kdDebug(9000) << "tqinvalidate: " << focused << endl;
if (focused == 0)
return;
if (!m_widgets.tqcontains(focused))
if (!m_widgets.contains(focused))
{
kdDebug(9000) << " focused is not in m_widgets" << endl;
return;
}
if (m_widgetTabs.tqcontains(focused))
if (m_widgetTabs.contains(focused))
{
kdDebug(9000) << " focused is in m_widgets and m_widgetTabs" << endl;
DTabWidget *tab = m_widgetTabs[focused];
@ -223,7 +223,7 @@ DTabWidget *DMainWindow::createTab()
bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
{
TQWidget *w = (TQWidget*)obj;
if (!m_widgets.tqcontains(w))
if (!m_widgets.contains(w))
return KParts::MainWindow::eventFilter(obj, ev);
if ((m_currentWidget != w) && (ev->type() == TQEvent::FocusIn))
@ -233,7 +233,7 @@ bool DMainWindow::eventFilter(TQObject *obj, TQEvent *ev)
}
else if (ev->type() == TQEvent::IconChange)
{
if (m_widgetTabs.tqcontains(w))
if (m_widgetTabs.contains(w))
{
DTabWidget *tab = m_widgetTabs[w];
tab->setTabIconSet(w, w->icon() ? (*(w->icon())) : TQPixmap());
@ -266,7 +266,7 @@ void DMainWindow::closeTab(TQWidget *)
void DMainWindow::moveWidget(DDockWindow::Position position, TQWidget * view, const TQString & title)
{
if (m_docks.tqcontains(view))
if (m_docks.contains(view))
{
toolWindow(m_docks[view])->removeWidget(view);
@ -296,7 +296,7 @@ void DMainWindow::removeDockWidget(TQWidget *view)
bool DMainWindow::hasDockWidget(TQWidget *view)
{
return m_docks.tqcontains(view);
return m_docks.contains(view);
}
DDockWindow::Position DMainWindow::dockWidgetPosition(TQWidget *view)
@ -308,7 +308,7 @@ void DMainWindow::widgetDestroyed()
{
TQWidget *w = TQT_TQWIDGET(const_cast<TQT_BASE_OBJECT_NAME*>(sender()));
if (m_docks.tqcontains(w))
if (m_docks.contains(w))
{
kdError() << "Widget destroyed before being removed from UI!" << endl;
m_docks.remove(w);
@ -317,4 +317,4 @@ void DMainWindow::widgetDestroyed()
#include "dmainwindow.moc"
// kate: space-indent on; indent-width 4; tab-width 4; tqreplace-tabs on
// kate: space-indent on; indent-width 4; tab-width 4; replace-tabs on

@ -130,7 +130,7 @@ void KTorrentPreferences::addPrefPage(kt::PrefPageInterface* prefInterface)
void KTorrentPreferences::removePrefPage(kt::PrefPageInterface* pp)
{
if (!pages.tqcontains(pp))
if (!pages.contains(pp))
return;
TQFrame* fr = pages[pp];

@ -356,7 +356,7 @@ void SetMaxRate::rateSelected(int id)
{
int rate;
TQString ratestr = text(id).remove('&');
if (ratestr.tqcontains(i18n("Unlimited")))
if (ratestr.contains(i18n("Unlimited")))
rate = 0;
else
rate = ratestr.toInt();

@ -70,7 +70,7 @@ namespace kt
{
size += file.getSize();
setText(1,BytesToString(size));
int p = path.tqfind(bt::DirSeparator());
int p = path.find(bt::DirSeparator());
if (p == -1)
{
tqchildren.insert(path,newFileTreeItem(path,file));
@ -78,7 +78,7 @@ namespace kt
else
{
TQString subdir = path.left(p);
FileTreeDirItem* sd = subdirs.tqfind(subdir);
FileTreeDirItem* sd = subdirs.find(subdir);
if (!sd)
{
sd = newFileTreeDirItem(subdir);

@ -58,7 +58,7 @@ namespace dht
{
// add node to todo list
KBucketEntry e = UnpackBucketEntry(n,i*26);
if (!todo.tqcontains(e) && !visited.tqcontains(e) &&
if (!todo.contains(e) && !visited.contains(e) &&
todo.count() < 100)
{
todo.append(e);
@ -78,7 +78,7 @@ namespace dht
// add the peer who responded to the answered list, so we can do an announce
KBucketEntry e(rsp->getOrigin(),rsp->getID());
if (!answered.tqcontains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.tqcontains(e))
if (!answered.contains(KBucketEntryAndToken(e,gpr->getToken())) && !answered_visited.contains(e))
{
answered.append(KBucketEntryAndToken(e,gpr->getToken()));
}
@ -101,7 +101,7 @@ namespace dht
while (!answered.empty() && canDoRequest())
{
KBucketEntryAndToken & e = answered.first();
if (!answered_visited.tqcontains(e))
if (!answered_visited.contains(e))
{
AnnounceReq* anr = new AnnounceReq(node->getOurID(),info_hash,port,e.getToken());
anr->setOrigin(e.getAddress());
@ -117,7 +117,7 @@ namespace dht
{
KBucketEntry e = todo.first();
// onLy send a findNode if we haven't allrready visited the node
if (!visited.tqcontains(e))
if (!visited.contains(e))
{
// send a findNode to the node
GetPeersReq* gpr = new GetPeersReq(node->getOurID(),info_hash);

@ -72,7 +72,7 @@ namespace dht
void Database::store(const dht::Key & key,const DBItem & dbi)
{
DBItemList* dbl = items.tqfind(key);
DBItemList* dbl = items.find(key);
if (!dbl)
{
dbl = new DBItemList();
@ -83,7 +83,7 @@ namespace dht
void Database::sample(const dht::Key & key,DBItemList & tdbl,bt::Uint32 max_entries)
{
DBItemList* dbl = items.tqfind(key);
DBItemList* dbl = items.find(key);
if (!dbl)
return;
@ -144,7 +144,7 @@ namespace dht
bool Database::checkToken(const dht::Key & token,Uint32 ip,Uint16 port)
{
// the token must be in the map
if (!tokens.tqcontains(token))
if (!tokens.contains(token))
{
Out(SYS_DHT|LOG_DEBUG) << "Unknown token" << endl;
return false;
@ -169,14 +169,14 @@ namespace dht
return true;
}
bool Database::tqcontains(const dht::Key & key) const
bool Database::contains(const dht::Key & key) const
{
return items.tqfind(key) != 0;
return items.find(key) != 0;
}
void Database::insert(const dht::Key & key)
{
DBItemList* dbl = items.tqfind(key);
DBItemList* dbl = items.find(key);
if (!dbl)
{
dbl = new DBItemList();

@ -118,7 +118,7 @@ namespace dht
bool checkToken(const dht::Key & token,bt::Uint32 ip,bt::Uint16 port);
/// Test wether or not the DB contains a key
bool tqcontains(const dht::Key & key) const;
bool contains(const dht::Key & key) const;
/// Insert an empty item (only if it isn't already in the DB)
void insert(const dht::Key & key);

@ -264,7 +264,7 @@ namespace dht
AnnounceTask* at = new AnnounceTask(db,srv,node,info_hash,port);
at->start(kns,!canStartTask());
tman->addTask(at);
if (!db->tqcontains(info_hash))
if (!db->contains(info_hash))
db->insert(info_hash);
return at;
}

@ -119,7 +119,7 @@ namespace dht
void KBucket::insert(const KBucketEntry & entry)
{
TQValueList<KBucketEntry>::iterator i = entries.tqfind(entry);
TQValueList<KBucketEntry>::iterator i = entries.find(entry);
// If in the list, move it to the end
if (i != entries.end())
@ -149,7 +149,7 @@ namespace dht
{
last_modified = bt::GetCurrentTime();
if (!pending_entries_busy_pinging.tqcontains(c))
if (!pending_entries_busy_pinging.contains(c))
return;
KBucketEntry entry = pending_entries_busy_pinging[c];
@ -166,7 +166,7 @@ namespace dht
void KBucket::onTimeout(RPCCall* c)
{
if (!pending_entries_busy_pinging.tqcontains(c))
if (!pending_entries_busy_pinging.contains(c))
return;
KBucketEntry entry = pending_entries_busy_pinging[c];
@ -244,9 +244,9 @@ namespace dht
return false;
}
bool KBucket::tqcontains(const KBucketEntry & entry) const
bool KBucket::contains(const KBucketEntry & entry) const
{
return entries.tqcontains(entry);
return entries.contains(entry);
}
void KBucket::findKClosestNodes(KClosestNodesSearch & kns)

@ -169,7 +169,7 @@ namespace dht
Uint32 getNumEntries() const {return entries.count();}
/// See if this bucket contains an entry
bool tqcontains(const KBucketEntry & entry) const;
bool contains(const KBucketEntry & entry) const;
/**
* Find the K closest entries to a key and store them in the KClosestNodesSearch

@ -37,7 +37,7 @@ namespace dht
/**
* @author Joris Guisson
*
* A Node represents us in the kademlia network. It tqcontains
* A Node represents us in the kademlia network. It contains
* our id and 160 KBucket's.
* A KBucketEntry is in node i, when the difference between our id and
* the KBucketEntry's id is between 2 to the power i and 2 to the power i+1.

@ -56,7 +56,7 @@ namespace dht
// unpack an entry and add it to the todo list
KBucketEntry e = UnpackBucketEntry(nodes,j*26);
// lets not talk to ourself
if (e.getID() != node->getOurID() && !todo.tqcontains(e) && !visited.tqcontains(e))
if (e.getID() != node->getOurID() && !todo.contains(e) && !visited.contains(e))
todo.append(e);
}
num_nodes_rsp++;
@ -78,7 +78,7 @@ namespace dht
{
KBucketEntry e = todo.first();
// only send a findNode if we haven't allrready visited the node
if (!visited.tqcontains(e))
if (!visited.contains(e))
{
// send a findNode to the node
FindNodeReq* fnr = new FindNodeReq(node->getOurID(),node_id);

@ -134,10 +134,10 @@ namespace dht
msg->setOrigin(pck.address());
msg->apply(dh_table);
// erase an existing call
if (msg->getType() == RSP_MSG && calls.tqcontains(msg->getMTID()))
if (msg->getType() == RSP_MSG && calls.contains(msg->getMTID()))
{
// delete the call, but first notify it off the response
RPCCall* c = calls.tqfind(msg->getMTID());
RPCCall* c = calls.find(msg->getMTID());
c->response(msg);
calls.erase(msg->getMTID());
c->deleteLater();
@ -165,7 +165,7 @@ namespace dht
RPCCall* RPCServer::doCall(MsgBase* msg)
{
Uint8 start = next_mtid;
while (calls.tqcontains(next_mtid))
while (calls.contains(next_mtid))
{
next_mtid++;
if (next_mtid == start) // if this happens we cannot do any calls
@ -197,7 +197,7 @@ namespace dht
void RPCServer::timedOut(Uint8 mtid)
{
// delete the call
RPCCall* c = calls.tqfind(mtid);
RPCCall* c = calls.find(mtid);
if (c)
{
dh_table->timeout(c->getRequest());
@ -214,7 +214,7 @@ namespace dht
RPCCall* c = call_queue.first();
call_queue.removeFirst();
while (calls.tqcontains(next_mtid))
while (calls.contains(next_mtid))
next_mtid++;
MsgBase* msg = c->getRequest();
@ -227,7 +227,7 @@ namespace dht
const RPCCall* RPCServer::findCall(Uint8 mtid) const
{
return calls.tqfind(mtid);
return calls.find(mtid);
}
void RPCServer::ping(const dht::Key & our_id,const KNetwork::KSocketAddress & addr)

@ -61,9 +61,9 @@ namespace net
{
// add to the correct group
Uint32 gid = s->downloadGroupID();
SocketGroup* g = groups.tqfind(gid);
SocketGroup* g = groups.find(gid);
if (!g)
g = groups.tqfind(0);
g = groups.find(0);
g->add(s);
num_ready++;

@ -51,7 +51,7 @@ namespace net
void NetworkThread::addGroup(Uint32 gid,Uint32 limit)
{
// if group already exists, just change the limit
SocketGroup* g = groups.tqfind(gid);
SocketGroup* g = groups.find(gid);
if (g)
{
g->setLimit(limit);
@ -72,7 +72,7 @@ namespace net
void NetworkThread::setGroupLimit(Uint32 gid,Uint32 limit)
{
SocketGroup* g = groups.tqfind(gid);
SocketGroup* g = groups.find(gid);
if (g)
{
g->setLimit(limit);

@ -58,7 +58,7 @@ namespace net
void PortList::removePort(bt::Uint16 number,Protocol proto)
{
PortList::iterator itr = tqfind(Port(number,proto,false));
PortList::iterator itr = find(Port(number,proto,false));
if (itr == end())
return;

@ -52,9 +52,9 @@ namespace net
BufferedSocket* s = *itr;
if (s && s->ok() && s->bytesReadyToWrite())
{
SocketGroup* g = groups.tqfind(s->uploadGroupID());
SocketGroup* g = groups.find(s->uploadGroupID());
if (!g)
g = groups.tqfind(0);
g = groups.find(0);
g->add(s);
num_ready++;

@ -80,7 +80,7 @@ namespace kt
}
unloaded.insert(plugin->getName(),plugin);
if (pltoload.tqcontains(plugin->getName()))
if (pltoload.contains(plugin->getName()))
load(plugin->getName());
}
@ -95,7 +95,7 @@ namespace kt
void PluginManager::load(const TQString & name)
{
Plugin* p = unloaded.tqfind(name);
Plugin* p = unloaded.find(name);
if (!p)
return;
@ -114,7 +114,7 @@ namespace kt
void PluginManager::unload(const TQString & name)
{
Plugin* p = plugins.tqfind(name);
Plugin* p = plugins.find(name);
if (!p)
return;
@ -236,7 +236,7 @@ namespace kt
bool PluginManager::isLoaded(const TQString & name) const
{
const Plugin* p = plugins.tqfind(name);
const Plugin* p = plugins.find(name);
return p != 0;
}

@ -234,7 +234,7 @@ namespace bt
while (i != start)
{
Peer* p = pman.getPeer(i);
if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.tqcontains(p))
if (p && p->isChoked() && p->isInterested() && !p->isSeeder() && ppl.contains(p))
return p->getID();
i = (i + 1) % num_peers;
}

@ -87,7 +87,7 @@ namespace bt
bool AnnounceList::removeTracker(KURL url)
{
KURL::List::iterator i = custom_trackers.tqfind(url);
KURL::List::iterator i = custom_trackers.find(url);
if(i != custom_trackers.end())
{
custom_trackers.remove(i);
@ -187,7 +187,7 @@ namespace bt
for (Uint32 i = 0;i < al->getNumTrackerURLs();i++)
{
KURL url = *al->trackers.at(i);
if (!trackers.tqcontains(url) && !custom_trackers.tqcontains(url))
if (!trackers.contains(url) && !custom_trackers.contains(url))
custom_trackers.append(url);
}
}

@ -262,7 +262,7 @@ namespace bt
int ret = 0;
TQMutexLocker lock(&mutex);
// see if it wasn't an offsetted mapping
if (mappings.tqcontains(ptr))
if (mappings.contains(ptr))
{
CacheFile::Entry & e = mappings[ptr];
#if HAVE_MUNMAP64

@ -59,7 +59,7 @@ namespace bt
erase(p);
}
bool tqcontains(Uint32 p)
bool contains(Uint32 p)
{
return count(p) > 0;
}
@ -111,7 +111,7 @@ namespace bt
return false;
DownloadtqStatus* ds = dstatus.tqfind(p.getPeer());
DownloadtqStatus* ds = dstatus.find(p.getPeer());
if (ds)
ds->remove(pp);
@ -164,7 +164,7 @@ namespace bt
bool ChunkDownload::assignPeer(PeerDownloader* pd)
{
if (!pd || pdown.tqcontains(pd))
if (!pd || pdown.contains(pd))
return false;
pd->grab();
@ -179,7 +179,7 @@ namespace bt
void ChunkDownload::notDownloaded(const Request & r,bool reject)
{
// find the peer
DownloadtqStatus* ds = dstatus.tqfind(r.getPeer());
DownloadtqStatus* ds = dstatus.find(r.getPeer());
if (ds)
{
// Out() << "ds != 0" << endl;
@ -216,7 +216,7 @@ namespace bt
void ChunkDownload::sendRequests(PeerDownloader* pd)
{
timer.update();
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID());
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds)
return;
@ -229,7 +229,7 @@ namespace bt
{
// get the first one in the queue
Uint32 i = piece_queue.first();
if (!ds->tqcontains(i))
if (!ds->contains(i))
{
// send request
pd->download(
@ -262,7 +262,7 @@ namespace bt
void ChunkDownload::sendCancels(PeerDownloader* pd)
{
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID());
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
if (!ds)
return;
@ -287,9 +287,9 @@ namespace bt
while (i != pdown.end())
{
PeerDownloader* pd = *i;
DownloadtqStatus* ds = dstatus.tqfind(pd->getPeer()->getID());
DownloadtqStatus* ds = dstatus.find(pd->getPeer()->getID());
Uint32 pp = p.getOffset() / MAX_PIECE_LEN;
if (ds && ds->tqcontains(pp))
if (ds && ds->contains(pp))
{
pd->cancel(Request(p));
ds->remove(pp);
@ -300,7 +300,7 @@ namespace bt
void ChunkDownload::peerKilled(PeerDownloader* pd)
{
if (!pdown.tqcontains(pd))
if (!pdown.contains(pd))
return;
dstatus.erase(pd->getPeer()->getID());

@ -153,7 +153,7 @@ namespace bt
bool getOnlyDownloader(Uint32 & pid);
/// See if a PeerDownloader is assigned to this chunk
bool containsPeer(PeerDownloader *pd) {return pdown.tqcontains(pd);}
bool containsPeer(PeerDownloader *pd) {return pdown.contains(pd);}
/// See if the download is choked (i.e. all downloaders are choked)
bool isChoked() const;

@ -354,7 +354,7 @@ namespace bt
bool Downloader::areWeDownloading(Uint32 chunk) const
{
return current_chunks.tqfind(chunk) != 0;
return current_chunks.find(chunk) != 0;
}
void Downloader::onNewPeer(Peer* peer)
@ -531,7 +531,7 @@ namespace bt
return;
}
if (!cman.getChunk(hdr.index) || current_chunks.tqcontains(hdr.index))
if (!cman.getChunk(hdr.index) || current_chunks.contains(hdr.index))
{
Out() << "Illegal chunk " << hdr.index << endl;
return;
@ -628,7 +628,7 @@ namespace bt
{
for (Uint32 i = from;i <= to;i++)
{
ChunkDownload* cd = current_chunks.tqfind(i);
ChunkDownload* cd = current_chunks.find(i);
// let only seed chunks finish
if (!cd || cman.getChunk(i)->getPriority() == ONLY_SEED_PRIORITY)
continue;
@ -664,7 +664,7 @@ namespace bt
{
for (Uint32 i = 0;i < ok_chunks.getNumBits();i++)
{
ChunkDownload* cd = current_chunks.tqfind(i);
ChunkDownload* cd = current_chunks.find(i);
if (ok_chunks.get(i) && cd)
{
// we have a chunk and we are downloading it so kill it

@ -105,7 +105,7 @@ namespace bt
}
KURL scrape_url = url;
scrape_url.setFileName(url.fileName(false).tqreplace("announce","scrape"));
scrape_url.setFileName(url.fileName(false).replace("announce","scrape"));
TQString epq = scrape_url.encodedPathAndQuery();
const SHA1Hash & info_hash = tor->getInfoHash();

@ -147,7 +147,7 @@ namespace bt
{
// Out() << "Blocked range: " << key.m_ip << " - " << key.m_tqmask << endl;
TQMap<IPKey, int>::iterator it;
if ((it = m_peers.tqfind(key)) != m_peers.end())
if ((it = m_peers.find(key)) != m_peers.end())
{
if(it.key().m_tqmask != key.m_tqmask)
@ -224,7 +224,7 @@ namespace bt
IPKey key(addr, tqmask);
TQMap<IPKey, int>::iterator it = m_peers.tqfind(key);
TQMap<IPKey, int>::iterator it = m_peers.find(key);
if (it == m_peers.end())
return;
@ -264,7 +264,7 @@ namespace bt
IPKey key(ipi);
TQMap<IPKey, int>::iterator it;
it = m_peers.tqfind(key);
it = m_peers.find(key);
if (it==m_peers.end())
return false;

@ -114,7 +114,7 @@ namespace bt
{
if (!tf.doNotDownload())
{
if (files.tqcontains(i))
if (files.contains(i))
files.erase(i);
fd = new CacheFile();
@ -123,7 +123,7 @@ namespace bt
}
else
{
if (dnd_files.tqcontains(i))
if (dnd_files.contains(i))
dnd_files.erase(i);
dfd = new DNDFile(dnd_dir + tf.getPath() + ".dnd");
@ -155,13 +155,13 @@ namespace bt
TorrentFile & tf = tor.getFile(i);
if (tf.doNotDownload())
{
DNDFile* dfd = dnd_files.tqfind(i);
DNDFile* dfd = dnd_files.find(i);
if (dfd)
dfd->changePath(dnd_dir + tf.getPath() + ".dnd");
}
else
{
CacheFile* fd = files.tqfind(i);
CacheFile* fd = files.find(i);
if (fd)
fd->changePath(cache_dir + tf.getPath());
}
@ -332,7 +332,7 @@ namespace bt
if (tflist.count() == 1)
{
const TorrentFile & f = tor.getFile(tflist.first());
CacheFile* fd = files.tqfind(tflist.first());
CacheFile* fd = files.find(tflist.first());
if (!fd)
return;
@ -357,8 +357,8 @@ namespace bt
for (Uint32 i = 0;i < tflist.count();i++)
{
const TorrentFile & f = tor.getFile(tflist[i]);
CacheFile* fd = files.tqfind(tflist[i]);
DNDFile* dfd = dnd_files.tqfind(tflist[i]);
CacheFile* fd = files.find(tflist[i]);
DNDFile* dfd = dnd_files.find(tflist[i]);
// first calculate offset into file
// only the first file can have an offset
@ -412,7 +412,7 @@ namespace bt
{
// in one so just mmap it
Uint64 off = FileOffset(c,tor.getFile(tflist.first()),tor.getChunkSize());
CacheFile* fd = files.tqfind(tflist.first());
CacheFile* fd = files.find(tflist.first());
Uint8* buf = 0;
if (fd && Cache::mappedModeAllowed() && mmap_failures < 3)
{
@ -449,7 +449,7 @@ namespace bt
if (c->gettqStatus() == Chunk::MMAPPED)
{
// mapped chunks are easy
CacheFile* fd = files.tqfind(tflist[0]);
CacheFile* fd = files.find(tflist[0]);
if (!fd)
return;
@ -464,8 +464,8 @@ namespace bt
for (Uint32 i = 0;i < tflist.count();i++)
{
const TorrentFile & f = tor.getFile(tflist[i]);
CacheFile* fd = files.tqfind(tflist[i]);
DNDFile* dfd = dnd_files.tqfind(tflist[i]);
CacheFile* fd = files.find(tflist[i]);
DNDFile* dfd = dnd_files.find(tflist[i]);
// first calculate offset into file
// only the first file can have an offset
@ -828,7 +828,7 @@ namespace bt
try
{
CacheFile* cf = files.tqfind(i);
CacheFile* cf = files.find(i);
if (cf)
{
sum += cf->diskUsage();

@ -126,11 +126,11 @@ namespace bt
if (!peer)
return;
if (wait_queue.tqcontains(req))
if (wait_queue.contains(req))
{
wait_queue.remove(req);
}
else if (reqs.tqcontains(req))
else if (reqs.contains(req))
{
reqs.remove(req);
peer->getPacketWriter().sendCancel(req);
@ -144,7 +144,7 @@ namespace bt
// Out(SYS_CON|LOG_DEBUG) << "Rejected : " << req.getIndex() << " "
// << req.getOffset() << " " << req.getLength() << endl;
if (reqs.tqcontains(req))
if (reqs.contains(req))
{
reqs.remove(req);
rejected(req);
@ -171,9 +171,9 @@ namespace bt
void PeerDownloader::piece(const Piece & p)
{
Request r(p);
if (wait_queue.tqcontains(r))
if (wait_queue.contains(r))
wait_queue.remove(r);
else if (reqs.tqcontains(r))
else if (reqs.contains(r))
reqs.remove(r);
downloaded(p);

@ -206,7 +206,7 @@ namespace bt
peer_id.tqat(2).isLetter() ) //AZ style
{
TQString ID(peer_id.mid(1,2));
if (Map.tqcontains(ID))
if (Map.contains(ID))
name = Map[ID] + " " + peer_id.tqat(3) + "." + peer_id.tqat(4) + "."
+ peer_id.tqat(5) + "." + peer_id.tqat(6);
}
@ -215,7 +215,7 @@ namespace bt
peer_id.tqat(2).isDigit() ) //Shadow's style
{
TQString ID = TQString(peer_id.tqat(0));
if (Map.tqcontains(ID))
if (Map.contains(ID))
name = Map[ID] + " " + peer_id.tqat(1) + "." +
peer_id.tqat(2) + "." + peer_id.tqat(3);
}

@ -509,7 +509,7 @@ namespace bt
Peer* PeerManager::findPeer(Uint32 peer_id)
{
return peer_map.tqfind(peer_id);
return peer_map.find(peer_id);
}
void PeerManager::onRerunChoker()

@ -207,7 +207,7 @@ namespace bt
void PeerSourceManager::addTracker(KURL url, bool custom,int tier)
{
if (trackers.tqcontains(url))
if (trackers.contains(url))
return;
Tracker* trk = 0;
@ -227,11 +227,11 @@ namespace bt
bool PeerSourceManager::removeTracker(KURL url)
{
if (!custom_trackers.tqcontains(url))
if (!custom_trackers.contains(url))
return false;
custom_trackers.remove(url);
Tracker* trk = trackers.tqfind(url);
Tracker* trk = trackers.find(url);
if (curr == trk)
{
// do a timed delete on the tracker, so the stop signal
@ -260,7 +260,7 @@ namespace bt
void PeerSourceManager::setTracker(KURL url)
{
Tracker* trk = trackers.tqfind(url);
Tracker* trk = trackers.find(url);
if (!trk)
return;
@ -279,7 +279,7 @@ namespace bt
KURL::List::iterator i = custom_trackers.begin();
while (i != custom_trackers.end())
{
Tracker* t = trackers.tqfind(*i);
Tracker* t = trackers.find(*i);
if (t)
{
if (curr == t)

@ -68,7 +68,7 @@ namespace bt
{
paused_torrents.erase(tc);
int index = downloads.tqfindRef(tc);
int index = downloads.findRef(tc);
if (index != -1)
downloads.remove(index);

@ -65,7 +65,7 @@ namespace bt
{
bt::Delete(cache_file);
output_file = outputpath;
datadir = output_file.left(output_file.tqfindRev(bt::DirSeparator()));
datadir = output_file.left(output_file.findRev(bt::DirSeparator()));
bt::SymLink(output_file, cache_file);
}

@ -97,7 +97,7 @@ namespace bt
while (!in.atEnd())
{
TQString line = in.readLine();
TQString tmp = line.left(line.tqfind('='));
TQString tmp = line.left(line.find('='));
m_values.insert(tmp, line.mid(tmp.length()+1));
}
close();

@ -78,7 +78,7 @@ namespace bt
* @param key The key
* @return true if key is in the stats file
*/
bool hasKey(const TQString & key) const {return m_values.tqcontains(key);}
bool hasKey(const TQString & key) const {return m_values.contains(key);}
private:
TQString m_filename;

@ -444,6 +444,6 @@ namespace bt
bool Torrent::checkPathForDirectoryTraversal(const TQString & p)
{
TQStringList sl = TQStringList::split(bt::DirSeparator(),p);
return !sl.tqcontains("..");
return !sl.contains("..");
}
}

@ -785,7 +785,7 @@ namespace bt
bool TorrentControl::changeDataDir(const TQString & new_dir)
{
int pos = datadir.tqfindRev(bt::DirSeparator(),-2);
int pos = datadir.findRev(bt::DirSeparator(),-2);
if (pos == -1)
{
Out(SYS_GEN|LOG_DEBUG) << "Could not find torX part in " << datadir << endl;
@ -833,7 +833,7 @@ namespace bt
TQString nd;
if (istats.custom_output_name)
{
int slash_pos = stats.output_path.tqfindRev(bt::DirSeparator(),-2);
int slash_pos = stats.output_path.findRev(bt::DirSeparator(),-2);
nd = new_dir + stats.output_path.mid(slash_pos + 1);
}
else
@ -1255,10 +1255,10 @@ namespace bt
{
// in case of error copy torX dir to migrate-failed-tor
TQString dd = datadir;
int pos = dd.tqfindRev("tor");
int pos = dd.findRev("tor");
if (pos != - 1)
{
dd = dd.tqreplace(pos,3,"migrate-failed-tor");
dd = dd.replace(pos,3,"migrate-failed-tor");
Out() << "Copying " << datadir << " to " << dd << endl;
bt::CopyDir(datadir,dd,true);
}

@ -105,7 +105,7 @@ namespace bt
// Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator i = transactions.tqfind(tid);
TQMap<Int32,Action>::iterator i = transactions.find(tid);
// if we can't find the transaction, just return
if (i == transactions.end())
{
@ -131,7 +131,7 @@ namespace bt
// Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator i = transactions.tqfind(tid);
TQMap<Int32,Action>::iterator i = transactions.find(tid);
// if we can't find the transaction, just return
if (i == transactions.end())
return;
@ -154,7 +154,7 @@ namespace bt
const Uint8* buf = (const Uint8*)data.data();
// Read the transaction_id and check it
Int32 tid = ReadInt32(buf,4);
TQMap<Int32,Action>::iterator it = transactions.tqfind(tid);
TQMap<Int32,Action>::iterator it = transactions.find(tid);
// if we can't find the transaction, just return
if (it == transactions.end())
return;
@ -203,7 +203,7 @@ namespace bt
Int32 UDPTrackerSocket::newTransactionID()
{
Int32 transaction_id = rand() * time(0);
while (transactions.tqcontains(transaction_id))
while (transactions.contains(transaction_id))
transaction_id++;
return transaction_id;
}

@ -55,8 +55,8 @@ namespace bt
void HTTPRequest::onConnect(const KResolverEntry&)
{
payload = payload.tqreplace("$LOCAL_IP",sock->localAddress().nodeName());
hdr = hdr.tqreplace("$CONTENT_LENGTH",TQString::number(payload.length()));
payload = payload.replace("$LOCAL_IP",sock->localAddress().nodeName());
hdr = hdr.replace("$CONTENT_LENGTH",TQString::number(payload.length()));
TQString req = hdr + payload;
if (verbose)
@ -88,7 +88,7 @@ namespace bt
Out(SYS_PNP|LOG_DEBUG) << strdata << endl;
}
if (sl.first().tqcontains("HTTP") && sl.first().tqcontains("200"))
if (sl.first().contains("HTTP") && sl.first().contains("200"))
{
// emit reply OK
replyOK(this,sl.last());

@ -129,7 +129,7 @@ namespace bt
* @param k The key
* @return The data of the key, 0 if the key isn't in the map
*/
Data* tqfind(const Key & k)
Data* find(const Key & k)
{
iterator i = pmap.find(k);
return (i == pmap.end()) ? 0 : i->second;
@ -140,7 +140,7 @@ namespace bt
* @param k The key
* @return The data of the key, 0 if the key isn't in the map
*/
const Data* tqfind(const Key & k) const
const Data* find(const Key & k) const
{
const_iterator i = pmap.find(k);
return (i == pmap.end()) ? 0 : i->second;
@ -151,7 +151,7 @@ namespace bt
* @param k The key
* @return true if it is part of the map
*/
bool tqcontains(const Key & k) const
bool contains(const Key & k) const
{
const_iterator i = pmap.find(k);
return i != pmap.end();

@ -95,7 +95,7 @@ namespace kt
void ChunkDownloadView::removeDownload(kt::ChunkDownloadInterface* cd)
{
if (!items.tqcontains(cd))
if (!items.contains(cd))
return;
ChunkDownloadViewItem* it = items[cd];

@ -92,7 +92,7 @@ bool kt::FlagDB::isFlagAvailable(const TQString& country)
const TQPixmap& kt::FlagDB::getFlag(const TQString& country)
{
const TQString& c = country.lower();
if (!db.tqcontains(c)) {
if (!db.contains(c)) {
TQImage img;
TQPixmap pixmap;
for (TQValueList<FlagDBSource>::const_iterator it = sources.constBegin(); it != sources.constEnd(); it++) {

@ -267,7 +267,7 @@ namespace kt
void PeerView::removePeer(kt::PeerInterface* peer)
{
TQMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.tqfind(peer);
TQMap<kt::PeerInterface*,PeerViewItem*>::iterator it = items.find(peer);
if (it == items.end())
{
return;

@ -146,7 +146,7 @@ namespace kt
TQString durl = data_url.path();
if (durl.endsWith(bt::DirSeparator()))
durl = durl.left(durl.length() - 1);
int ds = durl.tqfindRev(bt::DirSeparator());
int ds = durl.findRev(bt::DirSeparator());
if (durl.mid(ds+1) == tor.getNameSuggestion())
{
durl = durl.left(ds);
@ -163,7 +163,7 @@ namespace kt
// single file, just symlink the data_url to tor_dir/cache
bt::SymLink(data_url.path(),tor_dir + "cache");
TQString durl = data_url.path();
int ds = durl.tqfindRev(bt::DirSeparator());
int ds = durl.findRev(bt::DirSeparator());
durl = durl.left(ds);
saveStats(tor_dir + "stats",durl,imported,false);
}

@ -20,7 +20,7 @@ time_t RSS::parseISO8601Date(const TQString &s)
return 0; // error
// FIXME: imho this is done in KRFCDate::parseDateISO8601() automatically, so we could omit it? -fo
if (s.tqfind('T') != -1)
if (s.find('T') != -1)
return KRFCDate::parseDateISO8601(s);
else
return KRFCDate::parseDateISO8601(s + "T12:00:00");
@ -35,10 +35,10 @@ TQString RSS::extractNode(const TQDomNode &tqparent, const TQString &elemName, b
TQString result = node.toElement().text();
bool hasPre = result.tqcontains("<pre>",false);
bool hasHtml = hasPre || result.tqcontains("<"); // FIXME: test if we have html, should be more clever -> regexp
bool hasPre = result.contains("<pre>",false);
bool hasHtml = hasPre || result.contains("<"); // FIXME: test if we have html, should be more clever -> regexp
if(!isInlined && !hasHtml) // perform nl2br if not a inline elt and it has no html elts
result = result = result.tqreplace(TQChar('\n'), "<br />");
result = result = result.replace(TQChar('\n'), "<br />");
if(!hasPre) // strip white spaces if no <pre>
result = result.simplifyWhiteSpace();

@ -182,7 +182,7 @@ namespace kt
{
TQDir directory;
directory.mkdir(KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds");
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).tqreplace("/", "_").tqreplace(":", "_") + ".ktr";
return KGlobal::dirs()->saveLocation("data","ktorrent") + "rssfeeds/" + m_feedUrl.prettyURL(-1).replace("/", "_").replace(":", "_") + ".ktr";
}
@ -290,7 +290,7 @@ namespace kt
for (int i=doc.articles().count()-1; i>=0; i--)
{
curArticle = doc.articles()[i];
if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.tqcontains(curArticle))
if (curArticle.pubDate().daysTo(TQDateTime::tqcurrentDateTime()) < m_articleAge && !m_articles.contains(curArticle))
{
m_articles.prepend(curArticle);
emit scanRssArticle(curArticle);

@ -138,7 +138,7 @@ namespace kt
void RssFeedManager::clearArticles()
{
int pos = feeds.tqfind((RssFeed *)sender());
int pos = feeds.find((RssFeed *)sender());
if (pos >= 0)
{
@ -606,7 +606,7 @@ namespace kt
if (item < 0)
{
//let's check which one sent the signal - if we can't figure it all then update them all
int pos = feeds.tqfind((RssFeed *)sender());
int pos = feeds.find((RssFeed *)sender());
if (pos < 0)
{
@ -639,7 +639,7 @@ namespace kt
if (item < 0)
{
//let's check which one sent the signal - if we can't figure it all then update them all
int pos = acceptFilters.tqfind((RssFilter *)sender());
int pos = acceptFilters.find((RssFilter *)sender());
if (pos < 0)
{
@ -672,7 +672,7 @@ namespace kt
if (item < 0)
{
//let's check which one sent the signal - if we can't figure it all then update them all
int pos = rejectFilters.tqfind((RssFilter *)sender());
int pos = rejectFilters.find((RssFilter *)sender());
if (pos < 0)
{
@ -1254,7 +1254,7 @@ namespace kt
void RssFeedManager::rescanFilter()
{
int pos = acceptFilters.tqfind((RssFilter *)sender());
int pos = acceptFilters.find((RssFilter *)sender());
if (pos >= 0)
{

@ -276,14 +276,14 @@ namespace kt
if (!invert)
{
if (!article.title().tqcontains(regEx) && !article.link().prettyURL().tqcontains(regEx) && !article.description().tqcontains(regEx) )
if (!article.title().contains(regEx) && !article.link().prettyURL().contains(regEx) && !article.description().contains(regEx) )
{
return false;
}
}
else
{
if (article.title().tqcontains(regEx) || article.link().prettyURL().tqcontains(regEx) || article.description().tqcontains(regEx) )
if (article.title().contains(regEx) || article.link().prettyURL().contains(regEx) || article.description().contains(regEx) )
{
return false;
}

@ -83,7 +83,7 @@ namespace kt
hrefTags.setMinimal(true);
int matchPos = 0;
while (htmlline.tqfind(hrefTags, matchPos) >= 0)
while (htmlline.find(hrefTags, matchPos) >= 0)
{
matchPos += hrefTags.matchedLength();
//we're found an <a href tag - let's check it if contains download
@ -100,7 +100,7 @@ namespace kt
hrefText = TQString("HREF=\"?([^\">< ]*)[\" ]");
hrefText.setCaseSensitive(false);
hrefTags.tqcapturedTexts()[0].tqfind(hrefText);
hrefTags.tqcapturedTexts()[0].find(hrefText);
//lets get the captured
TQString hrefLink = hrefText.capturedTexts()[1];
@ -110,7 +110,7 @@ namespace kt
}
else if (!hrefLink.tqstartsWith("http://", false))
{
hrefLink = url.url().left(url.url().tqfindRev("/")+1) + hrefLink;
hrefLink = url.url().left(url.url().findRev("/")+1) + hrefLink;
}
subLinks.append(hrefLink);

@ -132,7 +132,7 @@ namespace kt
return;
//search for entry
TQValueList<KURL>::iterator it = m_pendingURLs.tqfind(url);
TQValueList<KURL>::iterator it = m_pendingURLs.find(url);
//if no entry is found than this torrent was not started by this plugin so - quit
if(it == m_pendingURLs.end())

@ -51,9 +51,9 @@ namespace kt
// replace spaces by %20
TQString name = e.name;
name = name.tqreplace(" ","%20");
name = name.replace(" ","%20");
TQString u = e.url.prettyURL();
u = u.tqreplace(" ","%20");
u = u.replace(" ","%20");
out << name << " " << u << ::endl;
i++;
}
@ -85,7 +85,7 @@ namespace kt
SearchEngine se;
se.name = tokens[0];
se.name = se.name.tqreplace("%20"," ");
se.name = se.name.replace("%20"," ");
se.url = KURL::fromPathOrURL(tokens[1]);
for(Uint32 i=2; i<tokens.count(); ++i)

@ -102,7 +102,7 @@ namespace kt
engine = 0;
TQString s_url = sl.getSearchURL(engine).prettyURL();
s_url.tqreplace("FOOBAR", KURL::encode_string(text), true);
s_url.replace("FOOBAR", KURL::encode_string(text), true);
KURL url = KURL::fromPathOrURL(s_url);
if(SearchPluginSettings::useDefaultBrowser())
@ -141,7 +141,7 @@ namespace kt
void SearchPlugin::tabCloseRequest(kt::GUIInterface* gui,TQWidget* tab)
{
if (searches.tqcontains((SearchWidget*)tab))
if (searches.contains((SearchWidget*)tab))
{
searches.remove((SearchWidget*)tab);
gui->removeTabPage(tab);

@ -112,7 +112,7 @@ namespace kt
TQListViewItem* item = itr.current();
TQString u = item->text(1);
TQString name = item->text(0);
out << name.tqreplace(" ","%20") << " " << u.tqreplace(" ","%20") << endl;
out << name.replace(" ","%20") << " " << u.replace(" ","%20") << endl;
itr++;
}
}
@ -123,7 +123,7 @@ namespace kt
{
KMessageBox::error(this, i18n("You must enter the search engine's name and URL"));
}
else if ( m_engine_url->text().tqcontains("FOOBAR") )
else if ( m_engine_url->text().contains("FOOBAR") )
{
KURL url = KURL::fromPathOrURL(m_engine_url->text());
if ( !url.isValid() )
@ -132,7 +132,7 @@ namespace kt
return;
}
if (m_engines->tqfindItem(m_engine_name->text(), 0))
if (m_engines->findItem(m_engine_name->text(), 0))
{
KMessageBox::error(this, i18n("A search engine with the same name already exists. Please use a different name.")); return;
}
@ -217,7 +217,7 @@ namespace kt
TQStringList tokens = TQStringList::split(" ", line);
TQString name = tokens[0];
name = name.tqreplace("%20"," ");
name = name.replace("%20"," ");
KURL url = KURL::fromPathOrURL(tokens[1]);
for(Uint32 i=2; i<tokens.count(); ++i)
@ -229,7 +229,7 @@ namespace kt
TQMap<TQString,KURL>::iterator i = engines.begin();
while (i != engines.end())
{
TQListViewItem* item = m_engines->tqfindItem(i.key(),0);
TQListViewItem* item = m_engines->findItem(i.key(),0);
// if we have found the item, replace it if not make a new one
if (item)
item->setText(1, i.data().prettyURL());

@ -172,7 +172,7 @@ namespace kt
engine = sbar->m_search_engine->currentItem();
TQString s_url = sl.getSearchURL(engine).prettyURL();
s_url.tqreplace("FOOBAR", KURL::encode_string(text), true);
s_url.replace("FOOBAR", KURL::encode_string(text), true);
KURL url = KURL::fromPathOrURL(s_url);
statusBarMsg(i18n("Searching for %1...").tqarg(text));

@ -433,8 +433,8 @@ void ChartDrawer::MakeLegendTooltip()
img[i].setPixel(15, px, 0); //r
}
factory->setImage(mEls[i].GetName().tqreplace(' ', '_') + "-" + TQString::number(i), img[i]);
helpstr += TQString("<img src='%1'>&nbsp;&nbsp;-&nbsp;&nbsp;%2<br>").tqarg(mEls[i].GetName().tqreplace(" ", "_") + "-" + TQString::number(i)).tqarg( mEls[i].GetName() );
factory->setImage(mEls[i].GetName().replace(' ', '_') + "-" + TQString::number(i), img[i]);
helpstr += TQString("<img src='%1'>&nbsp;&nbsp;-&nbsp;&nbsp;%2<br>").tqarg(mEls[i].GetName().replace(" ", "_") + "-" + TQString::number(i)).tqarg( mEls[i].GetName() );
}
TQToolTip::add(this, helpstr);

@ -43,7 +43,7 @@ void PeerMonitor::peerRemoved (kt::PeerInterface *peer)
TQMutexLocker lock(&mtx);
data_t::iterator it = std::tqfind(mPeers.begin(), mPeers.end(), peer);
data_t::iterator it = std::find(mPeers.begin(), mPeers.end(), peer);
if(it != mPeers.end())
{
@ -73,7 +73,7 @@ void PeerMonitor::stopped ()
void PeerMonitor::destroyed ()
{
if(pmPeerMMgr -> tqfind(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() )
if(pmPeerMMgr -> find(pmTorIface -> getInfoHash()) != pmPeerMMgr -> end() )
{
pmTorIface -> setMonitor(0);
pmPeerMMgr -> erase(pmTorIface -> getInfoHash());

@ -103,7 +103,7 @@ namespace kt
else
{
// add it to the list and emit the signal
if (!routers.tqcontains(r->getServer()))
if (!routers.contains(r->getServer()))
{
routers.insert(r->getServer(),r);
discovered(r);
@ -164,13 +164,13 @@ namespace kt
// first read first line and see if contains a HTTP 200 OK message
TQString line = lines.first();
if (!line.tqcontains("HTTP"))
if (!line.contains("HTTP"))
{
// it is either a 200 OK or a NOTIFY
if (!line.tqcontains("NOTIFY") && !line.tqcontains("200"))
if (!line.contains("NOTIFY") && !line.contains("200"))
return 0;
}
else if (line.tqcontains("M-SEARCH")) // ignore M-SEARCH
else if (line.contains("M-SEARCH")) // ignore M-SEARCH
return 0;
// quick check that the response being parsed is valid
@ -178,7 +178,7 @@ namespace kt
for (Uint32 idx = 0;idx < lines.count() && !validDevice; idx++)
{
line = lines[idx];
if ((line.tqcontains("ST:") || line.tqcontains("NT:")) && line.tqcontains("InternetGatewayDevice"))
if ((line.contains("ST:") || line.contains("NT:")) && line.contains("InternetGatewayDevice"))
{
validDevice = true;
}
@ -195,20 +195,20 @@ namespace kt
line = lines[i];
if (line.startsWith("Location") || line.startsWith("LOCATION") || line.startsWith("location"))
{
location = line.mid(line.tqfind(':') + 1).stripWhiteSpace();
location = line.mid(line.find(':') + 1).stripWhiteSpace();
if (!location.isValid())
return 0;
}
else if (line.startsWith("Server") || line.startsWith("server") || line.startsWith("SERVER"))
{
server = line.mid(line.tqfind(':') + 1).stripWhiteSpace();
server = line.mid(line.find(':') + 1).stripWhiteSpace();
if (server.length() == 0)
return 0;
}
}
if (routers.tqcontains(server))
if (routers.contains(server))
{
return 0;
}
@ -265,7 +265,7 @@ namespace kt
TQString server, location;
server = fin.readLine();
location = fin.readLine();
if (!routers.tqcontains(server))
if (!routers.contains(server))
{
UPnPRouter* r = new UPnPRouter(server,location);
// download it's xml file

@ -49,7 +49,7 @@ namespace kt
Uint32 getNumDevicesDiscovered() const {return routers.count();}
/// Find a router using it's server name
UPnPRouter* findDevice(const TQString & name) {return routers.tqfind(name);}
UPnPRouter* findDevice(const TQString & name) {return routers.find(name);}
/// Save all routers to a file (for convenience at startup)
void saveRouters(const TQString & file);

@ -201,7 +201,7 @@ namespace kt
msg += TQString::number(f.port.number) + " (";
TQString prot = (f.port.proto == net::UDP ? "UDP" : "TCP");
msg += prot + ")";
if (f.service->servicetype.tqcontains("WANPPPConnection"))
if (f.service->servicetype.contains("WANPPPConnection"))
services += "PPP";
else
services += "IP";

@ -88,7 +88,7 @@ namespace kt
void HttpServer::slotSocketReadyToRead()
{
TQSocket* client = (TQSocket*)sender();
HttpClientHandler* handler = clients.tqfind(client);
HttpClientHandler* handler = clients.find(client);
if (!handler)
{
client->deleteLater();
@ -112,7 +112,7 @@ namespace kt
Uint8 h = (a.latin1() - (a.isNumber() ? '0' : 'a')) << 4;
Uint8 l = (b.latin1() - (b.isNumber() ? '0' : 'a'));
char r = (char) h | l; // combine them and cast to a char
password.tqreplace(idx,3,r);
password.replace(idx,3,r);
return idx + 1;
}
@ -134,7 +134,7 @@ namespace kt
// check for passwords with url encoded stuff in them and decode them if necessary
int idx = 0;
while ((idx = password.tqfind('%',idx)) > 0)
while ((idx = password.find('%',idx)) > 0)
{
if (idx + 2 < password.length())
{
@ -170,7 +170,7 @@ namespace kt
if (hdr.hasKey("Cookie"))
{
TQString cookie = hdr.value("Cookie");
int idx = cookie.tqfind("KT_SESSID=");
int idx = cookie.find("KT_SESSID=");
if (idx == -1)
return false;
@ -432,7 +432,7 @@ namespace kt
{
const char* ptr = data.data();
Uint32 len = data.size();
int pos = TQString(data).tqfind("\r\n\r\n");
int pos = TQString(data).find("\r\n\r\n");
if (pos == -1 || pos + 4 >= len || ptr[pos + 4] != 'd')
{
@ -540,7 +540,7 @@ namespace kt
bt::MMapFile* HttpServer::cacheLookup(const TQString & name)
{
return cache.tqfind(name);
return cache.find(name);
}
void HttpServer::insertIntoCache(const TQString & name,bt::MMapFile* file)

@ -48,7 +48,7 @@ namespace kt
bool PhpHandler::executeScript(const TQString & path,const TQMap<TQString,TQString> & args)
{
TQByteArray php_s;
if (!scripts.tqcontains(path))
if (!scripts.contains(path))
{
TQFile fptr(path);
if (!fptr.open(IO_ReadOnly))
@ -66,7 +66,7 @@ namespace kt
output.resize(0);
int firstphptag = TQCString(php_s).tqfind("<?php");
int firstphptag = TQCString(php_s).find("<?php");
if (firstphptag == -1)
return false;

@ -114,13 +114,13 @@ namespace kt
out << TQString("\"leechers_connected_to\" => %1,\n").tqarg(stats.leechers_connected_to);
out << TQString("\"status\" => %1,\n").tqarg(stats.status);
out << TQString("\"running\" => %1,\n").tqarg(stats.running);
out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$"));
out << TQString("\"trackerstatus\" => \"%1\",\n").tqarg(stats.trackerstatus.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"session_bytes_downloaded\" => %1,\n").tqarg(stats.session_bytes_downloaded);
out << TQString("\"session_bytes_uploaded\" => %1,\n").tqarg(stats.session_bytes_uploaded);
out << TQString("\"trk_bytes_downloaded\" => %1,\n").tqarg(stats.trk_bytes_downloaded);
out << TQString("\"trk_bytes_uploaded\" => %1,\n").tqarg(stats.trk_bytes_uploaded);
out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$"));
out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.tqreplace("\\", "\\\\").tqreplace("\"", "\\\"").tqreplace("$", "\\$"));
out << TQString("\"torrent_name\" => \"%1\",\n").tqarg(stats.torrent_name.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"output_path\" => \"%1\",\n").tqarg(stats.output_path.replace("\\", "\\\\").replace("\"", "\\\"").replace("$", "\\$"));
out << TQString("\"stopped_by_error\" => \"%1\",\n").tqarg(stats.stopped_by_error);
out << TQString("\"completed\" => \"%1\",\n").tqarg(stats.completed);
out << TQString("\"user_controlled\" => \"%1\",\n").tqarg(stats.user_controlled);
@ -263,7 +263,7 @@ namespace kt
break;
case 'f':
//parse argument into torrent number and file number
separator_loc=it.data().tqfind('-');
separator_loc=it.data().find('-');
parse=it.data();
torrent_num.append(parse.left(separator_loc));
file_num.append(parse.right(parse.length()-(separator_loc+1)));

@ -174,7 +174,7 @@ class RestInterface {
// Truncate long torrent name, and HTML escape it.
// This is a helper function for download_status.
private function _clean_name($name) {
$name = str_tqreplace("'", "\'", $name);
$name = str_replace("'", "\'", $name);
if (strlen($name) > 30) {
$name = substr($name, 0, 27);
$name .= "...";

@ -118,7 +118,7 @@ function generate_button_code($img, $alt, $href='')
foreach ($stats as $torrent) {
echo "\t\t".'<tr>'."\n\t\t\t";
$torrent_name = str_tqreplace("'", "\'", $torrent['torrent_name']);
$torrent_name = str_replace("'", "\'", $torrent['torrent_name']);
if($torrent['total_bytes_to_download']!=0) $perc = round(100.0 - ($torrent['bytes_left_to_download'] / $torrent['total_bytes_to_download']) * 100.0, 2);
else $perc = 0;
if(strlen($torrent['torrent_name'])>30) $display_name=substr($torrent['torrent_name'], 0, 30)." ...";

@ -84,7 +84,7 @@ namespace kt
void ZeroConfPlugin::torrentAdded(kt::TorrentInterface* tc)
{
if (services.tqcontains(tc))
if (services.contains(tc))
return;
bt::Uint16 port = bt::Globals::instance().getServer().getPortInUse();
@ -100,7 +100,7 @@ namespace kt
void ZeroConfPlugin::torrentRemoved(kt::TorrentInterface* tc)
{
AvahiService* av = services.tqfind(tc);
AvahiService* av = services.find(tc);
if (!av)
return;
Out(SYS_ZCO|LOG_NOTICE) << "ZeroConf service removed for "

Loading…
Cancel
Save