summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/groupwise/libgroupwise/securestream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/groupwise/libgroupwise/securestream.cpp')
-rw-r--r--kopete/protocols/groupwise/libgroupwise/securestream.cpp108
1 files changed, 54 insertions, 54 deletions
diff --git a/kopete/protocols/groupwise/libgroupwise/securestream.cpp b/kopete/protocols/groupwise/libgroupwise/securestream.cpp
index 583be03e..6898c18e 100644
--- a/kopete/protocols/groupwise/libgroupwise/securestream.cpp
+++ b/kopete/protocols/groupwise/libgroupwise/securestream.cpp
@@ -26,9 +26,9 @@
but future layers might not.
*/
-#include<qguardedptr.h>
-#include<qvaluelist.h>
-#include<qtimer.h>
+#include<tqguardedptr.h>
+#include<tqvaluelist.h>
+#include<tqtimer.h>
#include"securestream.h"
@@ -66,7 +66,7 @@ void LayerTracker::specifyEncoded(int encoded, int plain)
int LayerTracker::finished(int encoded)
{
int plain = 0;
- for(QValueList<Item>::Iterator it = list.begin(); it != list.end();) {
+ for(TQValueList<Item>::Iterator it = list.begin(); it != list.end();) {
Item &i = *it;
// not enough?
@@ -91,11 +91,11 @@ SecureLayer::SecureLayer(QCA::TLS *t)
type = TLS;
p.tls = t;
init();
- connect(p.tls, SIGNAL(handshaken()), SLOT(tls_handshaken()));
- connect(p.tls, SIGNAL(readyRead()), SLOT(tls_readyRead()));
- connect(p.tls, SIGNAL(readyReadOutgoing(int)), SLOT(tls_readyReadOutgoing(int)));
- connect(p.tls, SIGNAL(closed()), SLOT(tls_closed()));
- connect(p.tls, SIGNAL(error(int)), SLOT(tls_error(int)));
+ connect(p.tls, TQT_SIGNAL(handshaken()), TQT_SLOT(tls_handshaken()));
+ connect(p.tls, TQT_SIGNAL(readyRead()), TQT_SLOT(tls_readyRead()));
+ connect(p.tls, TQT_SIGNAL(readyReadOutgoing(int)), TQT_SLOT(tls_readyReadOutgoing(int)));
+ connect(p.tls, TQT_SIGNAL(closed()), TQT_SLOT(tls_closed()));
+ connect(p.tls, TQT_SIGNAL(error(int)), TQT_SLOT(tls_error(int)));
}
SecureLayer::SecureLayer(QCA::SASL *s)
@@ -103,9 +103,9 @@ SecureLayer::SecureLayer(QCA::SASL *s)
type = SASL;
p.sasl = s;
init();
- connect(p.sasl, SIGNAL(readyRead()), SLOT(sasl_readyRead()));
- connect(p.sasl, SIGNAL(readyReadOutgoing(int)), SLOT(sasl_readyReadOutgoing(int)));
- connect(p.sasl, SIGNAL(error(int)), SLOT(sasl_error(int)));
+ connect(p.sasl, TQT_SIGNAL(readyRead()), TQT_SLOT(sasl_readyRead()));
+ connect(p.sasl, TQT_SIGNAL(readyReadOutgoing(int)), TQT_SLOT(sasl_readyReadOutgoing(int)));
+ connect(p.sasl, TQT_SIGNAL(error(int)), TQT_SLOT(sasl_error(int)));
}
#ifdef USE_TLSHANDLER
@@ -114,11 +114,11 @@ SecureLayer::SecureLayer(TLSHandler *t)
type = TLSH;
p.tlsHandler = t;
init();
- connect(p.tlsHandler, SIGNAL(success()), SLOT(tlsHandler_success()));
- connect(p.tlsHandler, SIGNAL(fail()), SLOT(tlsHandler_fail()));
- connect(p.tlsHandler, SIGNAL(closed()), SLOT(tlsHandler_closed()));
- connect(p.tlsHandler, SIGNAL(readyRead(const QByteArray &)), SLOT(tlsHandler_readyRead(const QByteArray &)));
- connect(p.tlsHandler, SIGNAL(readyReadOutgoing(const QByteArray &, int)), SLOT(tlsHandler_readyReadOutgoing(const QByteArray &, int)));
+ connect(p.tlsHandler, TQT_SIGNAL(success()), TQT_SLOT(tlsHandler_success()));
+ connect(p.tlsHandler, TQT_SIGNAL(fail()), TQT_SLOT(tlsHandler_fail()));
+ connect(p.tlsHandler, TQT_SIGNAL(closed()), TQT_SLOT(tlsHandler_closed()));
+ connect(p.tlsHandler, TQT_SIGNAL(readyRead(const TQByteArray &)), TQT_SLOT(tlsHandler_readyRead(const TQByteArray &)));
+ connect(p.tlsHandler, TQT_SIGNAL(readyReadOutgoing(const TQByteArray &, int)), TQT_SLOT(tlsHandler_readyReadOutgoing(const TQByteArray &, int)));
}
#endif
@@ -128,7 +128,7 @@ void SecureLayer::init()
prebytes = 0;
}
-void SecureLayer::write(const QByteArray &a)
+void SecureLayer::write(const TQByteArray &a)
{
layer.addPlain(a.size());
switch(type) {
@@ -140,7 +140,7 @@ void SecureLayer::write(const QByteArray &a)
}
}
-void SecureLayer::writeIncoming(const QByteArray &a)
+void SecureLayer::writeIncoming(const TQByteArray &a)
{
switch(type) {
case TLS: { p.tls->writeIncoming(a); break; }
@@ -184,13 +184,13 @@ void SecureLayer::tls_handshaken()
void SecureLayer::tls_readyRead()
{
- QByteArray a = p.tls->read();
+ TQByteArray a = p.tls->read();
readyRead(a);
}
void SecureLayer::tls_readyReadOutgoing(int plainBytes)
{
- QByteArray a = p.tls->readOutgoing();
+ TQByteArray a = p.tls->readOutgoing();
if(tls_done)
layer.specifyEncoded(a.size(), plainBytes);
needWrite(a);
@@ -198,7 +198,7 @@ void SecureLayer::tls_readyReadOutgoing(int plainBytes)
void SecureLayer::tls_closed()
{
- QByteArray a = p.tls->readUnprocessed();
+ TQByteArray a = p.tls->readUnprocessed();
tlsClosed(a);
}
@@ -209,13 +209,13 @@ void SecureLayer::tls_error(int x)
void SecureLayer::sasl_readyRead()
{
- QByteArray a = p.sasl->read();
+ TQByteArray a = p.sasl->read();
readyRead(a);
}
void SecureLayer::sasl_readyReadOutgoing(int plainBytes)
{
- QByteArray a = p.sasl->readOutgoing();
+ TQByteArray a = p.sasl->readOutgoing();
layer.specifyEncoded(a.size(), plainBytes);
needWrite(a);
}
@@ -239,15 +239,15 @@ void SecureLayer::tlsHandler_fail()
void SecureLayer::tlsHandler_closed()
{
- tlsClosed(QByteArray());
+ tlsClosed(TQByteArray());
}
-void SecureLayer::tlsHandler_readyRead(const QByteArray &a)
+void SecureLayer::tlsHandler_readyRead(const TQByteArray &a)
{
readyRead(a);
}
-void SecureLayer::tlsHandler_readyReadOutgoing(const QByteArray &a, int plainBytes)
+void SecureLayer::tlsHandler_readyReadOutgoing(const TQByteArray &a, int plainBytes)
{
if(tls_done)
layer.specifyEncoded(a.size(), plainBytes);
@@ -259,7 +259,7 @@ class SecureStream::Private
{
public:
ByteStream *bs;
- QPtrList<SecureLayer> layers;
+ TQPtrList<SecureLayer> layers;
int pending;
int errorCode;
bool active;
@@ -267,7 +267,7 @@ public:
bool haveTLS() const
{
- QPtrListIterator<SecureLayer> it(layers);
+ TQPtrListIterator<SecureLayer> it(layers);
for(SecureLayer *s; (s = it.current()); ++it) {
if(s->type == SecureLayer::TLS
#ifdef USE_TLSHANDLER
@@ -282,7 +282,7 @@ public:
bool haveSASL() const
{
- QPtrListIterator<SecureLayer> it(layers);
+ TQPtrListIterator<SecureLayer> it(layers);
for(SecureLayer *s; (s = it.current()); ++it) {
if(s->type == SecureLayer::SASL)
return true;
@@ -297,8 +297,8 @@ SecureStream::SecureStream(ByteStream *s)
d = new Private;
d->bs = s;
- connect(d->bs, SIGNAL(readyRead()), SLOT(bs_readyRead()));
- connect(d->bs, SIGNAL(bytesWritten(int)), SLOT(bs_bytesWritten(int)));
+ connect(d->bs, TQT_SIGNAL(readyRead()), TQT_SLOT(bs_readyRead()));
+ connect(d->bs, TQT_SIGNAL(bytesWritten(int)), TQT_SLOT(bs_bytesWritten(int)));
d->layers.setAutoDelete(true);
d->pending = 0;
@@ -311,25 +311,25 @@ SecureStream::~SecureStream()
delete d;
}
-void SecureStream::linkLayer(QObject *s)
+void SecureStream::linkLayer(TQObject *s)
{
- connect(s, SIGNAL(tlsHandshaken()), SLOT(layer_tlsHandshaken()));
- connect(s, SIGNAL(tlsClosed(const QByteArray &)), SLOT(layer_tlsClosed(const QByteArray &)));
- connect(s, SIGNAL(readyRead(const QByteArray &)), SLOT(layer_readyRead(const QByteArray &)));
- connect(s, SIGNAL(needWrite(const QByteArray &)), SLOT(layer_needWrite(const QByteArray &)));
- connect(s, SIGNAL(error(int)), SLOT(layer_error(int)));
+ connect(s, TQT_SIGNAL(tlsHandshaken()), TQT_SLOT(layer_tlsHandshaken()));
+ connect(s, TQT_SIGNAL(tlsClosed(const TQByteArray &)), TQT_SLOT(layer_tlsClosed(const TQByteArray &)));
+ connect(s, TQT_SIGNAL(readyRead(const TQByteArray &)), TQT_SLOT(layer_readyRead(const TQByteArray &)));
+ connect(s, TQT_SIGNAL(needWrite(const TQByteArray &)), TQT_SLOT(layer_needWrite(const TQByteArray &)));
+ connect(s, TQT_SIGNAL(error(int)), TQT_SLOT(layer_error(int)));
}
int SecureStream::calcPrebytes() const
{
int x = 0;
- QPtrListIterator<SecureLayer> it(d->layers);
+ TQPtrListIterator<SecureLayer> it(d->layers);
for(SecureLayer *s; (s = it.current()); ++it)
x += s->prebytes;
return (d->pending - x);
}
-void SecureStream::startTLSClient(QCA::TLS *t, const QByteArray &spare)
+void SecureStream::startTLSClient(QCA::TLS *t, const TQByteArray &spare)
{
if(!d->active || d->topInProgress || d->haveTLS())
return;
@@ -343,7 +343,7 @@ void SecureStream::startTLSClient(QCA::TLS *t, const QByteArray &spare)
insertData(spare);
}
-void SecureStream::startTLSServer(QCA::TLS *t, const QByteArray &spare)
+void SecureStream::startTLSServer(QCA::TLS *t, const TQByteArray &spare)
{
if(!d->active || d->topInProgress || d->haveTLS())
return;
@@ -357,7 +357,7 @@ void SecureStream::startTLSServer(QCA::TLS *t, const QByteArray &spare)
insertData(spare);
}
-void SecureStream::setLayerSASL(QCA::SASL *sasl, const QByteArray &spare)
+void SecureStream::setLayerSASL(QCA::SASL *sasl, const TQByteArray &spare)
{
if(!d->active || d->topInProgress || d->haveSASL())
return;
@@ -371,7 +371,7 @@ void SecureStream::setLayerSASL(QCA::SASL *sasl, const QByteArray &spare)
}
#ifdef USE_TLSHANDLER
-void SecureStream::startTLSClient(TLSHandler *t, const QString &server, const QByteArray &spare)
+void SecureStream::startTLSClient(TLSHandler *t, const TQString &server, const TQByteArray &spare)
{
if(!d->active || d->topInProgress || d->haveTLS())
return;
@@ -408,7 +408,7 @@ bool SecureStream::isOpen() const
return d->active;
}
-void SecureStream::write(const QByteArray &a)
+void SecureStream::write(const TQByteArray &a)
{
if(!isOpen())
return;
@@ -430,7 +430,7 @@ int SecureStream::bytesToWrite() const
void SecureStream::bs_readyRead()
{
- QByteArray a = d->bs->read();
+ TQByteArray a = d->bs->read();
// send to the first layer
SecureLayer *s = d->layers.getFirst();
@@ -442,7 +442,7 @@ void SecureStream::bs_readyRead()
void SecureStream::bs_bytesWritten(int bytes)
{
- QPtrListIterator<SecureLayer> it(d->layers);
+ TQPtrListIterator<SecureLayer> it(d->layers);
for(SecureLayer *s; (s = it.current()); ++it)
bytes = s->finished(bytes);
@@ -458,17 +458,17 @@ void SecureStream::layer_tlsHandshaken()
tlsHandshaken();
}
-void SecureStream::layer_tlsClosed(const QByteArray &)
+void SecureStream::layer_tlsClosed(const TQByteArray &)
{
d->active = false;
d->layers.clear();
tlsClosed();
}
-void SecureStream::layer_readyRead(const QByteArray &a)
+void SecureStream::layer_readyRead(const TQByteArray &a)
{
SecureLayer *s = (SecureLayer *)sender();
- QPtrListIterator<SecureLayer> it(d->layers);
+ TQPtrListIterator<SecureLayer> it(d->layers);
while(it.current() != s)
++it;
@@ -481,10 +481,10 @@ void SecureStream::layer_readyRead(const QByteArray &a)
incomingData(a);
}
-void SecureStream::layer_needWrite(const QByteArray &a)
+void SecureStream::layer_needWrite(const TQByteArray &a)
{
SecureLayer *s = (SecureLayer *)sender();
- QPtrListIterator<SecureLayer> it(d->layers);
+ TQPtrListIterator<SecureLayer> it(d->layers);
while(it.current() != s)
++it;
@@ -514,7 +514,7 @@ void SecureStream::layer_error(int x)
#endif
}
-void SecureStream::insertData(const QByteArray &a)
+void SecureStream::insertData(const TQByteArray &a)
{
if(!a.isEmpty()) {
SecureLayer *s = d->layers.getLast();
@@ -525,12 +525,12 @@ void SecureStream::insertData(const QByteArray &a)
}
}
-void SecureStream::writeRawData(const QByteArray &a)
+void SecureStream::writeRawData(const TQByteArray &a)
{
d->bs->write(a);
}
-void SecureStream::incomingData(const QByteArray &a)
+void SecureStream::incomingData(const TQByteArray &a)
{
appendRead(a);
//qDebug( "SecureStream::incomingData() got %i bytes ", a.size() );