diff options
Diffstat (limited to 'kopete/protocols/jabber/libiris/cutestuff/util')
14 files changed, 152 insertions, 152 deletions
diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp index c1483196..06df3f73 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp @@ -33,21 +33,21 @@ //! ... //! //! // encode a block of data into base64 -//! QByteArray block(1024); -//! QByteArray enc = Base64::encode(block); +//! TQByteArray block(1024); +//! TQByteArray enc = Base64::encode(block); //! //! \endcode //! //! Encodes array \a s and returns the result. -QByteArray Base64::encode(const QByteArray &s) +TQByteArray Base64::encode(const TQByteArray &s) { int i; int len = s.size(); char tbl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; int a, b, c; - QByteArray p((len+2)/3*4); + TQByteArray p((len+2)/3*4); int at = 0; for( i = 0; i < len; i += 3 ) { a = ((unsigned char)s[i] & 3) << 4; @@ -74,10 +74,10 @@ QByteArray Base64::encode(const QByteArray &s) //! //! Decodes array \a s and returns the result. -QByteArray Base64::decode(const QByteArray &s) +TQByteArray Base64::decode(const TQByteArray &s) { // return value - QByteArray p; + TQByteArray p; // -1 specifies invalid // 64 specifies eof @@ -140,41 +140,41 @@ QByteArray Base64::decode(const QByteArray &s) //! //! Encodes array \a a and returns the result as a string. -QString Base64::arrayToString(const QByteArray &a) +TQString Base64::arrayToString(const TQByteArray &a) { - QByteArray b = encode(a); - QCString c; + TQByteArray b = encode(a); + TQCString c; c.resize(b.size()+1); memcpy(c.data(), b.data(), b.size()); - return QString::fromLatin1(c); + return TQString::fromLatin1(c); } //! //! Decodes string \a s and returns the result as an array. -QByteArray Base64::stringToArray(const QString &s) +TQByteArray Base64::stringToArray(const TQString &s) { if(s.isEmpty()) - return QByteArray(); + return TQByteArray(); // Unfold data - QString us(s); + TQString us(s); us.remove('\n'); const char *c = us.latin1(); int len = strlen(c); - QByteArray b(len); + TQByteArray b(len); memcpy(b.data(), c, len); - QByteArray a = decode(b); + TQByteArray a = decode(b); return a; } //! //! Encodes string \a s and returns the result as a string. -QString Base64::encodeString(const QString &s) +TQString Base64::encodeString(const TQString &s) { - QCString c = s.utf8(); + TQCString c = s.utf8(); int len = c.length(); - QByteArray b(len); + TQByteArray b(len); memcpy(b.data(), c.data(), len); return arrayToString(b); } diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/base64.h b/kopete/protocols/jabber/libiris/cutestuff/util/base64.h index 3aae2ba6..eaa2ff5b 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/base64.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/base64.h @@ -21,18 +21,18 @@ #ifndef CS_BASE64_H #define CS_BASE64_H -#include<qstring.h> +#include<tqstring.h> // CS_NAMESPACE_BEGIN class Base64 { public: - static QByteArray encode(const QByteArray &); - static QByteArray decode(const QByteArray &); - static QString arrayToString(const QByteArray &); - static QByteArray stringToArray(const QString &); - static QString encodeString(const QString &); + static TQByteArray encode(const TQByteArray &); + static TQByteArray decode(const TQByteArray &); + static TQString arrayToString(const TQByteArray &); + static TQByteArray stringToArray(const TQString &); + static TQString encodeString(const TQString &); }; // CS_NAMESPACE_END diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp index 068e39a0..e78c2f9a 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp @@ -35,7 +35,7 @@ //! //! The signals connectionClosed(), delayedCloseFinished(), readyRead(), //! bytesWritten(), and error() serve the exact same function as those from -//! <A HREF="http://doc.trolltech.com/3.1/qsocket.html">QSocket</A>. +//! <A HREF="http://doc.trolltech.com/3.1/tqsocket.html">TQSocket</A>. //! //! The simplest way to create a ByteStream is to reimplement isOpen(), close(), //! and tryWrite(). Call appendRead() whenever you want to make data available for @@ -59,13 +59,13 @@ class ByteStream::Private public: Private() {} - QByteArray readBuf, writeBuf; + TQByteArray readBuf, writeBuf; }; //! //! Constructs a ByteStream object with parent \a parent. -ByteStream::ByteStream(QObject *parent) -:QObject(parent) +ByteStream::ByteStream(TQObject *parent) +:TQObject(parent) { d = new Private; } @@ -95,7 +95,7 @@ void ByteStream::close() //! //! Writes array \a a to the stream. -void ByteStream::write(const QByteArray &a) +void ByteStream::write(const TQByteArray &a) { if(!isOpen()) return; @@ -109,7 +109,7 @@ void ByteStream::write(const QByteArray &a) //! //! Reads bytes \a bytes of data from the stream and returns them as an array. If \a bytes is 0, then //! \a read will return all available data. -QByteArray ByteStream::read(int bytes) +TQByteArray ByteStream::read(int bytes) { return takeRead(bytes); } @@ -130,9 +130,9 @@ int ByteStream::bytesToWrite() const //! //! Writes string \a cs to the stream. -void ByteStream::write(const QCString &cs) +void ByteStream::write(const TQCString &cs) { - QByteArray block(cs.length()); + TQByteArray block(cs.length()); memcpy(block.data(), cs.data(), block.size()); write(block); } @@ -153,14 +153,14 @@ void ByteStream::clearWriteBuffer() //! //! Appends \a block to the end of the read buffer. -void ByteStream::appendRead(const QByteArray &block) +void ByteStream::appendRead(const TQByteArray &block) { appendArray(&d->readBuf, block); } //! //! Appends \a block to the end of the write buffer. -void ByteStream::appendWrite(const QByteArray &block) +void ByteStream::appendWrite(const TQByteArray &block) { appendArray(&d->writeBuf, block); } @@ -169,7 +169,7 @@ void ByteStream::appendWrite(const QByteArray &block) //! Returns \a size bytes from the start of the read buffer. //! If \a size is 0, then all available data will be returned. //! If \a del is TRUE, then the bytes are also removed. -QByteArray ByteStream::takeRead(int size, bool del) +TQByteArray ByteStream::takeRead(int size, bool del) { return takeArray(&d->readBuf, size, del); } @@ -178,21 +178,21 @@ QByteArray ByteStream::takeRead(int size, bool del) //! Returns \a size bytes from the start of the write buffer. //! If \a size is 0, then all available data will be returned. //! If \a del is TRUE, then the bytes are also removed. -QByteArray ByteStream::takeWrite(int size, bool del) +TQByteArray ByteStream::takeWrite(int size, bool del) { return takeArray(&d->writeBuf, size, del); } //! //! Returns a reference to the read buffer. -QByteArray & ByteStream::readBuf() +TQByteArray & ByteStream::readBuf() { return d->readBuf; } //! //! Returns a reference to the write buffer. -QByteArray & ByteStream::writeBuf() +TQByteArray & ByteStream::writeBuf() { return d->writeBuf; } @@ -207,7 +207,7 @@ int ByteStream::tryWrite() //! //! Append array \a b to the end of the array pointed to by \a a. -void ByteStream::appendArray(QByteArray *a, const QByteArray &b) +void ByteStream::appendArray(TQByteArray *a, const TQByteArray &b) { int oldsize = a->size(); a->resize(oldsize + b.size()); @@ -218,9 +218,9 @@ void ByteStream::appendArray(QByteArray *a, const QByteArray &b) //! Returns \a size bytes from the start of the array pointed to by \a from. //! If \a size is 0, then all available data will be returned. //! If \a del is TRUE, then the bytes are also removed. -QByteArray ByteStream::takeArray(QByteArray *from, int size, bool del) +TQByteArray ByteStream::takeArray(TQByteArray *from, int size, bool del) { - QByteArray a; + TQByteArray a; if(size == 0) { a = from->copy(); if(del) diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h index b90f109d..f10b46a1 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h @@ -21,8 +21,8 @@ #ifndef CS_BYTESTREAM_H #define CS_BYTESTREAM_H -#include<qobject.h> -#include<qcstring.h> +#include<tqobject.h> +#include<tqcstring.h> // CS_NAMESPACE_BEGIN @@ -32,20 +32,20 @@ class ByteStream : public QObject Q_OBJECT public: enum Error { ErrRead, ErrWrite, ErrCustom = 10 }; - ByteStream(QObject *parent=0); + ByteStream(TQObject *parent=0); virtual ~ByteStream()=0; virtual bool isOpen() const; virtual void close(); - virtual void write(const QByteArray &); - virtual QByteArray read(int bytes=0); + virtual void write(const TQByteArray &); + virtual TQByteArray read(int bytes=0); virtual int bytesAvailable() const; virtual int bytesToWrite() const; - void write(const QCString &); + void write(const TQCString &); - static void appendArray(QByteArray *a, const QByteArray &b); - static QByteArray takeArray(QByteArray *from, int size=0, bool del=true); + static void appendArray(TQByteArray *a, const TQByteArray &b); + static TQByteArray takeArray(TQByteArray *from, int size=0, bool del=true); signals: void connectionClosed(); @@ -57,12 +57,12 @@ signals: protected: void clearReadBuffer(); void clearWriteBuffer(); - void appendRead(const QByteArray &); - void appendWrite(const QByteArray &); - QByteArray takeRead(int size=0, bool del=true); - QByteArray takeWrite(int size=0, bool del=true); - QByteArray & readBuf(); - QByteArray & writeBuf(); + void appendRead(const TQByteArray &); + void appendWrite(const TQByteArray &); + TQByteArray takeRead(int size=0, bool del=true); + TQByteArray takeWrite(int size=0, bool del=true); + TQByteArray & readBuf(); + TQByteArray & writeBuf(); virtual int tryWrite(); private: diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp index f1581a6f..8f918dde 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp @@ -25,9 +25,9 @@ #include"bytestream.h" #include"qrandom.h" -static bool lib_encryptArray(const EVP_CIPHER *type, const QByteArray &buf, const QByteArray &key, const QByteArray &iv, bool pad, QByteArray *out) +static bool lib_encryptArray(const EVP_CIPHER *type, const TQByteArray &buf, const TQByteArray &key, const TQByteArray &iv, bool pad, TQByteArray *out) { - QByteArray result(buf.size()+type->block_size); + TQByteArray result(buf.size()+type->block_size); int len; EVP_CIPHER_CTX c; @@ -42,7 +42,7 @@ static bool lib_encryptArray(const EVP_CIPHER *type, const QByteArray &buf, cons return false; result.resize(len); if(pad) { - QByteArray last(type->block_size); + TQByteArray last(type->block_size); if(!EVP_EncryptFinal_ex(&c, (unsigned char *)last.data(), &len)) return false; last.resize(len); @@ -54,9 +54,9 @@ static bool lib_encryptArray(const EVP_CIPHER *type, const QByteArray &buf, cons return true; } -static bool lib_decryptArray(const EVP_CIPHER *type, const QByteArray &buf, const QByteArray &key, const QByteArray &iv, bool pad, QByteArray *out) +static bool lib_decryptArray(const EVP_CIPHER *type, const TQByteArray &buf, const TQByteArray &key, const TQByteArray &iv, bool pad, TQByteArray *out) { - QByteArray result(buf.size()+type->block_size); + TQByteArray result(buf.size()+type->block_size); int len; EVP_CIPHER_CTX c; @@ -77,7 +77,7 @@ static bool lib_decryptArray(const EVP_CIPHER *type, const QByteArray &buf, cons } result.resize(len); if(pad) { - QByteArray last(type->block_size); + TQByteArray last(type->block_size); if(!EVP_DecryptFinal_ex(&c, (unsigned char *)last.data(), &len)) return false; last.resize(len); @@ -89,9 +89,9 @@ static bool lib_decryptArray(const EVP_CIPHER *type, const QByteArray &buf, cons return true; } -static bool lib_generateKeyIV(const EVP_CIPHER *type, const QByteArray &data, const QByteArray &salt, QByteArray *key, QByteArray *iv) +static bool lib_generateKeyIV(const EVP_CIPHER *type, const TQByteArray &data, const TQByteArray &salt, TQByteArray *key, TQByteArray *iv) { - QByteArray k, i; + TQByteArray k, i; unsigned char *kp = 0; unsigned char *ip = 0; if(key) { @@ -129,7 +129,7 @@ Cipher::Key Cipher::generateKey(Type t) const EVP_CIPHER *type = typeToCIPHER(t); if(!type) return k; - QByteArray out; + TQByteArray out; if(!lib_generateKeyIV(type, QRandom::randomArray(128), QRandom::randomArray(2), &out, 0)) return k; k.setType(t); @@ -137,14 +137,14 @@ Cipher::Key Cipher::generateKey(Type t) return k; } -QByteArray Cipher::generateIV(Type t) +TQByteArray Cipher::generateIV(Type t) { const EVP_CIPHER *type = typeToCIPHER(t); if(!type) - return QByteArray(); - QByteArray out; - if(!lib_generateKeyIV(type, QCString("Get this man an iv!"), QByteArray(), 0, &out)) - return QByteArray(); + return TQByteArray(); + TQByteArray out; + if(!lib_generateKeyIV(type, TQCString("Get this man an iv!"), TQByteArray(), 0, &out)) + return TQByteArray(); return out; } @@ -156,32 +156,32 @@ int Cipher::ivSize(Type t) return type->iv_len; } -QByteArray Cipher::encrypt(const QByteArray &buf, const Key &key, const QByteArray &iv, bool pad, bool *ok) +TQByteArray Cipher::encrypt(const TQByteArray &buf, const Key &key, const TQByteArray &iv, bool pad, bool *ok) { if(ok) *ok = false; const EVP_CIPHER *type = typeToCIPHER(key.type()); if(!type) - return QByteArray(); - QByteArray out; + return TQByteArray(); + TQByteArray out; if(!lib_encryptArray(type, buf, key.data(), iv, pad, &out)) - return QByteArray(); + return TQByteArray(); if(ok) *ok = true; return out; } -QByteArray Cipher::decrypt(const QByteArray &buf, const Key &key, const QByteArray &iv, bool pad, bool *ok) +TQByteArray Cipher::decrypt(const TQByteArray &buf, const Key &key, const TQByteArray &iv, bool pad, bool *ok) { if(ok) *ok = false; const EVP_CIPHER *type = typeToCIPHER(key.type()); if(!type) - return QByteArray(); - QByteArray out; + return TQByteArray(); + TQByteArray out; if(!lib_decryptArray(type, buf, key.data(), iv, pad, &out)) - return QByteArray(); + return TQByteArray(); if(ok) *ok = true; @@ -272,7 +272,7 @@ RSAKey generateRSAKey() return key; } -QByteArray encryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok) +TQByteArray encryptRSA(const TQByteArray &buf, const RSAKey &key, bool *ok) { if(ok) *ok = false; @@ -281,12 +281,12 @@ QByteArray encryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok) int flen = buf.size(); if(flen >= size - 11) flen = size - 11; - QByteArray result(size); + TQByteArray result(size); unsigned char *from = (unsigned char *)buf.data(); unsigned char *to = (unsigned char *)result.data(); int r = RSA_public_encrypt(flen, from, to, (RSA *)key.data(), RSA_PKCS1_PADDING); if(r == -1) - return QByteArray(); + return TQByteArray(); result.resize(r); if(ok) @@ -294,19 +294,19 @@ QByteArray encryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok) return result; } -QByteArray decryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok) +TQByteArray decryptRSA(const TQByteArray &buf, const RSAKey &key, bool *ok) { if(ok) *ok = false; int size = RSA_size((RSA *)key.data()); int flen = buf.size(); - QByteArray result(size); + TQByteArray result(size); unsigned char *from = (unsigned char *)buf.data(); unsigned char *to = (unsigned char *)result.data(); int r = RSA_private_decrypt(flen, from, to, (RSA *)key.data(), RSA_PKCS1_PADDING); if(r == -1) - return QByteArray(); + return TQByteArray(); result.resize(r); if(ok) @@ -314,7 +314,7 @@ QByteArray decryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok) return result; } -QByteArray encryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok) +TQByteArray encryptRSA2(const TQByteArray &buf, const RSAKey &key, bool *ok) { if(ok) *ok = false; @@ -323,12 +323,12 @@ QByteArray encryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok) int flen = buf.size(); if(flen >= size - 41) flen = size - 41; - QByteArray result(size); + TQByteArray result(size); unsigned char *from = (unsigned char *)buf.data(); unsigned char *to = (unsigned char *)result.data(); int r = RSA_public_encrypt(flen, from, to, (RSA *)key.data(), RSA_PKCS1_OAEP_PADDING); if(r == -1) - return QByteArray(); + return TQByteArray(); result.resize(r); if(ok) @@ -336,19 +336,19 @@ QByteArray encryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok) return result; } -QByteArray decryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok) +TQByteArray decryptRSA2(const TQByteArray &buf, const RSAKey &key, bool *ok) { if(ok) *ok = false; int size = RSA_size((RSA *)key.data()); int flen = buf.size(); - QByteArray result(size); + TQByteArray result(size); unsigned char *from = (unsigned char *)buf.data(); unsigned char *to = (unsigned char *)result.data(); int r = RSA_private_decrypt(flen, from, to, (RSA *)key.data(), RSA_PKCS1_OAEP_PADDING); if(r == -1) - return QByteArray(); + return TQByteArray(); result.resize(r); if(ok) diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.h b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.h index 148deff8..02c7606c 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.h @@ -21,8 +21,8 @@ #ifndef CS_CIPHER_H #define CS_CIPHER_H -#include<qstring.h> -#include<qcstring.h> +#include<tqstring.h> +#include<tqcstring.h> namespace Cipher { @@ -36,19 +36,19 @@ namespace Cipher bool isValid() const { return (v_type == None ? false: true); } void setType(Type x) { v_type = x; } Type type() const { return v_type; } - void setData(const QByteArray &d) { v_data = d; } - const QByteArray & data() const { return v_data; } + void setData(const TQByteArray &d) { v_data = d; } + const TQByteArray & data() const { return v_data; } private: Type v_type; - QByteArray v_data; + TQByteArray v_data; }; Key generateKey(Type); - QByteArray generateIV(Type); + TQByteArray generateIV(Type); int ivSize(Type); - QByteArray encrypt(const QByteArray &, const Key &, const QByteArray &iv, bool pad, bool *ok=0); - QByteArray decrypt(const QByteArray &, const Key &, const QByteArray &iv, bool pad, bool *ok=0); + TQByteArray encrypt(const TQByteArray &, const Key &, const TQByteArray &iv, bool pad, bool *ok=0); + TQByteArray decrypt(const TQByteArray &, const Key &, const TQByteArray &iv, bool pad, bool *ok=0); } class RSAKey @@ -71,9 +71,9 @@ private: }; RSAKey generateRSAKey(); -QByteArray encryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok=0); -QByteArray decryptRSA(const QByteArray &buf, const RSAKey &key, bool *ok=0); -QByteArray encryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok=0); -QByteArray decryptRSA2(const QByteArray &buf, const RSAKey &key, bool *ok=0); +TQByteArray encryptRSA(const TQByteArray &buf, const RSAKey &key, bool *ok=0); +TQByteArray decryptRSA(const TQByteArray &buf, const RSAKey &key, bool *ok=0); +TQByteArray encryptRSA2(const TQByteArray &buf, const RSAKey &key, bool *ok=0); +TQByteArray decryptRSA2(const TQByteArray &buf, const RSAKey &key, bool *ok=0); #endif diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.cpp index 3becd7c5..9805de2f 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.cpp @@ -9,15 +9,15 @@ uchar QRandom::randomChar() uint QRandom::randomInt() { - QByteArray a = randomArray(sizeof(uint)); + TQByteArray a = randomArray(sizeof(uint)); uint x; memcpy(&x, a.data(), a.size()); return x; } -QByteArray QRandom::randomArray(uint size) +TQByteArray QRandom::randomArray(uint size) { - QByteArray a(size); + TQByteArray a(size); for(uint n = 0; n < size; ++n) a[n] = randomChar(); return a; diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h index 92339fb0..f04c7e0f 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h @@ -1,14 +1,14 @@ #ifndef CS_QRANDOM_H #define CS_QRANDOM_H -#include<qcstring.h> +#include<tqcstring.h> class QRandom { public: static uchar randomChar(); static uint randomInt(); - static QByteArray randomArray(uint size); + static TQByteArray randomArray(uint size); }; #endif diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp index 6bd012e9..12ed189b 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp @@ -1,6 +1,6 @@ #include"safedelete.h" -#include<qtimer.h> +#include<tqtimer.h> //---------------------------------------------------------------------------- // SafeDelete @@ -16,7 +16,7 @@ SafeDelete::~SafeDelete() lock->dying(); } -void SafeDelete::deleteLater(QObject *o) +void SafeDelete::deleteLater(TQObject *o) { if(!lock) deleteSingle(o); @@ -35,16 +35,16 @@ void SafeDelete::deleteAll() if(list.isEmpty()) return; - QObjectListIt it(list); - for(QObject *o; (o = it.current()); ++it) + TQObjectListIt it(list); + for(TQObject *o; (o = it.current()); ++it) deleteSingle(o); list.clear(); } -void SafeDelete::deleteSingle(QObject *o) +void SafeDelete::deleteSingle(TQObject *o) { #if QT_VERSION < 0x030000 - // roll our own QObject::deleteLater() + // roll our own TQObject::deleteLater() SafeDeleteLater *sdl = SafeDeleteLater::ensureExists(); sdl->deleteItLater(o); #else @@ -97,7 +97,7 @@ SafeDeleteLater::SafeDeleteLater() { list.setAutoDelete(true); self = this; - QTimer::singleShot(0, this, SLOT(explode())); + TQTimer::singleShot(0, this, TQT_SLOT(explode())); } SafeDeleteLater::~SafeDeleteLater() @@ -106,7 +106,7 @@ SafeDeleteLater::~SafeDeleteLater() self = 0; } -void SafeDeleteLater::deleteItLater(QObject *o) +void SafeDeleteLater::deleteItLater(TQObject *o) { list.append(o); } diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h index 078d36cd..add5af6b 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h @@ -1,8 +1,8 @@ #ifndef SAFEDELETE_H #define SAFEDELETE_H -#include<qobject.h> -#include<qobjectlist.h> +#include<tqobject.h> +#include<tqobjectlist.h> class SafeDelete; class SafeDeleteLock @@ -24,13 +24,13 @@ public: SafeDelete(); ~SafeDelete(); - void deleteLater(QObject *o); + void deleteLater(TQObject *o); - // same as QObject::deleteLater() - static void deleteSingle(QObject *o); + // same as TQObject::deleteLater() + static void deleteSingle(TQObject *o); private: - QObjectList list; + TQObjectList list; void deleteAll(); friend class SafeDeleteLock; @@ -43,7 +43,7 @@ class SafeDeleteLater : public QObject Q_OBJECT public: static SafeDeleteLater *ensureExists(); - void deleteItLater(QObject *o); + void deleteItLater(TQObject *o); private slots: void explode(); @@ -52,7 +52,7 @@ private: SafeDeleteLater(); ~SafeDeleteLater(); - QObjectList list; + TQObjectList list; friend class SafeDelete; static SafeDeleteLater *self; }; diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp index f4ad554f..a3195d89 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp @@ -161,10 +161,10 @@ void SHA1::final(unsigned char digest[20], SHA1_CONTEXT* context) memset(&finalcount, 0, 8); } -QByteArray SHA1::hash(const QByteArray &a) +TQByteArray SHA1::hash(const TQByteArray &a) { SHA1_CONTEXT context; - QByteArray b(20); + TQByteArray b(20); SHA1 s; s.init(&context); @@ -173,19 +173,19 @@ QByteArray SHA1::hash(const QByteArray &a) return b; } -QByteArray SHA1::hashString(const QCString &cs) +TQByteArray SHA1::hashString(const TQCString &cs) { - QByteArray a(cs.length()); + TQByteArray a(cs.length()); memcpy(a.data(), cs.data(), a.size()); return SHA1::hash(a); } -QString SHA1::digest(const QString &in) +TQString SHA1::digest(const TQString &in) { - QByteArray a = SHA1::hashString(in.utf8()); - QString out; + TQByteArray a = SHA1::hashString(in.utf8()); + TQString out; for(int n = 0; n < (int)a.size(); ++n) { - QString str; + TQString str; str.sprintf("%02x", (uchar)a[n]); out.append(str); } diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h index 797c3753..7f1a3f9e 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h @@ -21,16 +21,16 @@ #ifndef CS_SHA1_H #define CS_SHA1_H -#include<qstring.h> +#include<tqstring.h> // CS_NAMESPACE_BEGIN class SHA1 { public: - static QByteArray hash(const QByteArray &); - static QByteArray hashString(const QCString &); - static QString digest(const QString &); + static TQByteArray hash(const TQByteArray &); + static TQByteArray hashString(const TQCString &); + static TQString digest(const TQString &); private: SHA1(); diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp index fa446d58..0c8b46df 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp @@ -20,38 +20,38 @@ #include"showtextdlg.h" -#include<qlayout.h> -#include<qtextedit.h> -#include<qpushbutton.h> -#include<qfile.h> -#include<qtextstream.h> +#include<tqlayout.h> +#include<tqtextedit.h> +#include<tqpushbutton.h> +#include<tqfile.h> +#include<tqtextstream.h> -ShowTextDlg::ShowTextDlg(const QString &fname, bool rich, QWidget *parent, const char *name) -:QDialog(parent, name, FALSE, WDestructiveClose) +ShowTextDlg::ShowTextDlg(const TQString &fname, bool rich, TQWidget *parent, const char *name) +:TQDialog(parent, name, FALSE, WDestructiveClose) { - QString text; + TQString text; - QFile f(fname); + TQFile f(fname); if(f.open(IO_ReadOnly)) { - QTextStream t(&f); + TQTextStream t(&f); while(!t.eof()) text += t.readLine() + '\n'; f.close(); } - QVBoxLayout *vb1 = new QVBoxLayout(this, 8); - QTextEdit *te = new QTextEdit(this); + TQVBoxLayout *vb1 = new TQVBoxLayout(this, 8); + TQTextEdit *te = new TQTextEdit(this); te->setReadOnly(TRUE); - te->setTextFormat(rich ? QTextEdit::RichText : QTextEdit::PlainText); + te->setTextFormat(rich ? TQTextEdit::RichText : TQTextEdit::PlainText); te->setText(text); vb1->addWidget(te); - QHBoxLayout *hb1 = new QHBoxLayout(vb1); + TQHBoxLayout *hb1 = new TQHBoxLayout(vb1); hb1->addStretch(1); - QPushButton *pb = new QPushButton(tr("&OK"), this); - connect(pb, SIGNAL(clicked()), SLOT(accept())); + TQPushButton *pb = new TQPushButton(tr("&OK"), this); + connect(pb, TQT_SIGNAL(clicked()), TQT_SLOT(accept())); hb1->addWidget(pb); hb1->addStretch(1); diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h index 08c74c5d..3d92dd74 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h @@ -21,13 +21,13 @@ #ifndef CS_SHOWTEXTDLG_H #define CS_SHOWTEXTDLG_H -#include<qdialog.h> +#include<tqdialog.h> class ShowTextDlg : public QDialog { Q_OBJECT public: - ShowTextDlg(const QString &fname, bool rich=FALSE, QWidget *parent=0, const char *name=0); + ShowTextDlg(const TQString &fname, bool rich=FALSE, TQWidget *parent=0, const char *name=0); }; #endif |