summaryrefslogtreecommitdiffstats
path: root/libktorrent
diff options
context:
space:
mode:
Diffstat (limited to 'libktorrent')
-rw-r--r--libktorrent/interfaces/filetreediritem.cpp4
-rw-r--r--libktorrent/kademlia/announcetask.cpp8
-rw-r--r--libktorrent/kademlia/database.cpp12
-rw-r--r--libktorrent/kademlia/database.h2
-rw-r--r--libktorrent/kademlia/dht.cpp2
-rw-r--r--libktorrent/kademlia/kbucket.cpp10
-rw-r--r--libktorrent/kademlia/kbucket.h2
-rw-r--r--libktorrent/kademlia/node.h2
-rw-r--r--libktorrent/kademlia/nodelookup.cpp4
-rw-r--r--libktorrent/kademlia/rpcserver.cpp12
-rw-r--r--libktorrent/net/downloadthread.cpp4
-rw-r--r--libktorrent/net/networkthread.cpp4
-rw-r--r--libktorrent/net/portlist.cpp2
-rw-r--r--libktorrent/net/uploadthread.cpp4
-rw-r--r--libktorrent/pluginmanager.cpp8
-rw-r--r--libktorrent/torrent/advancedchokealgorithm.cpp2
-rw-r--r--libktorrent/torrent/announcelist.cpp4
-rw-r--r--libktorrent/torrent/cachefile.cpp2
-rw-r--r--libktorrent/torrent/chunkdownload.cpp20
-rw-r--r--libktorrent/torrent/chunkdownload.h2
-rw-r--r--libktorrent/torrent/downloader.cpp8
-rw-r--r--libktorrent/torrent/httptracker.cpp2
-rw-r--r--libktorrent/torrent/ipblocklist.cpp6
-rw-r--r--libktorrent/torrent/multifilecache.cpp24
-rw-r--r--libktorrent/torrent/peerdownloader.cpp10
-rw-r--r--libktorrent/torrent/peerid.cpp4
-rw-r--r--libktorrent/torrent/peermanager.cpp2
-rw-r--r--libktorrent/torrent/peersourcemanager.cpp10
-rw-r--r--libktorrent/torrent/queuemanager.cpp2
-rw-r--r--libktorrent/torrent/singlefilecache.cpp2
-rw-r--r--libktorrent/torrent/statsfile.cpp2
-rw-r--r--libktorrent/torrent/statsfile.h2
-rw-r--r--libktorrent/torrent/torrent.cpp2
-rw-r--r--libktorrent/torrent/torrentcontrol.cpp8
-rw-r--r--libktorrent/torrent/udptrackersocket.cpp8
-rw-r--r--libktorrent/util/httprequest.cpp6
-rw-r--r--libktorrent/util/ptrmap.h6
37 files changed, 107 insertions, 107 deletions
diff --git a/libktorrent/interfaces/filetreediritem.cpp b/libktorrent/interfaces/filetreediritem.cpp
index 54c1953..7cb78ca 100644
--- a/libktorrent/interfaces/filetreediritem.cpp
+++ b/libktorrent/interfaces/filetreediritem.cpp
@@ -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);
diff --git a/libktorrent/kademlia/announcetask.cpp b/libktorrent/kademlia/announcetask.cpp
index 5e5b925..95f4020 100644
--- a/libktorrent/kademlia/announcetask.cpp
+++ b/libktorrent/kademlia/announcetask.cpp
@@ -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);
diff --git a/libktorrent/kademlia/database.cpp b/libktorrent/kademlia/database.cpp
index c4b34fd..447975f 100644
--- a/libktorrent/kademlia/database.cpp
+++ b/libktorrent/kademlia/database.cpp
@@ -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();
diff --git a/libktorrent/kademlia/database.h b/libktorrent/kademlia/database.h
index 12e8373..365f6bb 100644
--- a/libktorrent/kademlia/database.h
+++ b/libktorrent/kademlia/database.h
@@ -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);
diff --git a/libktorrent/kademlia/dht.cpp b/libktorrent/kademlia/dht.cpp
index 3eecd7c..f11c1cf 100644
--- a/libktorrent/kademlia/dht.cpp
+++ b/libktorrent/kademlia/dht.cpp
@@ -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;
}
diff --git a/libktorrent/kademlia/kbucket.cpp b/libktorrent/kademlia/kbucket.cpp
index 76986b9..31148ba 100644
--- a/libktorrent/kademlia/kbucket.cpp
+++ b/libktorrent/kademlia/kbucket.cpp
@@ -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)
diff --git a/libktorrent/kademlia/kbucket.h b/libktorrent/kademlia/kbucket.h
index cfd932d..6930c9d 100644
--- a/libktorrent/kademlia/kbucket.h
+++ b/libktorrent/kademlia/kbucket.h
@@ -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
diff --git a/libktorrent/kademlia/node.h b/libktorrent/kademlia/node.h
index 7d871e0..abc7782 100644
--- a/libktorrent/kademlia/node.h
+++ b/libktorrent/kademlia/node.h
@@ -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.
diff --git a/libktorrent/kademlia/nodelookup.cpp b/libktorrent/kademlia/nodelookup.cpp
index 9175f7d..d1544b6 100644
--- a/libktorrent/kademlia/nodelookup.cpp
+++ b/libktorrent/kademlia/nodelookup.cpp
@@ -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);
diff --git a/libktorrent/kademlia/rpcserver.cpp b/libktorrent/kademlia/rpcserver.cpp
index 9f65b95..0be22a8 100644
--- a/libktorrent/kademlia/rpcserver.cpp
+++ b/libktorrent/kademlia/rpcserver.cpp
@@ -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)
diff --git a/libktorrent/net/downloadthread.cpp b/libktorrent/net/downloadthread.cpp
index 2adf1a8..ae0f0b9 100644
--- a/libktorrent/net/downloadthread.cpp
+++ b/libktorrent/net/downloadthread.cpp
@@ -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++;
diff --git a/libktorrent/net/networkthread.cpp b/libktorrent/net/networkthread.cpp
index 0a48af9..40791c9 100644
--- a/libktorrent/net/networkthread.cpp
+++ b/libktorrent/net/networkthread.cpp
@@ -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);
diff --git a/libktorrent/net/portlist.cpp b/libktorrent/net/portlist.cpp
index 6fa4f6a..56076ed 100644
--- a/libktorrent/net/portlist.cpp
+++ b/libktorrent/net/portlist.cpp
@@ -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;
diff --git a/libktorrent/net/uploadthread.cpp b/libktorrent/net/uploadthread.cpp
index 3d2fa0a..0023cf6 100644
--- a/libktorrent/net/uploadthread.cpp
+++ b/libktorrent/net/uploadthread.cpp
@@ -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++;
diff --git a/libktorrent/pluginmanager.cpp b/libktorrent/pluginmanager.cpp
index 2389162..3ea1282 100644
--- a/libktorrent/pluginmanager.cpp
+++ b/libktorrent/pluginmanager.cpp
@@ -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;
}
diff --git a/libktorrent/torrent/advancedchokealgorithm.cpp b/libktorrent/torrent/advancedchokealgorithm.cpp
index f6c807f..7ca0578 100644
--- a/libktorrent/torrent/advancedchokealgorithm.cpp
+++ b/libktorrent/torrent/advancedchokealgorithm.cpp
@@ -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;
}
diff --git a/libktorrent/torrent/announcelist.cpp b/libktorrent/torrent/announcelist.cpp
index 7eebf19..4d3d4fa 100644
--- a/libktorrent/torrent/announcelist.cpp
+++ b/libktorrent/torrent/announcelist.cpp
@@ -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);
}
}
diff --git a/libktorrent/torrent/cachefile.cpp b/libktorrent/torrent/cachefile.cpp
index 4196016..da5ecae 100644
--- a/libktorrent/torrent/cachefile.cpp
+++ b/libktorrent/torrent/cachefile.cpp
@@ -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
diff --git a/libktorrent/torrent/chunkdownload.cpp b/libktorrent/torrent/chunkdownload.cpp
index fe095a7..04eb87f 100644
--- a/libktorrent/torrent/chunkdownload.cpp
+++ b/libktorrent/torrent/chunkdownload.cpp
@@ -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());
diff --git a/libktorrent/torrent/chunkdownload.h b/libktorrent/torrent/chunkdownload.h
index c1960f0..c8bd2ae 100644
--- a/libktorrent/torrent/chunkdownload.h
+++ b/libktorrent/torrent/chunkdownload.h
@@ -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;
diff --git a/libktorrent/torrent/downloader.cpp b/libktorrent/torrent/downloader.cpp
index b566ad7..a63163e 100644
--- a/libktorrent/torrent/downloader.cpp
+++ b/libktorrent/torrent/downloader.cpp
@@ -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
diff --git a/libktorrent/torrent/httptracker.cpp b/libktorrent/torrent/httptracker.cpp
index ad4bd79..e64f8ce 100644
--- a/libktorrent/torrent/httptracker.cpp
+++ b/libktorrent/torrent/httptracker.cpp
@@ -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();
diff --git a/libktorrent/torrent/ipblocklist.cpp b/libktorrent/torrent/ipblocklist.cpp
index 04afe26..632f42c 100644
--- a/libktorrent/torrent/ipblocklist.cpp
+++ b/libktorrent/torrent/ipblocklist.cpp
@@ -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;
diff --git a/libktorrent/torrent/multifilecache.cpp b/libktorrent/torrent/multifilecache.cpp
index 88f6d69..b7dae26 100644
--- a/libktorrent/torrent/multifilecache.cpp
+++ b/libktorrent/torrent/multifilecache.cpp
@@ -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();
diff --git a/libktorrent/torrent/peerdownloader.cpp b/libktorrent/torrent/peerdownloader.cpp
index 00e0b7a..6f0738f 100644
--- a/libktorrent/torrent/peerdownloader.cpp
+++ b/libktorrent/torrent/peerdownloader.cpp
@@ -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);
diff --git a/libktorrent/torrent/peerid.cpp b/libktorrent/torrent/peerid.cpp
index b1741d2..09b4bff 100644
--- a/libktorrent/torrent/peerid.cpp
+++ b/libktorrent/torrent/peerid.cpp
@@ -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);
}
diff --git a/libktorrent/torrent/peermanager.cpp b/libktorrent/torrent/peermanager.cpp
index c85ebd4..adacbae 100644
--- a/libktorrent/torrent/peermanager.cpp
+++ b/libktorrent/torrent/peermanager.cpp
@@ -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()
diff --git a/libktorrent/torrent/peersourcemanager.cpp b/libktorrent/torrent/peersourcemanager.cpp
index 80af240..44303c4 100644
--- a/libktorrent/torrent/peersourcemanager.cpp
+++ b/libktorrent/torrent/peersourcemanager.cpp
@@ -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)
diff --git a/libktorrent/torrent/queuemanager.cpp b/libktorrent/torrent/queuemanager.cpp
index 1199179..affedf5 100644
--- a/libktorrent/torrent/queuemanager.cpp
+++ b/libktorrent/torrent/queuemanager.cpp
@@ -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);
diff --git a/libktorrent/torrent/singlefilecache.cpp b/libktorrent/torrent/singlefilecache.cpp
index 7ad0fd6..4843c1f 100644
--- a/libktorrent/torrent/singlefilecache.cpp
+++ b/libktorrent/torrent/singlefilecache.cpp
@@ -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);
}
diff --git a/libktorrent/torrent/statsfile.cpp b/libktorrent/torrent/statsfile.cpp
index 54033aa..772f6be 100644
--- a/libktorrent/torrent/statsfile.cpp
+++ b/libktorrent/torrent/statsfile.cpp
@@ -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();
diff --git a/libktorrent/torrent/statsfile.h b/libktorrent/torrent/statsfile.h
index c37018f..3b3decb 100644
--- a/libktorrent/torrent/statsfile.h
+++ b/libktorrent/torrent/statsfile.h
@@ -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;
diff --git a/libktorrent/torrent/torrent.cpp b/libktorrent/torrent/torrent.cpp
index e02af51..c5d8459 100644
--- a/libktorrent/torrent/torrent.cpp
+++ b/libktorrent/torrent/torrent.cpp
@@ -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("..");
}
}
diff --git a/libktorrent/torrent/torrentcontrol.cpp b/libktorrent/torrent/torrentcontrol.cpp
index ba51092..a586356 100644
--- a/libktorrent/torrent/torrentcontrol.cpp
+++ b/libktorrent/torrent/torrentcontrol.cpp
@@ -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);
}
diff --git a/libktorrent/torrent/udptrackersocket.cpp b/libktorrent/torrent/udptrackersocket.cpp
index 79e9c5c..e440e3c 100644
--- a/libktorrent/torrent/udptrackersocket.cpp
+++ b/libktorrent/torrent/udptrackersocket.cpp
@@ -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;
}
diff --git a/libktorrent/util/httprequest.cpp b/libktorrent/util/httprequest.cpp
index ed7d980..a52788e 100644
--- a/libktorrent/util/httprequest.cpp
+++ b/libktorrent/util/httprequest.cpp
@@ -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());
diff --git a/libktorrent/util/ptrmap.h b/libktorrent/util/ptrmap.h
index 9474db1..36e1c20 100644
--- a/libktorrent/util/ptrmap.h
+++ b/libktorrent/util/ptrmap.h
@@ -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();