diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/protocols/jabber/libiris/cutestuff/util | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/jabber/libiris/cutestuff/util')
11 files changed, 31 insertions, 34 deletions
diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp index 06df3f73..c9726d75 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/base64.cpp @@ -44,7 +44,7 @@ TQByteArray Base64::encode(const TQByteArray &s) { int i; int len = s.size(); - char tbl[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + char tbl[] = "ABCDEFGHIJKLMNOPTQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; int a, b, c; TQByteArray p((len+2)/3*4); @@ -146,7 +146,7 @@ TQString Base64::arrayToString(const TQByteArray &a) TQCString c; c.resize(b.size()+1); memcpy(c.data(), b.data(), b.size()); - return TQString::fromLatin1(c); + return TQString::tqfromLatin1(c); } //! diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp index e78c2f9a..76d4a799 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.cpp @@ -63,9 +63,9 @@ public: }; //! -//! Constructs a ByteStream object with parent \a parent. -ByteStream::ByteStream(TQObject *parent) -:TQObject(parent) +//! Constructs a ByteStream object with tqparent \a tqparent. +ByteStream::ByteStream(TQObject *tqparent) +:TQObject(tqparent) { d = new Private; } diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h index f10b46a1..5706fff6 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/bytestream.h @@ -27,12 +27,13 @@ // CS_NAMESPACE_BEGIN // CS_EXPORT_BEGIN -class ByteStream : public QObject +class ByteStream : public TQObject { Q_OBJECT + TQ_OBJECT public: enum Error { ErrRead, ErrWrite, ErrCustom = 10 }; - ByteStream(TQObject *parent=0); + ByteStream(TQObject *tqparent=0); virtual ~ByteStream()=0; virtual bool isOpen() const; diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp index 8f918dde..814b6e9d 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/cipher.cpp @@ -23,7 +23,7 @@ #include<openssl/evp.h> #include<openssl/rsa.h> #include"bytestream.h" -#include"qrandom.h" +#include"tqrandom.h" static bool lib_encryptArray(const EVP_CIPHER *type, const TQByteArray &buf, const TQByteArray &key, const TQByteArray &iv, bool pad, TQByteArray *out) { @@ -130,7 +130,7 @@ Cipher::Key Cipher::generateKey(Type t) if(!type) return k; TQByteArray out; - if(!lib_generateKeyIV(type, QRandom::randomArray(128), QRandom::randomArray(2), &out, 0)) + if(!lib_generateKeyIV(type, TQRandom::randomArray(128), TQRandom::randomArray(2), &out, 0)) return k; k.setType(t); k.setData(out); diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h index f04c7e0f..b877c1f2 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/qrandom.h @@ -1,5 +1,5 @@ -#ifndef CS_QRANDOM_H -#define CS_QRANDOM_H +#ifndef CS_TQRANDOM_H +#define CS_TQRANDOM_H #include<tqcstring.h> diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp index 12ed189b..8ba6272d 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.cpp @@ -43,13 +43,7 @@ void SafeDelete::deleteAll() void SafeDelete::deleteSingle(TQObject *o) { -#if QT_VERSION < 0x030000 - // roll our own TQObject::deleteLater() - SafeDeleteLater *sdl = SafeDeleteLater::ensureExists(); - sdl->deleteItLater(o); -#else o->deleteLater(); -#endif } //---------------------------------------------------------------------------- diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h index add5af6b..01c47a32 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/safedelete.h @@ -38,9 +38,10 @@ private: void unlock(); }; -class SafeDeleteLater : public QObject +class SafeDeleteLater : public TQObject { Q_OBJECT + TQ_OBJECT public: static SafeDeleteLater *ensureExists(); void deleteItLater(TQObject *o); diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp index a3195d89..f7b3c3a9 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.cpp @@ -44,7 +44,7 @@ SHA1::SHA1() qSysInfo(&wordSize, &bigEndian); } -unsigned long SHA1::blk0(Q_UINT32 i) +unsigned long SHA1::blk0(TQ_UINT32 i) { if(bigEndian) return block->l[i]; @@ -53,9 +53,9 @@ unsigned long SHA1::blk0(Q_UINT32 i) } // Hash a single 512-bit block. This is the core of the algorithm. -void SHA1::transform(Q_UINT32 state[5], unsigned char buffer[64]) +void SHA1::transform(TQ_UINT32 state[5], unsigned char buffer[64]) { - Q_UINT32 a, b, c, d, e; + TQ_UINT32 a, b, c, d, e; block = (CHAR64LONG16*)buffer; @@ -112,9 +112,9 @@ void SHA1::init(SHA1_CONTEXT* context) } // Run your data through this -void SHA1::update(SHA1_CONTEXT* context, unsigned char* data, Q_UINT32 len) +void SHA1::update(SHA1_CONTEXT* context, unsigned char* data, TQ_UINT32 len) { - Q_UINT32 i, j; + TQ_UINT32 i, j; j = (context->count[0] >> 3) & 63; if((context->count[0] += len << 3) < (len << 3)) @@ -137,7 +137,7 @@ void SHA1::update(SHA1_CONTEXT* context, unsigned char* data, Q_UINT32 len) // Add padding and return the message digest void SHA1::final(unsigned char digest[20], SHA1_CONTEXT* context) { - Q_UINT32 i, j; + TQ_UINT32 i, j; unsigned char finalcount[8]; for (i = 0; i < 8; i++) { diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h index 7f1a3f9e..093037d3 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/sha1.h @@ -37,22 +37,22 @@ private: struct SHA1_CONTEXT { - Q_UINT32 state[5]; - Q_UINT32 count[2]; + TQ_UINT32 state[5]; + TQ_UINT32 count[2]; unsigned char buffer[64]; }; typedef union { unsigned char c[64]; - Q_UINT32 l[16]; + TQ_UINT32 l[16]; } CHAR64LONG16; - void transform(Q_UINT32 state[5], unsigned char buffer[64]); + void transform(TQ_UINT32 state[5], unsigned char buffer[64]); void init(SHA1_CONTEXT* context); - void update(SHA1_CONTEXT* context, unsigned char* data, Q_UINT32 len); + void update(SHA1_CONTEXT* context, unsigned char* data, TQ_UINT32 len); void final(unsigned char digest[20], SHA1_CONTEXT* context); - unsigned long blk0(Q_UINT32 i); + unsigned long blk0(TQ_UINT32 i); bool bigEndian; CHAR64LONG16* block; diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp index 0c8b46df..2b9407ce 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp +++ b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.cpp @@ -27,8 +27,8 @@ #include<tqtextstream.h> -ShowTextDlg::ShowTextDlg(const TQString &fname, bool rich, TQWidget *parent, const char *name) -:TQDialog(parent, name, FALSE, WDestructiveClose) +ShowTextDlg::ShowTextDlg(const TQString &fname, bool rich, TQWidget *tqparent, const char *name) +:TQDialog(tqparent, name, FALSE, WDestructiveClose) { TQString text; diff --git a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h index 3d92dd74..408699f7 100644 --- a/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h +++ b/kopete/protocols/jabber/libiris/cutestuff/util/showtextdlg.h @@ -23,11 +23,12 @@ #include<tqdialog.h> -class ShowTextDlg : public QDialog +class ShowTextDlg : public TQDialog { Q_OBJECT + TQ_OBJECT public: - ShowTextDlg(const TQString &fname, bool rich=FALSE, TQWidget *parent=0, const char *name=0); + ShowTextDlg(const TQString &fname, bool rich=FALSE, TQWidget *tqparent=0, const char *name=0); }; #endif |