summaryrefslogtreecommitdiffstats
path: root/libktorrent/torrent/bdecoder.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-28 20:34:15 +0000
commit1c1403293485f35fd53db45aaa77a01cdd9627e7 (patch)
tree38559cd68cd4f63023fb5f6375def9db3b8b491e /libktorrent/torrent/bdecoder.cpp
parent894f94545727610df22c4f73911d62d58266f695 (diff)
downloadktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.tar.gz
ktorrent-1c1403293485f35fd53db45aaa77a01cdd9627e7.zip
TQt4 port ktorrent
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/ktorrent@1238733 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libktorrent/torrent/bdecoder.cpp')
-rw-r--r--libktorrent/torrent/bdecoder.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/libktorrent/torrent/bdecoder.cpp b/libktorrent/torrent/bdecoder.cpp
index 6c5a179..778cf8a 100644
--- a/libktorrent/torrent/bdecoder.cpp
+++ b/libktorrent/torrent/bdecoder.cpp
@@ -27,7 +27,7 @@
namespace bt
{
- BDecoder::BDecoder(const QByteArray & data,bool verbose,Uint32 off)
+ BDecoder::BDecoder(const TQByteArray & data,bool verbose,Uint32 off)
: data(data),pos(off),verbose(verbose)
{
}
@@ -59,7 +59,7 @@ namespace bt
}
else
{
- throw Error(i18n("Illegal token: %1").arg(data[pos]));
+ throw Error(i18n("Illegal token: %1").tqarg(data[pos]));
}
}
@@ -83,7 +83,7 @@ namespace bt
throw Error(i18n("Decode error"));
}
- QByteArray key = k->data().toByteArray();
+ TQByteArray key = k->data().toByteArray();
delete kn;
BNode* data = decode();
@@ -130,7 +130,7 @@ namespace bt
{
Uint32 off = pos;
pos++;
- QString n;
+ TQString n;
// look for e and add everything between i and e to n
while (pos < data.size() && data[pos] != 'e')
{
@@ -161,7 +161,7 @@ namespace bt
Int64 bi = 0LL;
bi = n.toLongLong(&ok);
if (!ok)
- throw Error(i18n("Cannot convert %1 to an int").arg(n));
+ throw Error(i18n("Cannot convert %1 to an int").tqarg(n));
pos++;
if (verbose) Out() << "INT64 = " << n << endl;
@@ -177,7 +177,7 @@ namespace bt
// string are encoded 4:spam (length:string)
// first get length by looking for the :
- QString n;
+ TQString n;
while (pos < data.size() && data[pos] != ':')
{
n += data[pos];
@@ -195,16 +195,16 @@ namespace bt
len = n.toInt(&ok);
if (!ok)
{
- throw Error(i18n("Cannot convert %1 to an int").arg(n));
+ throw Error(i18n("Cannot convert %1 to an int").tqarg(n));
}
// move pos to the first part of the string
pos++;
if (pos + len > data.size())
throw Error(i18n("Torrent is incomplete!"));
- QByteArray arr(len);
+ TQByteArray arr(len);
for (unsigned int i = pos;i < pos + len;i++)
- arr.at(i-pos) = data[i];
+ arr.tqat(i-pos) = data[i];
pos += len;
// read the string into n
@@ -214,7 +214,7 @@ namespace bt
if (verbose)
{
if (arr.size() < 200)
- Out() << "STRING " << QString(arr) << endl;
+ Out() << "STRING " << TQString(arr) << endl;
else
Out() << "STRING " << "really long string" << endl;
}