From 1c1403293485f35fd53db45aaa77a01cdd9627e7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Tue, 28 Jun 2011 20:34:15 +0000 Subject: 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 --- libktorrent/mse/bigint.cpp | 2 +- libktorrent/mse/bigint.h | 4 ++-- libktorrent/mse/encryptedauthenticate.cpp | 2 +- libktorrent/mse/encryptedauthenticate.h | 3 ++- libktorrent/mse/encryptedserverauthenticate.h | 1 + libktorrent/mse/functions.cpp | 4 ++-- libktorrent/mse/functions.h | 2 +- libktorrent/mse/streamsocket.cpp | 8 ++++---- libktorrent/mse/streamsocket.h | 11 ++++++----- 9 files changed, 20 insertions(+), 17 deletions(-) (limited to 'libktorrent/mse') diff --git a/libktorrent/mse/bigint.cpp b/libktorrent/mse/bigint.cpp index 90c6d9e..e2746f6 100644 --- a/libktorrent/mse/bigint.cpp +++ b/libktorrent/mse/bigint.cpp @@ -36,7 +36,7 @@ namespace mse mpz_init2(val,num_bits); } - BigInt::BigInt(const QString & value) + BigInt::BigInt(const TQString & value) { mpz_init2(val,(value.length() - 2)*4); mpz_set_str(val,value.ascii(),0); diff --git a/libktorrent/mse/bigint.h b/libktorrent/mse/bigint.h index ad94d20..39bb865 100644 --- a/libktorrent/mse/bigint.h +++ b/libktorrent/mse/bigint.h @@ -20,7 +20,7 @@ #ifndef MSEBIGINT_H #define MSEBIGINT_H -#include +#include #include #include #include @@ -57,7 +57,7 @@ namespace mse * Letters can be upper or lower case. Invalid chars will create an invalid number. * @param value The hexadecimal representation of the number */ - BigInt(const QString & value); + BigInt(const TQString & value); /** * Copy constructor. diff --git a/libktorrent/mse/encryptedauthenticate.cpp b/libktorrent/mse/encryptedauthenticate.cpp index 644ba7b..e60aa22 100644 --- a/libktorrent/mse/encryptedauthenticate.cpp +++ b/libktorrent/mse/encryptedauthenticate.cpp @@ -36,7 +36,7 @@ namespace mse EncryptedAuthenticate::EncryptedAuthenticate( - const QString& ip, + const TQString& ip, Uint16 port, const SHA1Hash& info_hash, const PeerID& peer_id, diff --git a/libktorrent/mse/encryptedauthenticate.h b/libktorrent/mse/encryptedauthenticate.h index 74ccc1b..1ab8192 100644 --- a/libktorrent/mse/encryptedauthenticate.h +++ b/libktorrent/mse/encryptedauthenticate.h @@ -39,8 +39,9 @@ namespace mse class EncryptedAuthenticate : public bt::Authenticate { Q_OBJECT + TQ_OBJECT public: - EncryptedAuthenticate(const QString& ip, Uint16 port, const bt::SHA1Hash& info_hash, const bt::PeerID& peer_id, bt::PeerManager* pman); + EncryptedAuthenticate(const TQString& ip, Uint16 port, const bt::SHA1Hash& info_hash, const bt::PeerID& peer_id, bt::PeerManager* pman); virtual ~EncryptedAuthenticate(); private slots: diff --git a/libktorrent/mse/encryptedserverauthenticate.h b/libktorrent/mse/encryptedserverauthenticate.h index 3c358cd..b5df3ff 100644 --- a/libktorrent/mse/encryptedserverauthenticate.h +++ b/libktorrent/mse/encryptedserverauthenticate.h @@ -36,6 +36,7 @@ namespace mse class EncryptedServerAuthenticate : public bt::ServerAuthenticate { Q_OBJECT + TQ_OBJECT public: EncryptedServerAuthenticate(mse::StreamSocket* sock, bt::Server* server); virtual ~EncryptedServerAuthenticate(); diff --git a/libktorrent/mse/functions.cpp b/libktorrent/mse/functions.cpp index bb19b93..d9ed5cf 100644 --- a/libktorrent/mse/functions.cpp +++ b/libktorrent/mse/functions.cpp @@ -58,7 +58,7 @@ namespace mse return bt::SHA1Hash::generate(buf,120); } - void DumpBigInt(const QString & name,const BigInt & bi) + void DumpBigInt(const TQString & name,const BigInt & bi) { static Uint8 buf[512]; Uint32 nb = bi.toBuffer(buf,512); @@ -66,7 +66,7 @@ namespace mse lg << name << " (" << nb << ") = "; for (Uint32 i = 0;i < nb;i++) { - lg << QString("0x%1 ").arg(buf[i],0,16); + lg << TQString("0x%1 ").tqarg(buf[i],0,16); } lg << endl; } diff --git a/libktorrent/mse/functions.h b/libktorrent/mse/functions.h index 4be1667..95e8e5d 100644 --- a/libktorrent/mse/functions.h +++ b/libktorrent/mse/functions.h @@ -33,7 +33,7 @@ namespace mse BigInt DHSecret(const BigInt & our_priv,const BigInt & peer_pub); bt::SHA1Hash EncryptionKey(bool a,const BigInt & s,const bt::SHA1Hash & skey); - void DumpBigInt(const QString & name,const BigInt & bi); + void DumpBigInt(const TQString & name,const BigInt & bi); } #endif diff --git a/libktorrent/mse/streamsocket.cpp b/libktorrent/mse/streamsocket.cpp index 19a0a2e..08f2d7b 100644 --- a/libktorrent/mse/streamsocket.cpp +++ b/libktorrent/mse/streamsocket.cpp @@ -18,8 +18,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include -#include -#include +#include +#include #include #include #include @@ -181,7 +181,7 @@ namespace mse sock->close(); } - bool StreamSocket::connectTo(const QString & ip,Uint16 port) + bool StreamSocket::connectTo(const TQString & ip,Uint16 port) { // do a safety check if (ip.isNull() || ip.length() == 0) @@ -221,7 +221,7 @@ namespace mse return sock->ok(); } - QString StreamSocket::getRemoteIPAddress() const + TQString StreamSocket::getRemoteIPAddress() const { return sock->getPeerName().toString(); } diff --git a/libktorrent/mse/streamsocket.h b/libktorrent/mse/streamsocket.h index 5006a7b..6cfa6d8 100644 --- a/libktorrent/mse/streamsocket.h +++ b/libktorrent/mse/streamsocket.h @@ -20,11 +20,11 @@ #ifndef MSESTREAMSOCKET_H #define MSESTREAMSOCKET_H -#include +#include #include #include -class QString; +class TQString; using bt::Uint8; using bt::Uint16; @@ -52,9 +52,10 @@ namespace mse * not be used anymore, a SocketReader and SocketWriter should be provided, * so that reading and writing is controlled from the monitor thread. */ - class StreamSocket : public QObject,public net::SocketReader,public net::SocketWriter + class StreamSocket : public TQObject,public net::SocketReader,public net::SocketWriter { Q_OBJECT + TQ_OBJECT public: StreamSocket(); StreamSocket(int fd); @@ -99,10 +100,10 @@ namespace mse void close(); /// Connect the socket to a remote host - bool connectTo(const QString & ip,Uint16 port); + bool connectTo(const TQString & ip,Uint16 port); /// Get the IP address of the remote peer - QString getRemoteIPAddress() const; + TQString getRemoteIPAddress() const; /// Get the port of the remote peer bt::Uint16 getRemotePort() const; -- cgit v1.2.1