summaryrefslogtreecommitdiffstats
path: root/libktorrent/torrent
diff options
context:
space:
mode:
Diffstat (limited to 'libktorrent/torrent')
-rw-r--r--libktorrent/torrent/bdecoder.cpp8
-rw-r--r--libktorrent/torrent/bencoder.cpp8
-rw-r--r--libktorrent/torrent/bnode.cpp28
-rw-r--r--libktorrent/torrent/bnode.h8
-rw-r--r--libktorrent/torrent/cachefile.cpp38
-rw-r--r--libktorrent/torrent/chunkdownload.cpp4
-rw-r--r--libktorrent/torrent/chunkmanager.cpp6
-rw-r--r--libktorrent/torrent/dndfile.cpp6
-rw-r--r--libktorrent/torrent/ipblocklist.cpp8
-rw-r--r--libktorrent/torrent/multifilecache.cpp8
-rw-r--r--libktorrent/torrent/packet.cpp20
-rw-r--r--libktorrent/torrent/packetreader.cpp10
-rw-r--r--libktorrent/torrent/packetwriter.cpp4
-rw-r--r--libktorrent/torrent/peerid.cpp36
-rw-r--r--libktorrent/torrent/peermanager.cpp16
-rw-r--r--libktorrent/torrent/peeruploader.cpp4
-rw-r--r--libktorrent/torrent/queuemanager.cpp10
-rw-r--r--libktorrent/torrent/torrent.cpp4
-rw-r--r--libktorrent/torrent/torrentcontrol.cpp28
-rw-r--r--libktorrent/torrent/torrentcreator.cpp10
-rw-r--r--libktorrent/torrent/udptracker.cpp8
-rw-r--r--libktorrent/torrent/udptrackersocket.cpp2
22 files changed, 137 insertions, 137 deletions
diff --git a/libktorrent/torrent/bdecoder.cpp b/libktorrent/torrent/bdecoder.cpp
index 778cf8a..e965eb5 100644
--- a/libktorrent/torrent/bdecoder.cpp
+++ b/libktorrent/torrent/bdecoder.cpp
@@ -59,7 +59,7 @@ namespace bt
}
else
{
- throw Error(i18n("Illegal token: %1").tqarg(data[pos]));
+ throw Error(i18n("Illegal token: %1").arg(data[pos]));
}
}
@@ -161,7 +161,7 @@ namespace bt
Int64 bi = 0LL;
bi = n.toLongLong(&ok);
if (!ok)
- throw Error(i18n("Cannot convert %1 to an int").tqarg(n));
+ throw Error(i18n("Cannot convert %1 to an int").arg(n));
pos++;
if (verbose) Out() << "INT64 = " << n << endl;
@@ -195,7 +195,7 @@ namespace bt
len = n.toInt(&ok);
if (!ok)
{
- throw Error(i18n("Cannot convert %1 to an int").tqarg(n));
+ throw Error(i18n("Cannot convert %1 to an int").arg(n));
}
// move pos to the first part of the string
pos++;
@@ -204,7 +204,7 @@ namespace bt
TQByteArray arr(len);
for (unsigned int i = pos;i < pos + len;i++)
- arr.tqat(i-pos) = data[i];
+ arr.at(i-pos) = data[i];
pos += len;
// read the string into n
diff --git a/libktorrent/torrent/bencoder.cpp b/libktorrent/torrent/bencoder.cpp
index ef01123..cb82db7 100644
--- a/libktorrent/torrent/bencoder.cpp
+++ b/libktorrent/torrent/bencoder.cpp
@@ -87,7 +87,7 @@ namespace bt
{
if (!out) return;
- TQCString s = TQString("i%1e").tqarg(val).utf8();
+ TQCString s = TQString("i%1e").arg(val).utf8();
out->write(s,s.length());
}
@@ -95,7 +95,7 @@ namespace bt
{
if (!out) return;
- TQCString s = TQString("i%1e").tqarg(val).utf8();
+ TQCString s = TQString("i%1e").arg(val).utf8();
out->write(s,s.length());
}
@@ -104,7 +104,7 @@ namespace bt
if (!out) return;
TQCString u = str.utf8();
- TQCString s = TQString("%1:").tqarg(u.length()).utf8();
+ TQCString s = TQString("%1:").arg(u.length()).utf8();
out->write(s,s.length());
out->write(u,u.length());
}
@@ -123,7 +123,7 @@ namespace bt
{
if (!out) return;
- TQCString s = TQString("%1:").tqarg(size).utf8();
+ TQCString s = TQString("%1:").arg(size).utf8();
out->write(s,s.length());
out->write((const char*)data,size);
}
diff --git a/libktorrent/torrent/bnode.cpp b/libktorrent/torrent/bnode.cpp
index 07b7ba0..c32f09b 100644
--- a/libktorrent/torrent/bnode.cpp
+++ b/libktorrent/torrent/bnode.cpp
@@ -56,8 +56,8 @@ namespace bt
BDictNode::~BDictNode()
{
- TQValueList<DictEntry>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQValueList<DictEntry>::iterator i = children.begin();
+ while (i != children.end())
{
DictEntry & e = *i;
delete e.node;
@@ -70,13 +70,13 @@ namespace bt
DictEntry entry;
entry.key = key;
entry.node = node;
- tqchildren.append(entry);
+ children.append(entry);
}
BNode* BDictNode::getData(const TQString & key)
{
- TQValueList<DictEntry>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQValueList<DictEntry>::iterator i = children.begin();
+ while (i != children.end())
{
DictEntry & e = *i;
if (TQString(e.key) == key)
@@ -88,8 +88,8 @@ namespace bt
BDictNode* BDictNode::getDict(const TQByteArray & key)
{
- TQValueList<DictEntry>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQValueList<DictEntry>::iterator i = children.begin();
+ while (i != children.end())
{
DictEntry & e = *i;
if (e.key == key)
@@ -120,8 +120,8 @@ namespace bt
void BDictNode::printDebugInfo()
{
Out() << "DICT" << endl;
- TQValueList<DictEntry>::iterator i = tqchildren.begin();
- while (i != tqchildren.end())
+ TQValueList<DictEntry>::iterator i = children.begin();
+ while (i != children.end())
{
DictEntry & e = *i;
Out() << TQString(e.key) << ": " << endl;
@@ -135,7 +135,7 @@ namespace bt
BListNode::BListNode(Uint32 off) : BNode(LIST,off)
{
- tqchildren.setAutoDelete(true);
+ children.setAutoDelete(true);
}
@@ -145,7 +145,7 @@ namespace bt
void BListNode::append(BNode* node)
{
- tqchildren.append(node);
+ children.append(node);
}
BListNode* BListNode::getList(Uint32 idx)
@@ -165,10 +165,10 @@ namespace bt
void BListNode::printDebugInfo()
{
- Out() << "LIST " << tqchildren.count() << endl;
- for (Uint32 i = 0;i < tqchildren.count();i++)
+ Out() << "LIST " << children.count() << endl;
+ for (Uint32 i = 0;i < children.count();i++)
{
- BNode* n = tqchildren.at(i);
+ BNode* n = children.at(i);
n->printDebugInfo();
}
Out() << "END" << endl;
diff --git a/libktorrent/torrent/bnode.h b/libktorrent/torrent/bnode.h
index ccd2c94..84b306e 100644
--- a/libktorrent/torrent/bnode.h
+++ b/libktorrent/torrent/bnode.h
@@ -102,7 +102,7 @@ namespace bt
TQByteArray key;
BNode* node;
};
- TQValueList<DictEntry> tqchildren;
+ TQValueList<DictEntry> children;
public:
BDictNode(Uint32 off);
virtual ~BDictNode();
@@ -159,7 +159,7 @@ namespace bt
*/
class BListNode : public BNode
{
- TQPtrList<BNode> tqchildren;
+ TQPtrList<BNode> children;
public:
BListNode(Uint32 off);
virtual ~BListNode();
@@ -172,14 +172,14 @@ namespace bt
void printDebugInfo();
/// Get the number of nodes in the list.
- Uint32 getNumChildren() const {return tqchildren.count();}
+ Uint32 getNumChildren() const {return children.count();}
/**
* Get a node from the list
* @param idx The index
* @return The node or 0 if idx is out of bounds
*/
- BNode* getChild(Uint32 idx) {return tqchildren.at(idx);}
+ BNode* getChild(Uint32 idx) {return children.at(idx);}
/**
* Get a BListNode.
diff --git a/libktorrent/torrent/cachefile.cpp b/libktorrent/torrent/cachefile.cpp
index 678124a..7f02b6b 100644
--- a/libktorrent/torrent/cachefile.cpp
+++ b/libktorrent/torrent/cachefile.cpp
@@ -92,7 +92,7 @@ namespace bt
if (fd < 0)
{
- throw Error(i18n("Cannot open %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot open %1 : %2").arg(path).arg(strerror(errno)));
}
file_size = FileSize(fd);
@@ -118,7 +118,7 @@ namespace bt
if (read_only && mode != READ)
{
- throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path));
+ throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path));
}
if (off + size > max_size)
@@ -217,7 +217,7 @@ namespace bt
}
if (read_only)
- throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path));
+ throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path));
// jump to the end of the file
SeekFile(fd,0,SEEK_END);
@@ -237,22 +237,22 @@ namespace bt
int nb = to_write > 1024 ? 1024 : to_write;
int ret = ::write(fd,buf,nb);
if (ret < 0)
- throw Error(i18n("Cannot expand file %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Cannot expand file %1 : %2").arg(path).arg(strerror(errno)));
else if (ret != nb)
- throw Error(i18n("Cannot expand file %1 : incomplete write").tqarg(path));
+ throw Error(i18n("Cannot expand file %1 : incomplete write").arg(path));
to_write -= nb;
}
file_size += num;
//
- // Out() << TQString("growing %1 = %2").tqarg(path).tqarg(kt::BytesToString(file_size)) << endl;
+ // Out() << TQString("growing %1 = %2").arg(path).arg(kt::BytesToString(file_size)) << endl;
if (file_size != FileSize(fd))
{
-// Out() << TQString("Homer Simpson %1 %2").tqarg(file_size).tqarg(sb.st_size) << endl;
+// Out() << TQString("Homer Simpson %1 %2").arg(file_size).arg(sb.st_size) << endl;
fsync(fd);
if (file_size != FileSize(fd))
{
- throw Error(i18n("Cannot expand file %1").tqarg(path));
+ throw Error(i18n("Cannot expand file %1").arg(path));
}
}
}
@@ -292,7 +292,7 @@ namespace bt
if (ret < 0)
{
- Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").tqarg(errno).tqarg(strerror(errno)) << endl;
+ Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").arg(errno).arg(strerror(errno)) << endl;
}
}
@@ -326,7 +326,7 @@ namespace bt
if (ret < 0)
{
- Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").tqarg(errno).tqarg(strerror(errno)) << endl;
+ Out(SYS_DIO|LOG_IMPORTANT) << TQString("Munmap failed with error %1 : %2").arg(errno).arg(strerror(errno)) << endl;
}
}
::close(fd);
@@ -348,7 +348,7 @@ namespace bt
if (off >= file_size || off >= max_size)
{
- throw Error(i18n("Error : Reading past the end of the file %1").tqarg(path));
+ throw Error(i18n("Error : Reading past the end of the file %1").arg(path));
}
// jump to right position
@@ -358,7 +358,7 @@ namespace bt
if (close_again)
closeTemporary();
- throw Error(i18n("Error reading from %1").tqarg(path));
+ throw Error(i18n("Error reading from %1").arg(path));
}
if (close_again)
@@ -379,7 +379,7 @@ namespace bt
}
if (read_only)
- throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path));
+ throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path));
if (off + size > max_size)
{
@@ -389,7 +389,7 @@ namespace bt
if (file_size < off)
{
- //Out() << TQString("Writing %1 bytes at %2").tqarg(size).tqarg(off) << endl;
+ //Out() << TQString("Writing %1 bytes at %2").arg(size).arg(off) << endl;
growFile(off - file_size);
}
@@ -400,11 +400,11 @@ namespace bt
closeTemporary();
if (ret == -1)
- throw Error(i18n("Error writing to %1 : %2").tqarg(path).tqarg(strerror(errno)));
+ throw Error(i18n("Error writing to %1 : %2").arg(path).arg(strerror(errno)));
else if ((Uint32)ret != size)
{
- Out() << TQString("Incomplete write of %1 bytes, should be %2").tqarg(ret).tqarg(size) << endl;
- throw Error(i18n("Error writing to %1").tqarg(path));
+ Out() << TQString("Incomplete write of %1 bytes, should be %2").arg(ret).arg(size) << endl;
+ throw Error(i18n("Error writing to %1").arg(path));
}
if (off + size > file_size)
@@ -445,7 +445,7 @@ namespace bt
if (close_again)
closeTemporary();
- throw Error(i18n("Cannot open %1 for writing : readonly filesystem").tqarg(path));
+ throw Error(i18n("Cannot open %1 for writing : readonly filesystem").arg(path));
}
try
@@ -472,7 +472,7 @@ namespace bt
if (close_again)
closeTemporary();
- throw Error(i18n("Cannot preallocate diskspace : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot preallocate diskspace : %1").arg(strerror(errno)));
}
}
diff --git a/libktorrent/torrent/chunkdownload.cpp b/libktorrent/torrent/chunkdownload.cpp
index 3475441..38e4fec 100644
--- a/libktorrent/torrent/chunkdownload.cpp
+++ b/libktorrent/torrent/chunkdownload.cpp
@@ -196,7 +196,7 @@ namespace bt
{
if (chunk->getIndex() == r.getIndex())
{
-// Out(SYS_CON|LOG_DEBUG) << TQString("Request rejected %1 %2 %3 %4").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()).tqarg(r.getPeer()) << endl;
+// Out(SYS_CON|LOG_DEBUG) << TQString("Request rejected %1 %2 %3 %4").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()).arg(r.getPeer()) << endl;
notDownloaded(r,true);
}
@@ -207,7 +207,7 @@ namespace bt
// see if we are dealing with a piece of ours
if (chunk->getIndex() == r.getIndex())
{
- Out(SYS_CON|LOG_DEBUG) << TQString("Request timed out %1 %2 %3 %4").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()).tqarg(r.getPeer()) << endl;
+ Out(SYS_CON|LOG_DEBUG) << TQString("Request timed out %1 %2 %3 %4").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()).arg(r.getPeer()) << endl;
notDownloaded(r,false);
}
diff --git a/libktorrent/torrent/chunkmanager.cpp b/libktorrent/torrent/chunkmanager.cpp
index a0849a4..e98c58b 100644
--- a/libktorrent/torrent/chunkmanager.cpp
+++ b/libktorrent/torrent/chunkmanager.cpp
@@ -204,7 +204,7 @@ namespace bt
{
File fptr;
if (!fptr.open(index_file,"wb"))
- throw Error(i18n("Cannot open index file %1 : %2").tqarg(index_file).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open index file %1 : %2").arg(index_file).arg(fptr.errorString()));
for (unsigned int i = 0;i < tor.getNumChunks();i++)
{
@@ -387,7 +387,7 @@ namespace bt
}
}
// Uint32 num_in_mem = loaded.count();
- // Out() << TQString("Cleaned %1 chunks, %2 still in memory").tqarg(num_removed).tqarg(num_in_mem) << endl;
+ // Out() << TQString("Cleaned %1 chunks, %2 still in memory").arg(num_removed).arg(num_in_mem) << endl;
}
void ChunkManager::saveChunk(unsigned int i,bool update_index)
@@ -429,7 +429,7 @@ namespace bt
// try again
if (!fptr.open(index_file,"r+b"))
// panick if it failes
- throw Error(i18n("Cannot open index file %1 : %2").tqarg(index_file).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open index file %1 : %2").arg(index_file).arg(fptr.errorString()));
}
diff --git a/libktorrent/torrent/dndfile.cpp b/libktorrent/torrent/dndfile.cpp
index 2ca669b..dffb763 100644
--- a/libktorrent/torrent/dndfile.cpp
+++ b/libktorrent/torrent/dndfile.cpp
@@ -105,7 +105,7 @@ namespace bt
File fptr;
if (!fptr.open(path,"wb"))
- throw Error(i18n("Cannot create file %1 : %2").tqarg(path).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot create file %1 : %2").arg(path).arg(fptr.errorString()));
fptr.write(&hdr,sizeof(DNDFileHeader));
fptr.close();
@@ -172,7 +172,7 @@ namespace bt
create();
if (!fptr.open(path,"r+b"))
{
- throw Error(i18n("Failed to write first chunk to DND file : %1").tqarg(fptr.errorString()));
+ throw Error(i18n("Failed to write first chunk to DND file : %1").arg(fptr.errorString()));
}
}
@@ -230,7 +230,7 @@ namespace bt
create();
if (!fptr.open(path,"r+b"))
{
- throw Error(i18n("Failed to write last chunk to DND file : %1").tqarg(fptr.errorString()));
+ throw Error(i18n("Failed to write last chunk to DND file : %1").arg(fptr.errorString()));
}
}
diff --git a/libktorrent/torrent/ipblocklist.cpp b/libktorrent/torrent/ipblocklist.cpp
index 547b6ad..f524d6b 100644
--- a/libktorrent/torrent/ipblocklist.cpp
+++ b/libktorrent/torrent/ipblocklist.cpp
@@ -338,7 +338,7 @@ namespace bt
if(tmpmask == 0)
out.prepend("*");
else
- out.prepend(TQString("%1").tqarg(tmp));
+ out.prepend(TQString("%1").arg(tmp));
ip >>= 8;
mask >>= 8;
tmp = ip;
@@ -348,7 +348,7 @@ namespace bt
if(tmpmask == 0)
out.prepend("*.");
else
- out.prepend(TQString("%1.").tqarg(tmp));
+ out.prepend(TQString("%1.").arg(tmp));
ip >>= 8;
mask >>= 8;
tmp = ip;
@@ -358,7 +358,7 @@ namespace bt
if(tmpmask == 0)
out.prepend("*.");
else
- out.prepend(TQString("%1.").tqarg(tmp));
+ out.prepend(TQString("%1.").arg(tmp));
ip >>= 8;
mask >>= 8;
tmp = ip;
@@ -368,7 +368,7 @@ namespace bt
if(tmpmask == 0)
out.prepend("*.");
else
- out.prepend(TQString("%1.").tqarg(tmp));
+ out.prepend(TQString("%1.").arg(tmp));
return out;
}
diff --git a/libktorrent/torrent/multifilecache.cpp b/libktorrent/torrent/multifilecache.cpp
index e842560..9d41fb8 100644
--- a/libktorrent/torrent/multifilecache.cpp
+++ b/libktorrent/torrent/multifilecache.cpp
@@ -592,7 +592,7 @@ namespace bt
DNDFile out(dst_file);
File fptr;
if (!fptr.open(src_file,"rb"))
- throw Error(i18n("Cannot open file %1 : %2").tqarg(src_file).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open file %1 : %2").arg(src_file).arg(fptr.errorString()));
Uint32 cs = 0;
if (tf->getFirstChunk() == tor.getNumChunks() - 1)
@@ -654,7 +654,7 @@ namespace bt
// first attempt failed, must be fat so try that
if (!FatPreallocate(output_file,tf->getSize()))
{
- throw Error(i18n("Cannot preallocate diskspace : %1").tqarg(strerror(errno)));
+ throw Error(i18n("Cannot preallocate diskspace : %1").arg(strerror(errno)));
}
}
@@ -670,7 +670,7 @@ namespace bt
File fptr;
if (!fptr.open(output_file,"r+b"))
- throw Error(i18n("Cannot open file %1 : %2").tqarg(output_file).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open file %1 : %2").arg(output_file).arg(fptr.errorString()));
Uint32 ts = cs - tf->getFirstChunkOffset() > tf->getLastChunkSize() ?
@@ -782,7 +782,7 @@ namespace bt
else
{
- // tqchildren, so we cannot delete any more directories higher up
+ // children, so we cannot delete any more directories higher up
return;
}
}
diff --git a/libktorrent/torrent/packet.cpp b/libktorrent/torrent/packet.cpp
index 4e6cf01..e5b1aa0 100644
--- a/libktorrent/torrent/packet.cpp
+++ b/libktorrent/torrent/packet.cpp
@@ -138,16 +138,16 @@ namespace bt
switch (data[4])
{
- case CHOKE : return TQString("CHOKE %1 %2").tqarg(hdr_length).tqarg(data_length);
- case UNCHOKE : return TQString("UNCHOKE %1 %2").tqarg(hdr_length).tqarg(data_length);
- case INTERESTED : return TQString("INTERESTED %1 %2").tqarg(hdr_length).tqarg(data_length);
- case NOT_INTERESTED : return TQString("NOT_INTERESTED %1 %2").tqarg(hdr_length).tqarg(data_length);
- case HAVE : return TQString("HAVE %1 %2").tqarg(hdr_length).tqarg(data_length);
- case BITFIELD : return TQString("BITFIELD %1 %2").tqarg(hdr_length).tqarg(data_length);
- case PIECE : return TQString("PIECE %1 %2").tqarg(hdr_length).tqarg(data_length);
- case REQUEST : return TQString("REQUEST %1 %2").tqarg(hdr_length).tqarg(data_length);
- case CANCEL : return TQString("CANCEL %1 %2").tqarg(hdr_length).tqarg(data_length);
- default: return TQString("UNKNOWN %1 %2").tqarg(hdr_length).tqarg(data_length);
+ case CHOKE : return TQString("CHOKE %1 %2").arg(hdr_length).arg(data_length);
+ case UNCHOKE : return TQString("UNCHOKE %1 %2").arg(hdr_length).arg(data_length);
+ case INTERESTED : return TQString("INTERESTED %1 %2").arg(hdr_length).arg(data_length);
+ case NOT_INTERESTED : return TQString("NOT_INTERESTED %1 %2").arg(hdr_length).arg(data_length);
+ case HAVE : return TQString("HAVE %1 %2").arg(hdr_length).arg(data_length);
+ case BITFIELD : return TQString("BITFIELD %1 %2").arg(hdr_length).arg(data_length);
+ case PIECE : return TQString("PIECE %1 %2").arg(hdr_length).arg(data_length);
+ case REQUEST : return TQString("REQUEST %1 %2").arg(hdr_length).arg(data_length);
+ case CANCEL : return TQString("CANCEL %1 %2").arg(hdr_length).arg(data_length);
+ default: return TQString("UNKNOWN %1 %2").arg(hdr_length).arg(data_length);
}
}
*/
diff --git a/libktorrent/torrent/packetreader.cpp b/libktorrent/torrent/packetreader.cpp
index 3d4910a..b17becc 100644
--- a/libktorrent/torrent/packetreader.cpp
+++ b/libktorrent/torrent/packetreader.cpp
@@ -36,13 +36,13 @@ namespace bt
#ifdef LOG_PACKET
static void LogPacket(const Uint8* data,Uint32 size,Uint32 len)
{
- TQString file = TQString("/tmp/kt-packetreader-%1.log").tqarg(getpid());
+ TQString file = TQString("/tmp/kt-packetreader-%1.log").arg(getpid());
File fptr;
if (!fptr.open(file,"a"))
return;
- TQString tmp = TQString("PACKET len = %1, type = %2\nDATA: \n").tqarg(len).tqarg(data[0]);
+ TQString tmp = TQString("PACKET len = %1, type = %2\nDATA: \n").arg(len).arg(data[0]);
fptr.write(tmp.ascii(),tmp.length());
@@ -51,7 +51,7 @@ namespace bt
{
for (Uint32 i = 0;i < size;i++)
{
- tmp = TQString("0x%1 ").tqarg(data[i],0,16);
+ tmp = TQString("0x%1 ").arg(data[i],0,16);
fptr.write(tmp.ascii(),tmp.length());
j++;
if (j > 10)
@@ -65,7 +65,7 @@ namespace bt
{
for (Uint32 i = 0;i < 20;i++)
{
- tmp = TQString("0x%1 ").tqarg(data[i],0,16);
+ tmp = TQString("0x%1 ").arg(data[i],0,16);
fptr.write(tmp.ascii(),tmp.length());
j++;
if (j > 10)
@@ -78,7 +78,7 @@ namespace bt
fptr.write(tmp.ascii(),tmp.length());
for (Uint32 i = size - 20;i < size;i++)
{
- tmp = TQString("0x%1 ").tqarg(data[i],0,16);
+ tmp = TQString("0x%1 ").arg(data[i],0,16);
fptr.write(tmp.ascii(),tmp.length());
j++;
if (j > 10)
diff --git a/libktorrent/torrent/packetwriter.cpp b/libktorrent/torrent/packetwriter.cpp
index 6c186dc..21d26cf 100644
--- a/libktorrent/torrent/packetwriter.cpp
+++ b/libktorrent/torrent/packetwriter.cpp
@@ -195,7 +195,7 @@ namespace bt
else
{
/* Out(SYS_CON|LOG_DEBUG) << TQString("Uploading %1 %2 %3 %4 %5")
- .tqarg(index).tqarg(begin).tqarg(len).tqarg((TQ_ULLONG)ch,0,16).tqarg((TQ_ULLONG)ch->getData(),0,16)
+ .arg(index).arg(begin).arg(len).arg((TQ_ULLONG)ch,0,16).arg((TQ_ULLONG)ch->getData(),0,16)
<< endl;;
*/
queuePacket(new Packet(index,begin,len,ch));
@@ -218,7 +218,7 @@ namespace bt
enc.write(TQString("p"));
enc.write((Uint32)port);
}
- enc.write(TQString("v")); enc.write(TQString("KTorrent %1").tqarg(kt::VERSION_STRING));
+ enc.write(TQString("v")); enc.write(TQString("KTorrent %1").arg(kt::VERSION_STRING));
enc.end();
sendExtProtMsg(0,arr);
}
diff --git a/libktorrent/torrent/peerid.cpp b/libktorrent/torrent/peerid.cpp
index 09b4bff..802fca6 100644
--- a/libktorrent/torrent/peerid.cpp
+++ b/libktorrent/torrent/peerid.cpp
@@ -174,7 +174,7 @@ namespace bt
Map["TS"] = "Torrent Storm";
Map["TT"] = "TuoTu";
Map["UL"] = "uLeecher!";
- Map["UT"] = TQString("%1Torrent").tqarg(TQChar(0x00B5)); // µTorrent, 0x00B5 is tqunicode for µ
+ Map["UT"] = TQString("%1Torrent").arg(TQChar(0x00B5)); // µTorrent, 0x00B5 is tqunicode for µ
Map["WT"] = "BitLet";
Map["WY"] = "FireTorrent";
Map["XL"] = "Xunlei";
@@ -201,31 +201,31 @@ namespace bt
}
TQString name = i18n("Unknown client");
- if (peer_id.tqat(0) == '-' &&
- peer_id.tqat(1).isLetter() &&
- peer_id.tqat(2).isLetter() ) //AZ style
+ if (peer_id.at(0) == '-' &&
+ peer_id.at(1).isLetter() &&
+ peer_id.at(2).isLetter() ) //AZ style
{
TQString ID(peer_id.mid(1,2));
if (Map.contains(ID))
- name = Map[ID] + " " + peer_id.tqat(3) + "." + peer_id.tqat(4) + "."
- + peer_id.tqat(5) + "." + peer_id.tqat(6);
+ name = Map[ID] + " " + peer_id.at(3) + "." + peer_id.at(4) + "."
+ + peer_id.at(5) + "." + peer_id.at(6);
}
- else if (peer_id.tqat(0).isLetter() &&
- peer_id.tqat(1).isDigit() &&
- peer_id.tqat(2).isDigit() ) //Shadow's style
+ else if (peer_id.at(0).isLetter() &&
+ peer_id.at(1).isDigit() &&
+ peer_id.at(2).isDigit() ) //Shadow's style
{
- TQString ID = TQString(peer_id.tqat(0));
+ TQString ID = TQString(peer_id.at(0));
if (Map.contains(ID))
- name = Map[ID] + " " + peer_id.tqat(1) + "." +
- peer_id.tqat(2) + "." + peer_id.tqat(3);
+ name = Map[ID] + " " + peer_id.at(1) + "." +
+ peer_id.at(2) + "." + peer_id.at(3);
}
- else if (peer_id.tqat(0) == 'M' && peer_id.tqat(2) == '-' && (peer_id.tqat(4) == '-' || peer_id.tqat(5) == '-'))
+ else if (peer_id.at(0) == 'M' && peer_id.at(2) == '-' && (peer_id.at(4) == '-' || peer_id.at(5) == '-'))
{
- name = Map["M"] + " " + peer_id.tqat(1) + "." + peer_id.tqat(3);
- if(peer_id.tqat(4) == '-')
- name += "." + peer_id.tqat(5);
+ name = Map["M"] + " " + peer_id.at(1) + "." + peer_id.at(3);
+ if(peer_id.at(4) == '-')
+ name += "." + peer_id.at(5);
else
- name += peer_id.tqat(4) + "." + peer_id.tqat(6);
+ name += peer_id.at(4) + "." + peer_id.at(6);
}
else if (peer_id.startsWith("OP"))
{
@@ -245,7 +245,7 @@ namespace bt
}
else if ( peer_id.startsWith("Mbrst"))
{
- name = Map["Mbrst"] + " " + peer_id.tqat(5) + "." + peer_id.tqat(7);
+ name = Map["Mbrst"] + " " + peer_id.at(5) + "." + peer_id.at(7);
}
return name;
diff --git a/libktorrent/torrent/peermanager.cpp b/libktorrent/torrent/peermanager.cpp
index adacbae..eefd246 100644
--- a/libktorrent/torrent/peermanager.cpp
+++ b/libktorrent/torrent/peermanager.cpp
@@ -475,10 +475,10 @@ namespace bt
// convert IP address to string
pp.ip = TQString("%1.%2.%3.%4")
- .tqarg((e.ip & 0xFF000000) >> 24)
- .tqarg((e.ip & 0x00FF0000) >> 16)
- .tqarg((e.ip & 0x0000FF00) >> 8)
- .tqarg( e.ip & 0x000000FF);
+ .arg((e.ip & 0xFF000000) >> 24)
+ .arg((e.ip & 0x00FF0000) >> 16)
+ .arg((e.ip & 0x0000FF00) >> 8)
+ .arg( e.ip & 0x000000FF);
pp.port = e.port;
addPotentialPeer(pp);
}
@@ -564,10 +564,10 @@ namespace bt
pp.port = ReadUint16(tmp,4);
Uint32 ip = ReadUint32(tmp,0);
pp.ip = TQString("%1.%2.%3.%4")
- .tqarg((ip & 0xFF000000) >> 24)
- .tqarg((ip & 0x00FF0000) >> 16)
- .tqarg((ip & 0x0000FF00) >> 8)
- .tqarg( ip & 0x000000FF);
+ .arg((ip & 0xFF000000) >> 24)
+ .arg((ip & 0x00FF0000) >> 16)
+ .arg((ip & 0x0000FF00) >> 8)
+ .arg( ip & 0x000000FF);
pp.local = false;
addPotentialPeer(pp);
diff --git a/libktorrent/torrent/peeruploader.cpp b/libktorrent/torrent/peeruploader.cpp
index 4881dc8..2de899b 100644
--- a/libktorrent/torrent/peeruploader.cpp
+++ b/libktorrent/torrent/peeruploader.cpp
@@ -45,7 +45,7 @@ namespace bt
void PeerUploader::addRequest(const Request & r)
{
// Out(SYS_CON|LOG_DEBUG) <<
- // TQString("PeerUploader::addRequest %1 %2 %3\n").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()) << endl;
+ // TQString("PeerUploader::addRequest %1 %2 %3\n").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()) << endl;
// allowed fast chunks go to the front of the queue
requests.append(r);
@@ -54,7 +54,7 @@ namespace bt
void PeerUploader::removeRequest(const Request & r)
{
// Out(SYS_CON|LOG_DEBUG) <<
- // TQString("PeerUploader::removeRequest %1 %2 %3\n").tqarg(r.getIndex()).tqarg(r.getOffset()).tqarg(r.getLength()) << endl;
+ // TQString("PeerUploader::removeRequest %1 %2 %3\n").arg(r.getIndex()).arg(r.getOffset()).arg(r.getLength()) << endl;
requests.remove(r);
peer->getPacketWriter().doNotSendPiece(r,peer->getStats().fast_extensions);
}
diff --git a/libktorrent/torrent/queuemanager.cpp b/libktorrent/torrent/queuemanager.cpp
index affedf5..0c76b8a 100644
--- a/libktorrent/torrent/queuemanager.cpp
+++ b/libktorrent/torrent/queuemanager.cpp
@@ -132,7 +132,7 @@ namespace bt
return kt::NOT_ENOUGH_DISKSPACE;
case 1: //ask user
- if (KMessageBox::questionYesNo(0, i18n("You don't have enough disk space to download this torrent. Are you sure you want to continue?"), i18n("Insufficient disk space for %1").tqarg(s.torrent_name)) == KMessageBox::No)
+ if (KMessageBox::questionYesNo(0, i18n("You don't have enough disk space to download this torrent. Are you sure you want to continue?"), i18n("Insufficient disk space for %1").arg(s.torrent_name)) == KMessageBox::No)
{
tc->setPriority(0);
return kt::USER_CANCELED;
@@ -154,7 +154,7 @@ namespace bt
if (s.completed && max_ratio > 0 && ratio >= max_ratio)
{
- if (KMessageBox::questionYesNo(0, i18n("Torrent \"%1\" has reached its maximum share ratio. Ignore the limit and start seeding anyway?").tqarg(s.torrent_name), i18n("Maximum share ratio limit reached.")) == KMessageBox::Yes)
+ if (KMessageBox::questionYesNo(0, i18n("Torrent \"%1\" has reached its maximum share ratio. Ignore the limit and start seeding anyway?").arg(s.torrent_name), i18n("Maximum share ratio limit reached.")) == KMessageBox::Yes)
{
tc->setMaxShareRatio(0.00f);
startSafely(tc);
@@ -234,7 +234,7 @@ namespace bt
{
TQString msg =
i18n("Error stopping torrent %1 : %2")
- .tqarg(s.torrent_name).tqarg(err.toString());
+ .arg(s.torrent_name).arg(err.toString());
KMessageBox::error(0, msg, i18n("Error"));
}
}
@@ -740,7 +740,7 @@ namespace bt
TQString msg =
i18n("Error starting torrent %1 : %2")
- .tqarg(s.torrent_name).tqarg(err.toString());
+ .arg(s.torrent_name).arg(err.toString());
KMessageBox::error(0, msg, i18n("Error"));
}
@@ -758,7 +758,7 @@ namespace bt
TQString msg =
i18n("Error stopping torrent %1 : %2")
- .tqarg(s.torrent_name).tqarg(err.toString());
+ .arg(s.torrent_name).arg(err.toString());
KMessageBox::error(0, msg, i18n("Error"));
}
diff --git a/libktorrent/torrent/torrent.cpp b/libktorrent/torrent/torrent.cpp
index c5d8459..c175be9 100644
--- a/libktorrent/torrent/torrent.cpp
+++ b/libktorrent/torrent/torrent.cpp
@@ -101,7 +101,7 @@ namespace bt
TQFile fptr(file);
if (!fptr.open(IO_ReadOnly))
throw Error(i18n(" Unable to open torrent file %1 : %2")
- .tqarg(file).tqarg(fptr.errorString()));
+ .arg(file).arg(fptr.errorString()));
TQByteArray data(fptr.size());
// Out() << "File size = " << fptr.size() << endl;
@@ -366,7 +366,7 @@ namespace bt
const SHA1Hash & Torrent::getHash(Uint32 idx) const
{
if (idx >= hash_pieces.count())
- throw Error(TQString("Torrent::getHash %1 is out of bounds").tqarg(idx));
+ throw Error(TQString("Torrent::getHash %1 is out of bounds").arg(idx));
return hash_pieces[idx];
}
diff --git a/libktorrent/torrent/torrentcontrol.cpp b/libktorrent/torrent/torrentcontrol.cpp
index 590a517..3e22ec1 100644
--- a/libktorrent/torrent/torrentcontrol.cpp
+++ b/libktorrent/torrent/torrentcontrol.cpp
@@ -506,7 +506,7 @@ namespace bt
delete tor;
tor = 0;
throw Error(i18n("An error occurred while loading the torrent."
- " The torrent is probably corrupt or is not a torrent file.\n%1").tqarg(torrent));
+ " The torrent is probably corrupt or is not a torrent file.\n%1").arg(torrent));
}
initInternal(qman,tmpdir,ddir,default_save_dir,torrent.startsWith(tmpdir));
@@ -544,7 +544,7 @@ namespace bt
TQFile fptr(tor_copy);
if (!fptr.open(IO_WriteOnly))
throw Error(i18n("Unable to create %1 : %2")
- .tqarg(tor_copy).tqarg(fptr.errorString()));
+ .arg(tor_copy).arg(fptr.errorString()));
fptr.writeBlock(data.data(),data.size());
}
@@ -559,12 +559,12 @@ namespace bt
{
qman->mergeAnnounceList(tor->getInfoHash(),tor->getTrackerList());
- throw Error(i18n("You are already downloading this torrent %1, the list of trackers of both torrents has been merged.").tqarg(tor->getNameSuggestion()));
+ throw Error(i18n("You are already downloading this torrent %1, the list of trackers of both torrents has been merged.").arg(tor->getNameSuggestion()));
}
else
{
throw Error(i18n("You are already downloading the torrent %1")
- .tqarg(tor->getNameSuggestion()));
+ .arg(tor->getNameSuggestion()));
}
}
}
@@ -670,7 +670,7 @@ namespace bt
throw Error(
i18n("Cannot migrate %1 : %2")
- .tqarg(tor->getNameSuggestion()).tqarg(err.toString()));
+ .arg(tor->getNameSuggestion()).arg(err.toString()));
}
}
setupData(ddir);
@@ -993,20 +993,20 @@ namespace bt
if (stats.running)
{
TQDateTime now = TQDateTime::currentDateTime();
- st.write("RUNNING_TIME_DL",TQString("%1").tqarg(istats.running_time_dl + istats.time_started_dl.secsTo(now)));
- st.write("RUNNING_TIME_UL",TQString("%1").tqarg(istats.running_time_ul + istats.time_started_ul.secsTo(now)));
+ st.write("RUNNING_TIME_DL",TQString("%1").arg(istats.running_time_dl + istats.time_started_dl.secsTo(now)));
+ st.write("RUNNING_TIME_UL",TQString("%1").arg(istats.running_time_ul + istats.time_started_ul.secsTo(now)));
}
else
{
- st.write("RUNNING_TIME_DL", TQString("%1").tqarg(istats.running_time_dl));
- st.write("RUNNING_TIME_UL", TQString("%1").tqarg(istats.running_time_ul));
+ st.write("RUNNING_TIME_DL", TQString("%1").arg(istats.running_time_dl));
+ st.write("RUNNING_TIME_UL", TQString("%1").arg(istats.running_time_ul));
}
- st.write("PRIORITY", TQString("%1").tqarg(istats.priority));
- st.write("AUTOSTART", TQString("%1").tqarg(stats.autostart));
- st.write("IMPORTED", TQString("%1").tqarg(stats.imported_bytes));
+ st.write("PRIORITY", TQString("%1").arg(istats.priority));
+ st.write("AUTOSTART", TQString("%1").arg(stats.autostart));
+ st.write("IMPORTED", TQString("%1").arg(stats.imported_bytes));
st.write("CUSTOM_OUTPUT_NAME",istats.custom_output_name ? "1" : "0");
- st.write("MAX_RATIO", TQString("%1").tqarg(stats.max_share_ratio,0,'f',2));
+ st.write("MAX_RATIO", TQString("%1").arg(stats.max_share_ratio,0,'f',2));
st.write("MAX_SEED_TIME",TQString::number(stats.max_seed_time));
st.write("RESTART_DISK_PREALLOCATION",prealloc ? "1" : "0");
@@ -1274,7 +1274,7 @@ namespace bt
" To make sure this torrent still works with this version of KTorrent, "
"we will migrate this torrent. You will be asked for a location to save "
"the torrent to. If you press cancel, we will select your home directory.")
- .tqarg(tor->getNameSuggestion()));
+ .arg(tor->getNameSuggestion()));
outputdir = KFileDialog::getExistingDirectory(TQString(), 0,i18n("Select Folder to Save To"));
if (outputdir.isNull())
outputdir = TQDir::homeDirPath();
diff --git a/libktorrent/torrent/torrentcreator.cpp b/libktorrent/torrent/torrentcreator.cpp
index 5538b9e..fae7d75 100644
--- a/libktorrent/torrent/torrentcreator.cpp
+++ b/libktorrent/torrent/torrentcreator.cpp
@@ -120,7 +120,7 @@ namespace bt
{
File fptr;
if (!fptr.open(url,"wb"))
- throw Error(i18n("Cannot open file %1: %2").tqarg(url).tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot open file %1: %2").arg(url).arg(fptr.errorString()));
BEncoder enc(&fptr);
enc.beginDict(); // top dict
@@ -147,7 +147,7 @@ namespace bt
enc.write(TQString("comments"));
enc.write(comments);
}
- enc.write(TQString("created by"));enc.write(TQString("KTorrent %1").tqarg(kt::VERSION_STRING));
+ enc.write(TQString("created by"));enc.write(TQString("KTorrent %1").arg(kt::VERSION_STRING));
enc.write(TQString("creation date"));enc.write((Uint64)time(0));
enc.write(TQString("info"));
saveInfo(enc);
@@ -237,7 +237,7 @@ namespace bt
File fptr;
if (!fptr.open(target,"rb"))
throw Error(i18n("Cannot open file %1: %2")
- .tqarg(target).tqarg(fptr.errorString()));
+ .arg(target).arg(fptr.errorString()));
Uint32 s = cur_chunk != num_chunks - 1 ? chunk_size : last_size;
fptr.seek(File::BEGIN,(Int64)cur_chunk*chunk_size);
@@ -275,7 +275,7 @@ namespace bt
if (!fptr.open(target + f.getPath(),"rb"))
{
throw Error(i18n("Cannot open file %1: %2")
- .tqarg(f.getPath()).tqarg(fptr.errorString()));
+ .arg(f.getPath()).arg(fptr.errorString()));
}
// first calculate offset into file
@@ -336,7 +336,7 @@ namespace bt
// write full index file
File fptr;
if (!fptr.open(dd + "index","wb"))
- throw Error(i18n("Cannot create index file: %1").tqarg(fptr.errorString()));
+ throw Error(i18n("Cannot create index file: %1").arg(fptr.errorString()));
for (Uint32 i = 0;i < num_chunks;i++)
{
diff --git a/libktorrent/torrent/udptracker.cpp b/libktorrent/torrent/udptracker.cpp
index 6597349..ab33771 100644
--- a/libktorrent/torrent/udptracker.cpp
+++ b/libktorrent/torrent/udptracker.cpp
@@ -144,10 +144,10 @@ namespace bt
{
Uint32 ip = ReadUint32(buf,i);
addPeer(TQString("%1.%2.%3.%4")
- .tqarg((ip & (0xFF000000)) >> 24)
- .tqarg((ip & (0x00FF0000)) >> 16)
- .tqarg((ip & (0x0000FF00)) >> 8)
- .tqarg(ip & 0x000000FF),
+ .arg((ip & (0xFF000000)) >> 24)
+ .arg((ip & (0x00FF0000)) >> 16)
+ .arg((ip & (0x0000FF00)) >> 8)
+ .arg(ip & 0x000000FF),
ReadUint16(buf,i+4));
}
diff --git a/libktorrent/torrent/udptrackersocket.cpp b/libktorrent/torrent/udptrackersocket.cpp
index e440e3c..78be6ad 100644
--- a/libktorrent/torrent/udptrackersocket.cpp
+++ b/libktorrent/torrent/udptrackersocket.cpp
@@ -59,7 +59,7 @@ namespace bt
if (!bound)
{
KMessageBox::error(0,
- i18n("Cannot bind to udp port %1 or the 10 following ports.").tqarg(port));
+ i18n("Cannot bind to udp port %1 or the 10 following ports.").arg(port));
}
else
{