summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/libiris/iris/xmpp-core
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-core')
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp88
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp8
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp102
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/parser.cpp174
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/parser.h32
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp322
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.h132
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h92
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp116
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h24
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp122
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp298
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/td.h12
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp24
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.cpp108
-rw-r--r--kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.h54
16 files changed, 854 insertions, 854 deletions
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp
index 55b43c06..3ba5cb16 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp
@@ -31,12 +31,12 @@
#include"xmpp.h"
-#include<qguardedptr.h>
+#include<tqguardedptr.h>
#include<qca.h>
#include"safedelete.h"
#ifdef NO_NDNS
-#include<qdns.h>
+#include<tqdns.h>
#else
#include"ndns.h"
#endif
@@ -55,8 +55,8 @@ using namespace XMPP;
//----------------------------------------------------------------------------
// Connector
//----------------------------------------------------------------------------
-Connector::Connector(QObject *parent)
-:QObject(parent)
+Connector::Connector(TQObject *parent)
+:TQObject(parent)
{
setUseSSL(false);
setPeerAddressNone();
@@ -76,7 +76,7 @@ bool Connector::havePeerAddress() const
return haveaddr;
}
-QHostAddress Connector::peerAddress() const
+TQHostAddress Connector::peerAddress() const
{
return addr;
}
@@ -94,11 +94,11 @@ void Connector::setUseSSL(bool b)
void Connector::setPeerAddressNone()
{
haveaddr = false;
- addr = QHostAddress();
+ addr = TQHostAddress();
port = 0;
}
-void Connector::setPeerAddress(const QHostAddress &_addr, Q_UINT16 _port)
+void Connector::setPeerAddress(const TQHostAddress &_addr, Q_UINT16 _port)
{
haveaddr = true;
addr = _addr;
@@ -124,7 +124,7 @@ int AdvancedConnector::Proxy::type() const
return t;
}
-QString AdvancedConnector::Proxy::host() const
+TQString AdvancedConnector::Proxy::host() const
{
return v_host;
}
@@ -134,17 +134,17 @@ Q_UINT16 AdvancedConnector::Proxy::port() const
return v_port;
}
-QString AdvancedConnector::Proxy::url() const
+TQString AdvancedConnector::Proxy::url() const
{
return v_url;
}
-QString AdvancedConnector::Proxy::user() const
+TQString AdvancedConnector::Proxy::user() const
{
return v_user;
}
-QString AdvancedConnector::Proxy::pass() const
+TQString AdvancedConnector::Proxy::pass() const
{
return v_pass;
}
@@ -154,14 +154,14 @@ int AdvancedConnector::Proxy::pollInterval() const
return v_poll;
}
-void AdvancedConnector::Proxy::setHttpConnect(const QString &host, Q_UINT16 port)
+void AdvancedConnector::Proxy::setHttpConnect(const TQString &host, Q_UINT16 port)
{
t = HttpConnect;
v_host = host;
v_port = port;
}
-void AdvancedConnector::Proxy::setHttpPoll(const QString &host, Q_UINT16 port, const QString &url)
+void AdvancedConnector::Proxy::setHttpPoll(const TQString &host, Q_UINT16 port, const TQString &url)
{
t = HttpPoll;
v_host = host;
@@ -169,14 +169,14 @@ void AdvancedConnector::Proxy::setHttpPoll(const QString &host, Q_UINT16 port, c
v_url = url;
}
-void AdvancedConnector::Proxy::setSocks(const QString &host, Q_UINT16 port)
+void AdvancedConnector::Proxy::setSocks(const TQString &host, Q_UINT16 port)
{
t = Socks;
v_host = host;
v_port = port;
}
-void AdvancedConnector::Proxy::setUserPass(const QString &user, const QString &pass)
+void AdvancedConnector::Proxy::setUserPass(const TQString &user, const TQString &pass)
{
v_user = user;
v_pass = pass;
@@ -198,21 +198,21 @@ public:
int mode;
ByteStream *bs;
#ifdef NO_NDNS
- QDns *qdns;
+ TQDns *qdns;
#else
NDns dns;
#endif
SrvResolver srv;
- QString server;
- QString opt_host;
+ TQString server;
+ TQString opt_host;
int opt_port;
bool opt_probe, opt_ssl;
Proxy proxy;
- QString host;
+ TQString host;
int port;
- QValueList<QDns::Server> servers;
+ TQValueList<TQDns::Server> servers;
int errorCode;
bool multi, using_srv;
@@ -223,7 +223,7 @@ public:
SafeDelete sd;
};
-AdvancedConnector::AdvancedConnector(QObject *parent)
+AdvancedConnector::AdvancedConnector(TQObject *parent)
:Connector(parent)
{
d = new Private;
@@ -231,9 +231,9 @@ AdvancedConnector::AdvancedConnector(QObject *parent)
#ifdef NO_NDNS
d->qdns = 0;
#else
- connect(&d->dns, SIGNAL(resultsReady()), SLOT(dns_done()));
+ connect(&d->dns, TQT_SIGNAL(resultsReady()), TQT_SLOT(dns_done()));
#endif
- connect(&d->srv, SIGNAL(resultsReady()), SLOT(srv_done()));
+ connect(&d->srv, TQT_SIGNAL(resultsReady()), TQT_SLOT(srv_done()));
d->opt_probe = false;
d->opt_ssl = false;
cleanup();
@@ -285,7 +285,7 @@ void AdvancedConnector::setProxy(const Proxy &proxy)
d->proxy = proxy;
}
-void AdvancedConnector::setOptHostPort(const QString &host, Q_UINT16 _port)
+void AdvancedConnector::setOptHostPort(const TQString &host, Q_UINT16 _port)
{
if(d->mode != Idle)
return;
@@ -307,7 +307,7 @@ void AdvancedConnector::setOptSSL(bool b)
d->opt_ssl = b;
}
-void AdvancedConnector::connectToServer(const QString &server)
+void AdvancedConnector::connectToServer(const TQString &server)
{
if(d->mode != Idle)
return;
@@ -326,10 +326,10 @@ void AdvancedConnector::connectToServer(const QString &server)
HttpPoll *s = new HttpPoll;
d->bs = s;
- connect(s, SIGNAL(connected()), SLOT(bs_connected()));
- connect(s, SIGNAL(syncStarted()), SLOT(http_syncStarted()));
- connect(s, SIGNAL(syncFinished()), SLOT(http_syncFinished()));
- connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
+ connect(s, TQT_SIGNAL(connected()), TQT_SLOT(bs_connected()));
+ connect(s, TQT_SIGNAL(syncStarted()), TQT_SLOT(http_syncStarted()));
+ connect(s, TQT_SIGNAL(syncFinished()), TQT_SLOT(http_syncFinished()));
+ connect(s, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int)));
if(!d->proxy.user().isEmpty())
s->setAuth(d->proxy.user(), d->proxy.pass());
s->setPollInterval(d->proxy.pollInterval());
@@ -348,7 +348,7 @@ void AdvancedConnector::connectToServer(const QString &server)
else {
d->multi = true;
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
srvLookup(d->server);
if(!self)
return;
@@ -389,11 +389,11 @@ void AdvancedConnector::do_resolve()
#ifdef NO_NDNS
printf("resolving (aaaa=%d)\n", d->aaaa);
d->qdns = new QDns;
- connect(d->qdns, SIGNAL(resultsReady()), SLOT(dns_done()));
+ connect(d->qdns, TQT_SIGNAL(resultsReady()), TQT_SLOT(dns_done()));
if(d->aaaa)
- d->qdns->setRecordType(QDns::Aaaa); // IPv6
+ d->qdns->setRecordType(TQDns::Aaaa); // IPv6
else
- d->qdns->setRecordType(QDns::A); // IPv4
+ d->qdns->setRecordType(TQDns::A); // IPv4
d->qdns->setLabel(d->host);
#else
d->dns.resolve(d->host);
@@ -403,7 +403,7 @@ void AdvancedConnector::do_resolve()
void AdvancedConnector::dns_done()
{
bool failed = false;
- QHostAddress addr;
+ TQHostAddress addr;
#ifdef NO_NDNS
//if(!d->qdns)
@@ -416,7 +416,7 @@ void AdvancedConnector::dns_done()
//SafeDeleteLock s(&d->sd);
// grab the address list and destroy the qdns object
- QValueList<QHostAddress> list = d->qdns->addresses();
+ TQValueList<TQHostAddress> list = d->qdns->addresses();
d->qdns->disconnect(this);
d->qdns->deleteLater();
//d->sd.deleteLater(d->qdns);
@@ -438,7 +438,7 @@ void AdvancedConnector::dns_done()
if(d->dns.result() == 0)
failed = true;
else
- addr = QHostAddress(d->dns.result());
+ addr = TQHostAddress(d->dns.result());
#endif
if(failed) {
@@ -502,8 +502,8 @@ void AdvancedConnector::do_connect()
#endif
BSocket *s = new BSocket;
d->bs = s;
- connect(s, SIGNAL(connected()), SLOT(bs_connected()));
- connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
+ connect(s, TQT_SIGNAL(connected()), TQT_SLOT(bs_connected()));
+ connect(s, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int)));
s->connectToHost(d->host, d->port);
}
else if(t == Proxy::HttpConnect) {
@@ -512,8 +512,8 @@ void AdvancedConnector::do_connect()
#endif
HttpConnect *s = new HttpConnect;
d->bs = s;
- connect(s, SIGNAL(connected()), SLOT(bs_connected()));
- connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
+ connect(s, TQT_SIGNAL(connected()), TQT_SLOT(bs_connected()));
+ connect(s, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int)));
if(!d->proxy.user().isEmpty())
s->setAuth(d->proxy.user(), d->proxy.pass());
s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
@@ -524,8 +524,8 @@ void AdvancedConnector::do_connect()
#endif
SocksClient *s = new SocksClient;
d->bs = s;
- connect(s, SIGNAL(connected()), SLOT(bs_connected()));
- connect(s, SIGNAL(error(int)), SLOT(bs_error(int)));
+ connect(s, TQT_SIGNAL(connected()), TQT_SLOT(bs_connected()));
+ connect(s, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int)));
if(!d->proxy.user().isEmpty())
s->setAuth(d->proxy.user(), d->proxy.pass());
s->connectToHost(d->proxy.host(), d->proxy.port(), d->host, d->port);
@@ -545,7 +545,7 @@ void AdvancedConnector::tryNextSrv()
void AdvancedConnector::srv_done()
{
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
#ifdef XMPP_DEBUG
printf("srv_done1\n");
#endif
@@ -591,7 +591,7 @@ void AdvancedConnector::srv_done()
void AdvancedConnector::bs_connected()
{
if(d->proxy.type() == Proxy::None) {
- QHostAddress h = (static_cast<BSocket*>(d->bs))->peerAddress();
+ TQHostAddress h = (static_cast<BSocket*>(d->bs))->peerAddress();
int p = (static_cast<BSocket*>(d->bs))->peerPort();
setPeerAddress(h, p);
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp
index 3c0389b5..4c8307cb 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp
@@ -473,9 +473,9 @@ public:
sha1_update(&_context, (unsigned char *)in, (unsigned int)len);
}
- void final(QByteArray *out)
+ void final(TQByteArray *out)
{
- QByteArray b(20);
+ TQByteArray b(20);
sha1_final((unsigned char *)b.data(), &_context);
*out = b;
}
@@ -621,9 +621,9 @@ public:
md5_append(&md5, (const md5_byte_t *)in, len);
}
- void final(QByteArray *out)
+ void final(TQByteArray *out)
{
- QByteArray b(16);
+ TQByteArray b(16);
md5_finish(&md5, (md5_byte_t *)b.data());
*out = b;
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp
index 2a40f050..090cc9df 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp
@@ -20,7 +20,7 @@
#include"xmpp.h"
-#include<qdict.h>
+#include<tqdict.h>
#include<stringprep.h>
using namespace XMPP;
@@ -31,12 +31,12 @@ using namespace XMPP;
class StringPrepCache
{
public:
- static bool nameprep(const QString &in, int maxbytes, QString *out)
+ static bool nameprep(const TQString &in, int maxbytes, TQString *out)
{
if(in.isEmpty())
{
if(out)
- *out = QString();
+ *out = TQString();
return true;
}
@@ -52,7 +52,7 @@ public:
return true;
}
- QCString cs = in.utf8();
+ TQCString cs = in.utf8();
cs.resize(maxbytes);
if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_nameprep) != 0)
{
@@ -60,19 +60,19 @@ public:
return false;
}
- QString norm = QString::fromUtf8(cs);
+ TQString norm = TQString::fromUtf8(cs);
that->nameprep_table.insert(in, new Result(norm));
if(out)
*out = norm;
return true;
}
- static bool nodeprep(const QString &in, int maxbytes, QString *out)
+ static bool nodeprep(const TQString &in, int maxbytes, TQString *out)
{
if(in.isEmpty())
{
if(out)
- *out = QString();
+ *out = TQString();
return true;
}
@@ -88,7 +88,7 @@ public:
return true;
}
- QCString cs = in.utf8();
+ TQCString cs = in.utf8();
cs.resize(maxbytes);
if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_xmpp_nodeprep) != 0)
{
@@ -96,19 +96,19 @@ public:
return false;
}
- QString norm = QString::fromUtf8(cs);
+ TQString norm = TQString::fromUtf8(cs);
that->nodeprep_table.insert(in, new Result(norm));
if(out)
*out = norm;
return true;
}
- static bool resourceprep(const QString &in, int maxbytes, QString *out)
+ static bool resourceprep(const TQString &in, int maxbytes, TQString *out)
{
if(in.isEmpty())
{
if(out)
- *out = QString();
+ *out = TQString();
return true;
}
@@ -124,7 +124,7 @@ public:
return true;
}
- QCString cs = in.utf8();
+ TQCString cs = in.utf8();
cs.resize(maxbytes);
if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_xmpp_resourceprep) != 0)
{
@@ -132,7 +132,7 @@ public:
return false;
}
- QString norm = QString::fromUtf8(cs);
+ TQString norm = TQString::fromUtf8(cs);
that->resourceprep_table.insert(in, new Result(norm));
if(out)
*out = norm;
@@ -143,13 +143,13 @@ private:
class Result
{
public:
- QString *norm;
+ TQString *norm;
Result() : norm(0)
{
}
- Result(const QString &s) : norm(new QString(s))
+ Result(const TQString &s) : norm(new TQString(s))
{
}
@@ -159,9 +159,9 @@ private:
}
};
- QDict<Result> nameprep_table;
- QDict<Result> nodeprep_table;
- QDict<Result> resourceprep_table;
+ TQDict<Result> nameprep_table;
+ TQDict<Result> nodeprep_table;
+ TQDict<Result> resourceprep_table;
static StringPrepCache *instance;
@@ -194,17 +194,17 @@ Jid::~Jid()
{
}
-Jid::Jid(const QString &s)
+Jid::Jid(const TQString &s)
{
set(s);
}
Jid::Jid(const char *s)
{
- set(QString(s));
+ set(TQString(s));
}
-Jid & Jid::operator=(const QString &s)
+Jid & Jid::operator=(const TQString &s)
{
set(s);
return *this;
@@ -212,17 +212,17 @@ Jid & Jid::operator=(const QString &s)
Jid & Jid::operator=(const char *s)
{
- set(QString(s));
+ set(TQString(s));
return *this;
}
void Jid::reset()
{
- f = QString();
- b = QString();
- d = QString();
- n = QString();
- r = QString();
+ f = TQString();
+ b = TQString();
+ d = TQString();
+ n = TQString();
+ r = TQString();
valid = false;
}
@@ -244,10 +244,10 @@ void Jid::update()
valid = false;
}
-void Jid::set(const QString &s)
+void Jid::set(const TQString &s)
{
- QString rest, domain, node, resource;
- QString norm_domain, norm_node, norm_resource;
+ TQString rest, domain, node, resource;
+ TQString norm_domain, norm_node, norm_resource;
int x = s.find('/');
if(x != -1) {
rest = s.mid(0, x);
@@ -255,7 +255,7 @@ void Jid::set(const QString &s)
}
else {
rest = s;
- resource = QString();
+ resource = TQString();
}
if(!validResource(resource, &norm_resource)) {
reset();
@@ -268,7 +268,7 @@ void Jid::set(const QString &s)
domain = rest.mid(x+1);
}
else {
- node = QString();
+ node = TQString();
domain = rest;
}
if(!validDomain(domain, &norm_domain) || !validNode(node, &norm_node)) {
@@ -283,9 +283,9 @@ void Jid::set(const QString &s)
update();
}
-void Jid::set(const QString &domain, const QString &node, const QString &resource)
+void Jid::set(const TQString &domain, const TQString &node, const TQString &resource)
{
- QString norm_domain, norm_node, norm_resource;
+ TQString norm_domain, norm_node, norm_resource;
if(!validDomain(domain, &norm_domain) || !validNode(node, &norm_node) || !validResource(resource, &norm_resource)) {
reset();
return;
@@ -297,11 +297,11 @@ void Jid::set(const QString &domain, const QString &node, const QString &resourc
update();
}
-void Jid::setDomain(const QString &s)
+void Jid::setDomain(const TQString &s)
{
if(!valid)
return;
- QString norm;
+ TQString norm;
if(!validDomain(s, &norm)) {
reset();
return;
@@ -310,11 +310,11 @@ void Jid::setDomain(const QString &s)
update();
}
-void Jid::setNode(const QString &s)
+void Jid::setNode(const TQString &s)
{
if(!valid)
return;
- QString norm;
+ TQString norm;
if(!validNode(s, &norm)) {
reset();
return;
@@ -323,11 +323,11 @@ void Jid::setNode(const QString &s)
update();
}
-void Jid::setResource(const QString &s)
+void Jid::setResource(const TQString &s)
{
if(!valid)
return;
- QString norm;
+ TQString norm;
if(!validResource(s, &norm)) {
reset();
return;
@@ -336,14 +336,14 @@ void Jid::setResource(const QString &s)
update();
}
-Jid Jid::withNode(const QString &s) const
+Jid Jid::withNode(const TQString &s) const
{
Jid j = *this;
j.setNode(s);
return j;
}
-Jid Jid::withResource(const QString &s) const
+Jid Jid::withResource(const TQString &s) const
{
Jid j = *this;
j.setResource(s);
@@ -372,38 +372,38 @@ bool Jid::compare(const Jid &a, bool compareRes) const
return true;
}
-bool Jid::validDomain(const QString &s, QString *norm)
+bool Jid::validDomain(const TQString &s, TQString *norm)
{
- /*QCString cs = s.utf8();
+ /*TQCString cs = s.utf8();
cs.resize(1024);
if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_nameprep) != 0)
return false;
if(norm)
- *norm = QString::fromUtf8(cs);
+ *norm = TQString::fromUtf8(cs);
return true;*/
return StringPrepCache::nameprep(s, 1024, norm);
}
-bool Jid::validNode(const QString &s, QString *norm)
+bool Jid::validNode(const TQString &s, TQString *norm)
{
- /*QCString cs = s.utf8();
+ /*TQCString cs = s.utf8();
cs.resize(1024);
if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_xmpp_nodeprep) != 0)
return false;
if(norm)
- *norm = QString::fromUtf8(cs);
+ *norm = TQString::fromUtf8(cs);
return true;*/
return StringPrepCache::nodeprep(s, 1024, norm);
}
-bool Jid::validResource(const QString &s, QString *norm)
+bool Jid::validResource(const TQString &s, TQString *norm)
{
- /*QCString cs = s.utf8();
+ /*TQCString cs = s.utf8();
cs.resize(1024);
if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_xmpp_resourceprep) != 0)
return false;
if(norm)
- *norm = QString::fromUtf8(cs);
+ *norm = TQString::fromUtf8(cs);
return true;*/
return StringPrepCache::resourceprep(s, 1024, norm);
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.cpp
index 558a5fcd..2348c88e 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.cpp
@@ -24,12 +24,12 @@
For XMPP::Parser to be "perfect", some things must be solved/changed in the
Qt library:
- - Fix weird QDomElement::haveAttributeNS() bug (patch submitted to
+ - Fix weird TQDomElement::haveAttributeNS() bug (patch submitted to
Trolltech on Aug 31st, 2003).
- - Fix weird behavior in QXmlSimpleReader of reporting endElement() when
+ - Fix weird behavior in TQXmlSimpleReader of reporting endElement() when
the '/' character of a self-closing tag is reached, instead of when
the final '>' is reached.
- - Fix incremental parsing bugs in QXmlSimpleReader. At the moment, the
+ - Fix incremental parsing bugs in TQXmlSimpleReader. At the moment, the
only bug I've found is related to attribute parsing, but there might
be more (search for '###' in $QTDIR/src/xml/qxml.cpp).
@@ -38,10 +38,10 @@
- Deal with the <?xml?> processing instruction as an event type, so that we
can feed it back to the application properly. Right now it is completely
untrackable and is simply tacked into the first event's actualString. We
- can't easily do this because QXmlSimpleReader eats an extra byte beyond
+ can't easily do this because TQXmlSimpleReader eats an extra byte beyond
the processing instruction before reporting it.
- - Make QXmlInputSource capable of accepting data incrementally, to ensure
+ - Make TQXmlInputSource capable of accepting data incrementally, to ensure
proper text encoding detection and processing over a network. This is
technically not a bug, as we have our own subclass below to do it, but
it would be nice if Qt had this already.
@@ -49,8 +49,8 @@
#include"parser.h"
-#include<qtextcodec.h>
-#include<qptrlist.h>
+#include<tqtextcodec.h>
+#include<tqptrlist.h>
#include<string.h>
using namespace XMPP;
@@ -85,7 +85,7 @@ public:
paused = false;
mightChangeEncoding = true;
checkBad = true;
- last = QChar();
+ last = TQChar();
v_encoding = "";
resetLastData();
}
@@ -95,12 +95,12 @@ public:
last_string = "";
}
- QString lastString() const
+ TQString lastString() const
{
return last_string;
}
- void appendData(const QByteArray &a)
+ void appendData(const TQByteArray &a)
{
int oldsize = in.size();
in.resize(oldsize + a.size());
@@ -108,12 +108,12 @@ public:
processBuf();
}
- QChar lastRead()
+ TQChar lastRead()
{
return last;
}
- QChar next()
+ TQChar next()
{
if(paused)
return EndOfData;
@@ -123,14 +123,14 @@ public:
// NOTE: setting 'peek' to true allows the same char to be read again,
// however this still advances the internal byte processing.
- QChar readNext(bool peek=false)
+ TQChar readNext(bool peek=false)
{
- QChar c;
+ TQChar c;
if(mightChangeEncoding)
c = EndOfData;
else {
if(out.isEmpty()) {
- QString s;
+ TQString s;
if(!tryExtractPart(&s))
c = EndOfData;
else {
@@ -158,9 +158,9 @@ public:
return c;
}
- QByteArray unprocessed() const
+ TQByteArray unprocessed() const
{
- QByteArray a(in.size() - at);
+ TQByteArray a(in.size() - at);
memcpy(a.data(), in.data() + at, a.size());
return a;
}
@@ -175,21 +175,21 @@ public:
return paused;
}
- QString encoding() const
+ TQString encoding() const
{
return v_encoding;
}
private:
- QTextDecoder *dec;
- QByteArray in;
- QString out;
+ TQTextDecoder *dec;
+ TQByteArray in;
+ TQString out;
int at;
bool paused;
bool mightChangeEncoding;
- QChar last;
- QString v_encoding;
- QString last_string;
+ TQChar last;
+ TQString v_encoding;
+ TQString last_string;
bool checkBad;
void processBuf()
@@ -198,7 +198,7 @@ private:
printf("processing. size=%d, at=%d\n", in.size(), at);
#endif
if(!dec) {
- QTextCodec *codec = 0;
+ TQTextCodec *codec = 0;
uchar *p = (uchar *)in.data() + at;
int size = in.size() - at;
@@ -216,9 +216,9 @@ private:
}
}
if(utf16)
- codec = QTextCodec::codecForMib(1000); // UTF-16
+ codec = TQTextCodec::codecForMib(1000); // UTF-16
else
- codec = QTextCodec::codecForMib(106); // UTF-8
+ codec = TQTextCodec::codecForMib(106); // UTF-8
v_encoding = codec->name();
dec = codec->makeDecoder();
@@ -238,11 +238,11 @@ private:
int n2 = out.find('>', n);
if(n2 != -1) {
++n2;
- QString h = out.mid(n, n2-n);
- QString enc = processXmlHeader(h);
- QTextCodec *codec = 0;
+ TQString h = out.mid(n, n2-n);
+ TQString enc = processXmlHeader(h);
+ TQTextCodec *codec = 0;
if(!enc.isEmpty())
- codec = QTextCodec::codecForName(enc.latin1());
+ codec = TQTextCodec::codecForName(enc.latin1());
// changing codecs
if(codec) {
@@ -257,7 +257,7 @@ private:
break;
}
}
- QString s;
+ TQString s;
if(!tryExtractPart(&s))
break;
if(checkBad && checkForBadChars(s)) {
@@ -273,7 +273,7 @@ private:
}
}
- QString processXmlHeader(const QString &h)
+ TQString processXmlHeader(const TQString &h)
{
if(h.left(5) != "<?xml")
return "";
@@ -281,7 +281,7 @@ private:
int endPos = h.find(">");
int startPos = h.find("encoding");
if(startPos < endPos && startPos != -1) {
- QString encoding;
+ TQString encoding;
do {
startPos++;
if(startPos > endPos) {
@@ -302,13 +302,13 @@ private:
return "";
}
- bool tryExtractPart(QString *s)
+ bool tryExtractPart(TQString *s)
{
int size = in.size() - at;
if(size == 0)
return false;
uchar *p = (uchar *)in.data() + at;
- QString nextChars;
+ TQString nextChars;
while(1) {
nextChars = dec->toUnicode((const char *)p, 1);
++p;
@@ -333,7 +333,7 @@ private:
return true;
}
- bool checkForBadChars(const QString &s)
+ bool checkForBadChars(const TQString &s)
{
int len = s.find('<');
if(len == -1)
@@ -357,7 +357,7 @@ namespace XMPP
class ParserHandler : public QXmlDefaultHandler
{
public:
- ParserHandler(StreamInput *_in, QDomDocument *_doc)
+ ParserHandler(StreamInput *_in, TQDomDocument *_doc)
{
in = _in;
doc = _doc;
@@ -381,7 +381,7 @@ namespace XMPP
return true;
}
- bool startPrefixMapping(const QString &prefix, const QString &uri)
+ bool startPrefixMapping(const TQString &prefix, const TQString &uri)
{
if(depth == 0) {
nsnames += prefix;
@@ -390,14 +390,14 @@ namespace XMPP
return true;
}
- bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
+ bool startElement(const TQString &namespaceURI, const TQString &localName, const TQString &qName, const TQXmlAttributes &atts)
{
if(depth == 0) {
Parser::Event *e = new Parser::Event;
- QXmlAttributes a;
+ TQXmlAttributes a;
for(int n = 0; n < atts.length(); ++n) {
- QString uri = atts.uri(n);
- QString ln = atts.localName(n);
+ TQString uri = atts.uri(n);
+ TQString ln = atts.localName(n);
if(a.index(uri, ln) == -1)
a.append(atts.qName(n), uri, ln, atts.value(n));
}
@@ -411,10 +411,10 @@ namespace XMPP
in->pause(true);
}
else {
- QDomElement e = doc->createElementNS(namespaceURI, qName);
+ TQDomElement e = doc->createElementNS(namespaceURI, qName);
for(int n = 0; n < atts.length(); ++n) {
- QString uri = atts.uri(n);
- QString ln = atts.localName(n);
+ TQString uri = atts.uri(n);
+ TQString ln = atts.localName(n);
bool have;
if(!uri.isEmpty()) {
have = e.hasAttributeNS(uri, ln);
@@ -440,7 +440,7 @@ namespace XMPP
return true;
}
- bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
+ bool endElement(const TQString &namespaceURI, const TQString &localName, const TQString &qName)
{
--depth;
if(depth == 0) {
@@ -461,8 +461,8 @@ namespace XMPP
eventList.append(e);
in->pause(true);
- elem = QDomElement();
- current = QDomElement();
+ elem = TQDomElement();
+ current = TQDomElement();
}
else
current = current.parentNode().toElement();
@@ -474,22 +474,22 @@ namespace XMPP
return true;
}
- bool characters(const QString &str)
+ bool characters(const TQString &str)
{
if(depth >= 1) {
- QString content = str;
+ TQString content = str;
if(content.isEmpty())
return true;
if(!current.isNull()) {
- QDomText text = doc->createTextNode(content);
+ TQDomText text = doc->createTextNode(content);
current.appendChild(text);
}
}
return true;
}
- /*bool processingInstruction(const QString &target, const QString &data)
+ /*bool processingInstruction(const TQString &target, const TQString &data)
{
printf("Processing: [%s], [%s]\n", target.latin1(), data.latin1());
in->resetLastData();
@@ -498,22 +498,22 @@ namespace XMPP
void checkNeedMore()
{
- // Here we will work around QXmlSimpleReader strangeness and self-closing tags.
+ // Here we will work around TQXmlSimpleReader strangeness and self-closing tags.
// The problem is that endElement() is called when the '/' is read, not when
// the final '>' is read. This is a potential problem when obtaining unprocessed
// bytes from StreamInput after this event, as the '>' character will end up
// in the unprocessed chunk. To work around this, we need to advance StreamInput's
// internal byte processing, but not the xml character data. This way, the '>'
// will get processed and will no longer be in the unprocessed return, but
- // QXmlSimpleReader can still read it. To do this, we call StreamInput::readNext
+ // TQXmlSimpleReader can still read it. To do this, we call StreamInput::readNext
// with 'peek' mode.
- QChar c = in->readNext(true); // peek
- if(c == QXmlInputSource::EndOfData) {
+ TQChar c = in->readNext(true); // peek
+ if(c == TQXmlInputSource::EndOfData) {
needMore = true;
}
else {
// We'll assume the next char is a '>'. If it isn't, then
- // QXmlSimpleReader will deal with that problem on the next
+ // TQXmlSimpleReader will deal with that problem on the next
// parse. We don't need to take any action here.
needMore = false;
@@ -540,11 +540,11 @@ namespace XMPP
}
StreamInput *in;
- QDomDocument *doc;
+ TQDomDocument *doc;
int depth;
- QStringList nsnames, nsvalues;
- QDomElement elem, current;
- QPtrList<Parser::Event> eventList;
+ TQStringList nsnames, nsvalues;
+ TQDomElement elem, current;
+ TQPtrList<Parser::Event> eventList;
bool needMore;
};
}
@@ -557,11 +557,11 @@ class Parser::Event::Private
{
public:
int type;
- QString ns, ln, qn;
- QXmlAttributes a;
- QDomElement e;
- QString str;
- QStringList nsnames, nsvalues;
+ TQString ns, ln, qn;
+ TQXmlAttributes a;
+ TQDomElement e;
+ TQString str;
+ TQStringList nsnames, nsvalues;
};
Parser::Event::Event()
@@ -601,49 +601,49 @@ int Parser::Event::type() const
return d->type;
}
-QString Parser::Event::nsprefix(const QString &s) const
+TQString Parser::Event::nsprefix(const TQString &s) const
{
- QStringList::ConstIterator it = d->nsnames.begin();
- QStringList::ConstIterator it2 = d->nsvalues.begin();
+ TQStringList::ConstIterator it = d->nsnames.begin();
+ TQStringList::ConstIterator it2 = d->nsvalues.begin();
for(; it != d->nsnames.end(); ++it) {
if((*it) == s)
return (*it2);
++it2;
}
- return QString::null;
+ return TQString::null;
}
-QString Parser::Event::namespaceURI() const
+TQString Parser::Event::namespaceURI() const
{
return d->ns;
}
-QString Parser::Event::localName() const
+TQString Parser::Event::localName() const
{
return d->ln;
}
-QString Parser::Event::qName() const
+TQString Parser::Event::qName() const
{
return d->qn;
}
-QXmlAttributes Parser::Event::atts() const
+TQXmlAttributes Parser::Event::atts() const
{
return d->a;
}
-QString Parser::Event::actualString() const
+TQString Parser::Event::actualString() const
{
return d->str;
}
-QDomElement Parser::Event::element() const
+TQDomElement Parser::Event::element() const
{
return d->e;
}
-void Parser::Event::setDocumentOpen(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts, const QStringList &nsnames, const QStringList &nsvalues)
+void Parser::Event::setDocumentOpen(const TQString &namespaceURI, const TQString &localName, const TQString &qName, const TQXmlAttributes &atts, const TQStringList &nsnames, const TQStringList &nsvalues)
{
if(!d)
d = new Private;
@@ -656,7 +656,7 @@ void Parser::Event::setDocumentOpen(const QString &namespaceURI, const QString &
d->nsvalues = nsvalues;
}
-void Parser::Event::setDocumentClose(const QString &namespaceURI, const QString &localName, const QString &qName)
+void Parser::Event::setDocumentClose(const TQString &namespaceURI, const TQString &localName, const TQString &qName)
{
if(!d)
d = new Private;
@@ -666,7 +666,7 @@ void Parser::Event::setDocumentClose(const QString &namespaceURI, const QString
d->qn = qName;
}
-void Parser::Event::setElement(const QDomElement &elem)
+void Parser::Event::setElement(const TQDomElement &elem)
{
if(!d)
d = new Private;
@@ -681,7 +681,7 @@ void Parser::Event::setError()
d->type = Error;
}
-void Parser::Event::setActualString(const QString &str)
+void Parser::Event::setActualString(const TQString &str)
{
d->str = str;
}
@@ -727,10 +727,10 @@ public:
}
}
- QDomDocument *doc;
+ TQDomDocument *doc;
StreamInput *in;
ParserHandler *handler;
- QXmlSimpleReader *reader;
+ TQXmlSimpleReader *reader;
};
Parser::Parser()
@@ -740,7 +740,7 @@ Parser::Parser()
// check for evil bug in Qt <= 3.2.1
if(!qt_bug_check) {
qt_bug_check = true;
- QDomElement e = d->doc->createElementNS("someuri", "somename");
+ TQDomElement e = d->doc->createElementNS("someuri", "somename");
if(e.hasAttributeNS("someuri", "somename"))
qt_bug_have = true;
else
@@ -758,7 +758,7 @@ void Parser::reset()
d->reset();
}
-void Parser::appendData(const QByteArray &a)
+void Parser::appendData(const TQByteArray &a)
{
d->in->appendData(a);
@@ -787,12 +787,12 @@ Parser::Event Parser::readNext()
return e;
}
-QByteArray Parser::unprocessed() const
+TQByteArray Parser::unprocessed() const
{
return d->in->unprocessed();
}
-QString Parser::encoding() const
+TQString Parser::encoding() const
{
return d->in->encoding();
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.h
index b43be57e..b702ad55 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/parser.h
@@ -21,8 +21,8 @@
#ifndef PARSER_H
#define PARSER_H
-#include<qdom.h>
-#include<qxml.h>
+#include<tqdom.h>
+#include<tqxml.h>
namespace XMPP
{
@@ -45,26 +45,26 @@ namespace XMPP
int type() const;
// for document open
- QString nsprefix(const QString &s=QString::null) const;
+ TQString nsprefix(const TQString &s=TQString::null) const;
// for document open / close
- QString namespaceURI() const;
- QString localName() const;
- QString qName() const;
- QXmlAttributes atts() const;
+ TQString namespaceURI() const;
+ TQString localName() const;
+ TQString qName() const;
+ TQXmlAttributes atts() const;
// for element
- QDomElement element() const;
+ TQDomElement element() const;
// for any
- QString actualString() const;
+ TQString actualString() const;
// setup
- void setDocumentOpen(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts, const QStringList &nsnames, const QStringList &nsvalues);
- void setDocumentClose(const QString &namespaceURI, const QString &localName, const QString &qName);
- void setElement(const QDomElement &elem);
+ void setDocumentOpen(const TQString &namespaceURI, const TQString &localName, const TQString &qName, const TQXmlAttributes &atts, const TQStringList &nsnames, const TQStringList &nsvalues);
+ void setDocumentClose(const TQString &namespaceURI, const TQString &localName, const TQString &qName);
+ void setElement(const TQDomElement &elem);
void setError();
- void setActualString(const QString &);
+ void setActualString(const TQString &);
private:
class Private;
@@ -72,10 +72,10 @@ namespace XMPP
};
void reset();
- void appendData(const QByteArray &a);
+ void appendData(const TQByteArray &a);
Event readNext();
- QByteArray unprocessed() const;
- QString encoding() const;
+ TQByteArray unprocessed() const;
+ TQString encoding() const;
private:
class Private;
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp
index fd1e6cdc..76d3c781 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp
@@ -40,13 +40,13 @@ using namespace XMPP;
// This function prints out an array of bytes as latin characters, converting
// non-printable bytes into hex values as necessary. Useful for displaying
// QByteArrays for debugging purposes.
-static QString printArray(const QByteArray &a)
+static TQString printArray(const TQByteArray &a)
{
- QString s;
+ TQString s;
for(uint n = 0; n < a.size(); ++n) {
unsigned char c = (unsigned char)a[(int)n];
if(c < 32 || c >= 127) {
- QString str;
+ TQString str;
str.sprintf("[%02x]", c);
s += str;
}
@@ -59,13 +59,13 @@ static QString printArray(const QByteArray &a)
// firstChildElement
//
// Get an element's first child element
-static QDomElement firstChildElement(const QDomElement &e)
+static TQDomElement firstChildElement(const TQDomElement &e)
{
- for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) {
+ for(TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) {
if(n.isElement())
return n.toElement();
}
- return QDomElement();
+ return TQDomElement();
}
//----------------------------------------------------------------------------
@@ -159,30 +159,30 @@ void BasicProtocol::reset()
XmlProtocol::reset();
init();
- to = QString();
- from = QString();
- id = QString();
- lang = QString();
+ to = TQString();
+ from = TQString();
+ id = TQString();
+ lang = TQString();
version = Version(1,0);
- errText = QString();
- errAppSpec = QDomElement();
- otherHost = QString();
+ errText = TQString();
+ errAppSpec = TQDomElement();
+ otherHost = TQString();
spare.resize(0);
- sasl_mech = QString();
+ sasl_mech = TQString();
sasl_mechlist.clear();
sasl_step.resize(0);
- stanzaToRecv = QDomElement();
+ stanzaToRecv = TQDomElement();
sendList.clear();
}
-void BasicProtocol::sendStanza(const QDomElement &e)
+void BasicProtocol::sendStanza(const TQDomElement &e)
{
SendItem i;
i.stanzaToSend = e;
sendList += i;
}
-void BasicProtocol::sendDirect(const QString &s)
+void BasicProtocol::sendDirect(const TQString &s)
{
SendItem i;
i.stringToSend = s;
@@ -196,10 +196,10 @@ void BasicProtocol::sendWhitespace()
sendList += i;
}
-QDomElement BasicProtocol::recvStanza()
+TQDomElement BasicProtocol::recvStanza()
{
- QDomElement e = stanzaToRecv;
- stanzaToRecv = QDomElement();
+ TQDomElement e = stanzaToRecv;
+ stanzaToRecv = TQDomElement();
return e;
}
@@ -208,7 +208,7 @@ void BasicProtocol::shutdown()
doShutdown = true;
}
-void BasicProtocol::shutdownWithError(int cond, const QString &str)
+void BasicProtocol::shutdownWithError(int cond, const TQString &str)
{
otherHost = str;
delayErrorAndClose(cond);
@@ -224,28 +224,28 @@ void BasicProtocol::setReady(bool b)
ready = b;
}
-QString BasicProtocol::saslMech() const
+TQString BasicProtocol::saslMech() const
{
return sasl_mech;
}
-QByteArray BasicProtocol::saslStep() const
+TQByteArray BasicProtocol::saslStep() const
{
return sasl_step;
}
-void BasicProtocol::setSASLMechList(const QStringList &list)
+void BasicProtocol::setSASLMechList(const TQStringList &list)
{
sasl_mechlist = list;
}
-void BasicProtocol::setSASLFirst(const QString &mech, const QByteArray &step)
+void BasicProtocol::setSASLFirst(const TQString &mech, const TQByteArray &step)
{
sasl_mech = mech;
sasl_step = step;
}
-void BasicProtocol::setSASLNext(const QByteArray &step)
+void BasicProtocol::setSASLNext(const TQByteArray &step)
{
sasl_step = step;
}
@@ -255,7 +255,7 @@ void BasicProtocol::setSASLAuthed()
sasl_authed = true;
}
-int BasicProtocol::stringToSASLCond(const QString &s)
+int BasicProtocol::stringToSASLCond(const TQString &s)
{
for(int n = 0; saslCondTable[n].str; ++n) {
if(s == saslCondTable[n].str)
@@ -264,7 +264,7 @@ int BasicProtocol::stringToSASLCond(const QString &s)
return -1;
}
-int BasicProtocol::stringToStreamCond(const QString &s)
+int BasicProtocol::stringToStreamCond(const TQString &s)
{
for(int n = 0; streamCondTable[n].str; ++n) {
if(s == streamCondTable[n].str)
@@ -273,30 +273,30 @@ int BasicProtocol::stringToStreamCond(const QString &s)
return -1;
}
-QString BasicProtocol::saslCondToString(int x)
+TQString BasicProtocol::saslCondToString(int x)
{
for(int n = 0; saslCondTable[n].str; ++n) {
if(x == saslCondTable[n].cond)
return saslCondTable[n].str;
}
- return QString();
+ return TQString();
}
-QString BasicProtocol::streamCondToString(int x)
+TQString BasicProtocol::streamCondToString(int x)
{
for(int n = 0; streamCondTable[n].str; ++n) {
if(x == streamCondTable[n].cond)
return streamCondTable[n].str;
}
- return QString();
+ return TQString();
}
-void BasicProtocol::extractStreamError(const QDomElement &e)
+void BasicProtocol::extractStreamError(const TQDomElement &e)
{
- QString text;
- QDomElement appSpec;
+ TQString text;
+ TQDomElement appSpec;
- QDomElement t = firstChildElement(e);
+ TQDomElement t = firstChildElement(e);
if(t.isNull() || t.namespaceURI() != NS_STREAMS) {
// probably old-style error
errCond = -1;
@@ -314,9 +314,9 @@ void BasicProtocol::extractStreamError(const QDomElement &e)
text = t.text();
// find first non-standard namespaced element
- QDomNodeList nl = e.childNodes();
+ TQDomNodeList nl = e.childNodes();
for(uint n = 0; n < nl.count(); ++n) {
- QDomNode i = nl.item(n);
+ TQDomNode i = nl.item(n);
if(i.isElement() && i.namespaceURI() != NS_STREAMS) {
appSpec = i.toElement();
break;
@@ -328,20 +328,20 @@ void BasicProtocol::extractStreamError(const QDomElement &e)
}
}
-void BasicProtocol::send(const QDomElement &e, bool clip)
+void BasicProtocol::send(const TQDomElement &e, bool clip)
{
writeElement(e, TypeElement, false, clip);
}
-void BasicProtocol::sendStreamError(int cond, const QString &text, const QDomElement &appSpec)
+void BasicProtocol::sendStreamError(int cond, const TQString &text, const TQDomElement &appSpec)
{
- QDomElement se = doc.createElementNS(NS_ETHERX, "stream:error");
- QDomElement err = doc.createElementNS(NS_STREAMS, streamCondToString(cond));
+ TQDomElement se = doc.createElementNS(NS_ETHERX, "stream:error");
+ TQDomElement err = doc.createElementNS(NS_STREAMS, streamCondToString(cond));
if(!otherHost.isEmpty())
err.appendChild(doc.createTextNode(otherHost));
se.appendChild(err);
if(!text.isEmpty()) {
- QDomElement te = doc.createElementNS(NS_STREAMS, "text");
+ TQDomElement te = doc.createElementNS(NS_STREAMS, "text");
te.setAttributeNS(NS_XML, "xml:lang", "en");
te.appendChild(doc.createTextNode(text));
se.appendChild(te);
@@ -351,15 +351,15 @@ void BasicProtocol::sendStreamError(int cond, const QString &text, const QDomEle
writeElement(se, 100, false);
}
-void BasicProtocol::sendStreamError(const QString &text)
+void BasicProtocol::sendStreamError(const TQString &text)
{
- QDomElement se = doc.createElementNS(NS_ETHERX, "stream:error");
+ TQDomElement se = doc.createElementNS(NS_ETHERX, "stream:error");
se.appendChild(doc.createTextNode(text));
writeElement(se, 100, false);
}
-bool BasicProtocol::errorAndClose(int cond, const QString &text, const QDomElement &appSpec)
+bool BasicProtocol::errorAndClose(int cond, const TQString &text, const TQDomElement &appSpec)
{
closeError = true;
errCond = cond;
@@ -376,7 +376,7 @@ bool BasicProtocol::error(int code)
return true;
}
-void BasicProtocol::delayErrorAndClose(int cond, const QString &text, const QDomElement &appSpec)
+void BasicProtocol::delayErrorAndClose(int cond, const TQString &text, const TQDomElement &appSpec)
{
errorCode = ErrStream;
errCond = cond;
@@ -391,21 +391,21 @@ void BasicProtocol::delayError(int code)
delayedError = true;
}
-QDomElement BasicProtocol::docElement()
+TQDomElement BasicProtocol::docElement()
{
// create the root element
- QDomElement e = doc.createElementNS(NS_ETHERX, "stream:stream");
+ TQDomElement e = doc.createElementNS(NS_ETHERX, "stream:stream");
- QString defns = defaultNamespace();
- QStringList list = extraNamespaces();
+ TQString defns = defaultNamespace();
+ TQStringList list = extraNamespaces();
// HACK: using attributes seems to be the only way to get additional namespaces in here
if(!defns.isEmpty())
e.setAttribute("xmlns", defns);
- for(QStringList::ConstIterator it = list.begin(); it != list.end();) {
- QString prefix = *(it++);
- QString uri = *(it++);
- e.setAttribute(QString("xmlns:") + prefix, uri);
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end();) {
+ TQString prefix = *(it++);
+ TQString uri = *(it++);
+ e.setAttribute(TQString("xmlns:") + prefix, uri);
}
// additional attributes
@@ -418,7 +418,7 @@ QDomElement BasicProtocol::docElement()
if(!lang.isEmpty())
e.setAttributeNS(NS_XML, "xml:lang", lang);
if(version.major > 0 || version.minor > 0)
- e.setAttribute("version", QString::number(version.major) + '.' + QString::number(version.minor));
+ e.setAttribute("version", TQString::number(version.major) + '.' + TQString::number(version.minor));
return e;
}
@@ -433,12 +433,12 @@ void BasicProtocol::handleDocOpen(const Parser::Event &pe)
}
if(pe.namespaceURI() == NS_ETHERX && pe.localName() == "stream") {
- QXmlAttributes atts = pe.atts();
+ TQXmlAttributes atts = pe.atts();
// grab the version
int major = 0;
int minor = 0;
- QString verstr = atts.value("version");
+ TQString verstr = atts.value("version");
if(!verstr.isEmpty()) {
int n = verstr.find('.');
if(n != -1) {
@@ -454,7 +454,7 @@ void BasicProtocol::handleDocOpen(const Parser::Event &pe)
if(isIncoming()) {
to = atts.value("to");
- QString peerLang = atts.value(NS_XML, "lang");
+ TQString peerLang = atts.value(NS_XML, "lang");
if(!peerLang.isEmpty())
lang = peerLang;
}
@@ -495,7 +495,7 @@ bool BasicProtocol::handleCloseFinished()
return true;
}
-bool BasicProtocol::doStep(const QDomElement &e)
+bool BasicProtocol::doStep(const TQDomElement &e)
{
// handle pending error
if(delayedError) {
@@ -530,7 +530,7 @@ bool BasicProtocol::doStep(const QDomElement &e)
if(!sendList.isEmpty()) {
SendItem i;
{
- QValueList<SendItem>::Iterator it = sendList.begin();
+ TQValueList<SendItem>::Iterator it = sendList.begin();
i = (*it);
sendList.remove(it);
}
@@ -571,16 +571,16 @@ void BasicProtocol::itemWritten(int id, int)
}
}
-QString BasicProtocol::defaultNamespace()
+TQString BasicProtocol::defaultNamespace()
{
// default none
- return QString();
+ return TQString();
}
-QStringList BasicProtocol::extraNamespaces()
+TQStringList BasicProtocol::extraNamespaces()
{
// default none
- return QStringList();
+ return TQStringList();
}
void BasicProtocol::handleStreamOpen(const Parser::Event &)
@@ -612,7 +612,7 @@ void CoreProtocol::init()
// settings
jid = Jid();
- password = QString();
+ password = TQString();
oldOnly = false;
allowPlain = false;
doTLS = true;
@@ -620,8 +620,8 @@ void CoreProtocol::init()
doBinding = true;
// input
- user = QString();
- host = QString();
+ user = TQString();
+ host = TQString();
// status
old = false;
@@ -649,14 +649,14 @@ void CoreProtocol::startClientOut(const Jid &_jid, bool _oldOnly, bool tlsActive
startConnect();
}
-void CoreProtocol::startServerOut(const QString &_to)
+void CoreProtocol::startServerOut(const TQString &_to)
{
server = true;
to = _to;
startConnect();
}
-void CoreProtocol::startDialbackOut(const QString &_to, const QString &_from)
+void CoreProtocol::startDialbackOut(const TQString &_to, const TQString &_from)
{
server = true;
dialback = true;
@@ -665,7 +665,7 @@ void CoreProtocol::startDialbackOut(const QString &_to, const QString &_from)
startConnect();
}
-void CoreProtocol::startDialbackVerifyOut(const QString &_to, const QString &_from, const QString &id, const QString &key)
+void CoreProtocol::startDialbackVerifyOut(const TQString &_to, const TQString &_from, const TQString &id, const TQString &key)
{
server = true;
dialback = true;
@@ -677,20 +677,20 @@ void CoreProtocol::startDialbackVerifyOut(const QString &_to, const QString &_fr
startConnect();
}
-void CoreProtocol::startClientIn(const QString &_id)
+void CoreProtocol::startClientIn(const TQString &_id)
{
id = _id;
startAccept();
}
-void CoreProtocol::startServerIn(const QString &_id)
+void CoreProtocol::startServerIn(const TQString &_id)
{
server = true;
id = _id;
startAccept();
}
-void CoreProtocol::setLang(const QString &s)
+void CoreProtocol::setLang(const TQString &s)
{
lang = s;
}
@@ -710,17 +710,17 @@ void CoreProtocol::setAllowPlain(bool b)
allowPlain = b;
}
-void CoreProtocol::setPassword(const QString &s)
+void CoreProtocol::setPassword(const TQString &s)
{
password = s;
}
-void CoreProtocol::setFrom(const QString &s)
+void CoreProtocol::setFrom(const TQString &s)
{
from = s;
}
-void CoreProtocol::setDialbackKey(const QString &s)
+void CoreProtocol::setDialbackKey(const TQString &s)
{
dialback_key = s;
}
@@ -734,18 +734,18 @@ bool CoreProtocol::loginComplete()
return true;
}
-int CoreProtocol::getOldErrorCode(const QDomElement &e)
+int CoreProtocol::getOldErrorCode(const TQDomElement &e)
{
- QDomElement err = e.elementsByTagNameNS(NS_CLIENT, "error").item(0).toElement();
+ TQDomElement err = e.elementsByTagNameNS(NS_CLIENT, "error").item(0).toElement();
if(err.isNull() || !err.hasAttribute("code"))
return -1;
return err.attribute("code").toInt();
}
-/*QString CoreProtocol::xmlToString(const QDomElement &e, bool clip)
+/*TQString CoreProtocol::xmlToString(const TQDomElement &e, bool clip)
{
// determine an appropriate 'fakeNS' to use
- QString ns;
+ TQString ns;
if(e.prefix() == "stream")
ns = NS_ETHERX;
else if(e.prefix() == "db")
@@ -781,21 +781,21 @@ bool CoreProtocol::stepRequiresElement() const
return false;
}
-void CoreProtocol::stringSend(const QString &s)
+void CoreProtocol::stringSend(const TQString &s)
{
#ifdef XMPP_TEST
TD::outgoingTag(s);
#endif
}
-void CoreProtocol::stringRecv(const QString &s)
+void CoreProtocol::stringRecv(const TQString &s)
{
#ifdef XMPP_TEST
TD::incomingTag(s);
#endif
}
-QString CoreProtocol::defaultNamespace()
+TQString CoreProtocol::defaultNamespace()
{
if(server)
return NS_SERVER;
@@ -803,9 +803,9 @@ QString CoreProtocol::defaultNamespace()
return NS_CLIENT;
}
-QStringList CoreProtocol::extraNamespaces()
+TQStringList CoreProtocol::extraNamespaces()
{
- QStringList list;
+ TQStringList list;
if(dialback) {
list += "db";
list += NS_DIALBACK;
@@ -816,8 +816,8 @@ QStringList CoreProtocol::extraNamespaces()
void CoreProtocol::handleStreamOpen(const Parser::Event &pe)
{
if(isIncoming()) {
- QString ns = pe.nsprefix();
- QString db;
+ TQString ns = pe.nsprefix();
+ TQString db;
if(server) {
db = pe.nsprefix("db");
if(!db.isEmpty())
@@ -846,21 +846,21 @@ void CoreProtocol::handleStreamOpen(const Parser::Event &pe)
}
}
-void CoreProtocol::elementSend(const QDomElement &e)
+void CoreProtocol::elementSend(const TQDomElement &e)
{
#ifdef XMPP_TEST
TD::outgoingXml(e);
#endif
}
-void CoreProtocol::elementRecv(const QDomElement &e)
+void CoreProtocol::elementRecv(const TQDomElement &e)
{
#ifdef XMPP_TEST
TD::incomingXml(e);
#endif
}
-bool CoreProtocol::doStep2(const QDomElement &e)
+bool CoreProtocol::doStep2(const TQDomElement &e)
{
if(dialback)
return dialbackStep(e);
@@ -868,9 +868,9 @@ bool CoreProtocol::doStep2(const QDomElement &e)
return normalStep(e);
}
-bool CoreProtocol::isValidStanza(const QDomElement &e) const
+bool CoreProtocol::isValidStanza(const TQDomElement &e) const
{
- QString s = e.tagName();
+ TQString s = e.tagName();
if(e.namespaceURI() == (server ? NS_SERVER : NS_CLIENT) && (s == "message" || s == "presence" || s == "iq"))
return true;
else
@@ -879,7 +879,7 @@ bool CoreProtocol::isValidStanza(const QDomElement &e) const
bool CoreProtocol::grabPendingItem(const Jid &to, const Jid &from, int type, DBItem *item)
{
- for(QValueList<DBItem>::Iterator it = dbpending.begin(); it != dbpending.end(); ++it) {
+ for(TQValueList<DBItem>::Iterator it = dbpending.begin(); it != dbpending.end(); ++it) {
const DBItem &i = *it;
if(i.type == type && i.to.compare(to) && i.from.compare(from)) {
const DBItem &i = (*it);
@@ -891,7 +891,7 @@ bool CoreProtocol::grabPendingItem(const Jid &to, const Jid &from, int type, DBI
return false;
}
-bool CoreProtocol::dialbackStep(const QDomElement &e)
+bool CoreProtocol::dialbackStep(const TQDomElement &e)
{
if(step == Start) {
setReady(true);
@@ -904,12 +904,12 @@ bool CoreProtocol::dialbackStep(const QDomElement &e)
// process a request
DBItem i;
{
- QValueList<DBItem>::Iterator it = dbrequests.begin();
+ TQValueList<DBItem>::Iterator it = dbrequests.begin();
i = (*it);
dbrequests.remove(it);
}
- QDomElement r;
+ TQDomElement r;
if(i.type == DBItem::ResultRequest) {
r = doc.createElementNS(NS_DIALBACK, "db:result");
r.setAttribute("to", i.to.full());
@@ -959,7 +959,7 @@ bool CoreProtocol::dialbackStep(const QDomElement &e)
to.set(e.attribute("to"), "");
from.set(e.attribute("from"), "");
if(isIncoming()) {
- QString key = e.text();
+ TQString key = e.text();
// TODO: report event
}
else {
@@ -982,9 +982,9 @@ bool CoreProtocol::dialbackStep(const QDomElement &e)
Jid to, from;
to.set(e.attribute("to"), "");
from.set(e.attribute("from"), "");
- QString id = e.attribute("id");
+ TQString id = e.attribute("id");
if(isIncoming()) {
- QString key = e.text();
+ TQString key = e.text();
// TODO: report event
}
else {
@@ -1019,7 +1019,7 @@ bool CoreProtocol::dialbackStep(const QDomElement &e)
return false;
}
-bool CoreProtocol::normalStep(const QDomElement &e)
+bool CoreProtocol::normalStep(const TQDomElement &e)
{
if(step == Start) {
if(isIncoming()) {
@@ -1043,7 +1043,7 @@ bool CoreProtocol::normalStep(const QDomElement &e)
else if(step == HandleFeatures) {
// deal with TLS?
if(doTLS && !tls_started && !sasl_authed && features.tls_supported) {
- QDomElement e = doc.createElementNS(NS_TLS, "starttls");
+ TQDomElement e = doc.createElementNS(NS_TLS, "starttls");
send(e, true);
event = ESend;
@@ -1084,15 +1084,15 @@ bool CoreProtocol::normalStep(const QDomElement &e)
return true;
}
- QDomElement e = doc.createElement("iq");
+ TQDomElement e = doc.createElement("iq");
e.setAttribute("type", "set");
e.setAttribute("id", "bind_1");
- QDomElement b = doc.createElementNS(NS_BIND, "bind");
+ TQDomElement b = doc.createElementNS(NS_BIND, "bind");
// request specific resource?
- QString resource = jid.resource();
+ TQString resource = jid.resource();
if(!resource.isEmpty()) {
- QDomElement r = doc.createElement("resource");
+ TQDomElement r = doc.createElement("resource");
r.appendChild(doc.createTextNode(jid.resource()));
b.appendChild(r);
}
@@ -1105,11 +1105,11 @@ bool CoreProtocol::normalStep(const QDomElement &e)
return true;
}
else if(step == GetSASLFirst) {
- QDomElement e = doc.createElementNS(NS_SASL, "auth");
+ TQDomElement e = doc.createElementNS(NS_SASL, "auth");
e.setAttribute("mechanism", sasl_mech);
if(!sasl_step.isEmpty()) {
#ifdef XMPP_TEST
- TD::msg(QString("SASL OUT: [%1]").arg(printArray(sasl_step)));
+ TD::msg(TQString("SASL OUT: [%1]").arg(printArray(sasl_step)));
#endif
e.appendChild(doc.createTextNode(Base64::arrayToString(sasl_step)));
}
@@ -1122,15 +1122,15 @@ bool CoreProtocol::normalStep(const QDomElement &e)
else if(step == GetSASLNext) {
if(isIncoming()) {
if(sasl_authed) {
- QDomElement e = doc.createElementNS(NS_SASL, "success");
+ TQDomElement e = doc.createElementNS(NS_SASL, "success");
writeElement(e, TypeElement, false, true);
event = ESend;
step = IncHandleSASLSuccess;
return true;
}
else {
- QByteArray stepData = sasl_step;
- QDomElement e = doc.createElementNS(NS_SASL, "challenge");
+ TQByteArray stepData = sasl_step;
+ TQDomElement e = doc.createElementNS(NS_SASL, "challenge");
if(!stepData.isEmpty())
e.appendChild(doc.createTextNode(Base64::arrayToString(stepData)));
@@ -1141,11 +1141,11 @@ bool CoreProtocol::normalStep(const QDomElement &e)
}
}
else {
- QByteArray stepData = sasl_step;
+ TQByteArray stepData = sasl_step;
#ifdef XMPP_TEST
- TD::msg(QString("SASL OUT: [%1]").arg(printArray(sasl_step)));
+ TD::msg(TQString("SASL OUT: [%1]").arg(printArray(sasl_step)));
#endif
- QDomElement e = doc.createElementNS(NS_SASL, "response");
+ TQDomElement e = doc.createElementNS(NS_SASL, "response");
if(!stepData.isEmpty())
e.appendChild(doc.createTextNode(Base64::arrayToString(stepData)));
@@ -1162,12 +1162,12 @@ bool CoreProtocol::normalStep(const QDomElement &e)
return false;
}
else if(step == HandleAuthGet) {
- QDomElement e = doc.createElement("iq");
+ TQDomElement e = doc.createElement("iq");
e.setAttribute("to", to);
e.setAttribute("type", "get");
e.setAttribute("id", "auth_1");
- QDomElement q = doc.createElementNS("jabber:iq:auth", "query");
- QDomElement u = doc.createElement("username");
+ TQDomElement q = doc.createElementNS("jabber:iq:auth", "query");
+ TQDomElement u = doc.createElement("username");
u.appendChild(doc.createTextNode(jid.node()));
q.appendChild(u);
e.appendChild(q);
@@ -1178,22 +1178,22 @@ bool CoreProtocol::normalStep(const QDomElement &e)
return true;
}
else if(step == HandleAuthSet) {
- QDomElement e = doc.createElement("iq");
+ TQDomElement e = doc.createElement("iq");
e.setAttribute("to", to);
e.setAttribute("type", "set");
e.setAttribute("id", "auth_2");
- QDomElement q = doc.createElementNS("jabber:iq:auth", "query");
- QDomElement u = doc.createElement("username");
+ TQDomElement q = doc.createElementNS("jabber:iq:auth", "query");
+ TQDomElement u = doc.createElement("username");
u.appendChild(doc.createTextNode(jid.node()));
q.appendChild(u);
- QDomElement p;
+ TQDomElement p;
if(digest) {
// need SHA1 here
if(!QCA::isSupported(QCA::CAP_SHA1))
QCA::insertProvider(createProviderHash());
p = doc.createElement("digest");
- QCString cs = id.utf8() + password.utf8();
+ TQCString cs = id.utf8() + password.utf8();
p.appendChild(doc.createTextNode(QCA::SHA1::hashToString(cs)));
}
else {
@@ -1201,7 +1201,7 @@ bool CoreProtocol::normalStep(const QDomElement &e)
p.appendChild(doc.createTextNode(password));
}
q.appendChild(p);
- QDomElement r = doc.createElement("resource");
+ TQDomElement r = doc.createElement("resource");
r.appendChild(doc.createTextNode(jid.resource()));
q.appendChild(r);
e.appendChild(q);
@@ -1213,22 +1213,22 @@ bool CoreProtocol::normalStep(const QDomElement &e)
}
// server
else if(step == SendFeatures) {
- QDomElement f = doc.createElementNS(NS_ETHERX, "stream:features");
+ TQDomElement f = doc.createElementNS(NS_ETHERX, "stream:features");
if(!tls_started && !sasl_authed) { // don't offer tls if we are already sasl'd
- QDomElement tls = doc.createElementNS(NS_TLS, "starttls");
+ TQDomElement tls = doc.createElementNS(NS_TLS, "starttls");
f.appendChild(tls);
}
if(sasl_authed) {
if(!server) {
- QDomElement bind = doc.createElementNS(NS_BIND, "bind");
+ TQDomElement bind = doc.createElementNS(NS_BIND, "bind");
f.appendChild(bind);
}
}
else {
- QDomElement mechs = doc.createElementNS(NS_SASL, "mechanisms");
- for(QStringList::ConstIterator it = sasl_mechlist.begin(); it != sasl_mechlist.end(); ++it) {
- QDomElement m = doc.createElement("mechanism");
+ TQDomElement mechs = doc.createElementNS(NS_SASL, "mechanisms");
+ for(TQStringList::ConstIterator it = sasl_mechlist.begin(); it != sasl_mechlist.end(); ++it) {
+ TQDomElement m = doc.createElement("mechanism");
m.appendChild(doc.createTextNode(*it));
mechs.appendChild(m);
}
@@ -1261,25 +1261,25 @@ bool CoreProtocol::normalStep(const QDomElement &e)
if(e.namespaceURI() == NS_ETHERX && e.tagName() == "features") {
// extract features
StreamFeatures f;
- QDomElement s = e.elementsByTagNameNS(NS_TLS, "starttls").item(0).toElement();
+ TQDomElement s = e.elementsByTagNameNS(NS_TLS, "starttls").item(0).toElement();
if(!s.isNull()) {
f.tls_supported = true;
f.tls_required = s.elementsByTagNameNS(NS_TLS, "required").count() > 0;
}
- QDomElement m = e.elementsByTagNameNS(NS_SASL, "mechanisms").item(0).toElement();
+ TQDomElement m = e.elementsByTagNameNS(NS_SASL, "mechanisms").item(0).toElement();
if(!m.isNull()) {
f.sasl_supported = true;
- QDomNodeList l = m.elementsByTagNameNS(NS_SASL, "mechanism");
+ TQDomNodeList l = m.elementsByTagNameNS(NS_SASL, "mechanism");
for(uint n = 0; n < l.count(); ++n)
f.sasl_mechs += l.item(n).toElement().text();
}
- QDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
+ TQDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
if(!b.isNull())
f.bind_supported = true;
if(f.tls_supported) {
#ifdef XMPP_TEST
- QString s = "STARTTLS is available";
+ TQString s = "STARTTLS is available";
if(f.tls_required)
s += " (required)";
TD::msg(s);
@@ -1287,9 +1287,9 @@ bool CoreProtocol::normalStep(const QDomElement &e)
}
if(f.sasl_supported) {
#ifdef XMPP_TEST
- QString s = "SASL mechs:";
- for(QStringList::ConstIterator it = f.sasl_mechs.begin(); it != f.sasl_mechs.end(); ++it)
- s += QString(" [%1]").arg((*it));
+ TQString s = "SASL mechs:";
+ for(TQStringList::ConstIterator it = f.sasl_mechs.begin(); it != f.sasl_mechs.end(); ++it)
+ s += TQString(" [%1]").arg((*it));
TD::msg(s);
#endif
}
@@ -1339,9 +1339,9 @@ bool CoreProtocol::normalStep(const QDomElement &e)
// waiting for sasl challenge/success/fail
if(e.namespaceURI() == NS_SASL) {
if(e.tagName() == "challenge") {
- QByteArray a = Base64::stringToArray(e.text());
+ TQByteArray a = Base64::stringToArray(e.text());
#ifdef XMPP_TEST
- TD::msg(QString("SASL IN: [%1]").arg(printArray(a)));
+ TD::msg(TQString("SASL IN: [%1]").arg(printArray(a)));
#endif
sasl_step = a;
need = NSASLNext;
@@ -1355,7 +1355,7 @@ bool CoreProtocol::normalStep(const QDomElement &e)
return true;
}
else if(e.tagName() == "failure") {
- QDomElement t = firstChildElement(e);
+ TQDomElement t = firstChildElement(e);
if(t.isNull() || t.namespaceURI() != NS_SASL)
errCond = -1;
else
@@ -1374,15 +1374,15 @@ bool CoreProtocol::normalStep(const QDomElement &e)
}
else if(step == GetBindResponse) {
if(e.namespaceURI() == NS_CLIENT && e.tagName() == "iq") {
- QString type(e.attribute("type"));
- QString id(e.attribute("id"));
+ TQString type(e.attribute("type"));
+ TQString id(e.attribute("id"));
if(id == "bind_1" && (type == "result" || type == "error")) {
if(type == "result") {
- QDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
+ TQDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
Jid j;
if(!b.isNull()) {
- QDomElement je = e.elementsByTagName("jid").item(0).toElement();
+ TQDomElement je = e.elementsByTagName("jid").item(0).toElement();
j = je.text();
}
if(!j.isValid()) {
@@ -1396,20 +1396,20 @@ bool CoreProtocol::normalStep(const QDomElement &e)
else {
errCond = -1;
- QDomElement err = e.elementsByTagNameNS(NS_CLIENT, "error").item(0).toElement();
+ TQDomElement err = e.elementsByTagNameNS(NS_CLIENT, "error").item(0).toElement();
if(!err.isNull()) {
// get error condition
- QDomNodeList nl = err.childNodes();
- QDomElement t;
+ TQDomNodeList nl = err.childNodes();
+ TQDomElement t;
for(uint n = 0; n < nl.count(); ++n) {
- QDomNode i = nl.item(n);
+ TQDomNode i = nl.item(n);
if(i.isElement()) {
t = i.toElement();
break;
}
}
if(!t.isNull() && t.namespaceURI() == NS_STANZAS) {
- QString cond = t.tagName();
+ TQString cond = t.tagName();
if(cond == "not-allowed")
errCond = BindNotAllowed;
else if(cond == "conflict")
@@ -1434,13 +1434,13 @@ bool CoreProtocol::normalStep(const QDomElement &e)
// waiting for an iq
if(e.namespaceURI() == NS_CLIENT && e.tagName() == "iq") {
Jid from(e.attribute("from"));
- QString type(e.attribute("type"));
- QString id(e.attribute("id"));
+ TQString type(e.attribute("type"));
+ TQString id(e.attribute("id"));
bool okfrom = (from.isEmpty() || from.compare(Jid(to)));
if(okfrom && id == "auth_1" && (type == "result" || type == "error")) {
if(type == "result") {
- QDomElement q = e.elementsByTagNameNS("jabber:iq:auth", "query").item(0).toElement();
+ TQDomElement q = e.elementsByTagNameNS("jabber:iq:auth", "query").item(0).toElement();
if(q.isNull() || q.elementsByTagName("username").item(0).isNull() || q.elementsByTagName("resource").item(0).isNull()) {
event = EError;
errorCode = ErrProtocol;
@@ -1487,8 +1487,8 @@ bool CoreProtocol::normalStep(const QDomElement &e)
// waiting for an iq
if(e.namespaceURI() == NS_CLIENT && e.tagName() == "iq") {
Jid from(e.attribute("from"));
- QString type(e.attribute("type"));
- QString id(e.attribute("id"));
+ TQString type(e.attribute("type"));
+ TQString id(e.attribute("id"));
bool okfrom = (from.isEmpty() || from.compare(Jid(to)));
if(okfrom && id == "auth_2" && (type == "result" || type == "error")) {
@@ -1517,7 +1517,7 @@ bool CoreProtocol::normalStep(const QDomElement &e)
if(e.namespaceURI() == NS_TLS && e.localName() == "starttls") {
// TODO: don't let this be done twice
- QDomElement e = doc.createElementNS(NS_TLS, "proceed");
+ TQDomElement e = doc.createElementNS(NS_TLS, "proceed");
writeElement(e, TypeElement, false, true);
event = ESend;
step = HandleTLS;
@@ -1546,16 +1546,16 @@ bool CoreProtocol::normalStep(const QDomElement &e)
}
}
if(e.namespaceURI() == NS_CLIENT && e.tagName() == "iq") {
- QDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
+ TQDomElement b = e.elementsByTagNameNS(NS_BIND, "bind").item(0).toElement();
if(!b.isNull()) {
- QDomElement res = b.elementsByTagName("resource").item(0).toElement();
- QString resource = res.text();
+ TQDomElement res = b.elementsByTagName("resource").item(0).toElement();
+ TQString resource = res.text();
- QDomElement r = doc.createElement("iq");
+ TQDomElement r = doc.createElement("iq");
r.setAttribute("type", "result");
r.setAttribute("id", e.attribute("id"));
- QDomElement bind = doc.createElementNS(NS_BIND, "bind");
- QDomElement jid = doc.createElement("jid");
+ TQDomElement bind = doc.createElementNS(NS_BIND, "bind");
+ TQDomElement jid = doc.createElement("jid");
Jid j = user + '@' + host + '/' + resource;
jid.appendChild(doc.createTextNode(j.full()));
bind.appendChild(jid);
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.h
index 6cb82472..0c735192 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.h
@@ -21,7 +21,7 @@
#ifndef PROTOCOL_H
#define PROTOCOL_H
-#include<qpair.h>
+#include<tqpair.h>
#include"xmlprotocol.h"
#include"xmpp.h"
@@ -56,7 +56,7 @@ namespace XMPP
bool tls_supported, sasl_supported, bind_supported;
bool tls_required;
- QStringList sasl_mechs;
+ TQStringList sasl_mechs;
};
class BasicProtocol : public XmlProtocol
@@ -136,78 +136,78 @@ namespace XMPP
void reset();
// for outgoing xml
- QDomDocument doc;
+ TQDomDocument doc;
// sasl-related
- QString saslMech() const;
- QByteArray saslStep() const;
- void setSASLMechList(const QStringList &list);
- void setSASLFirst(const QString &mech, const QByteArray &step);
- void setSASLNext(const QByteArray &step);
+ TQString saslMech() const;
+ TQByteArray saslStep() const;
+ void setSASLMechList(const TQStringList &list);
+ void setSASLFirst(const TQString &mech, const TQByteArray &step);
+ void setSASLNext(const TQByteArray &step);
void setSASLAuthed();
// send / recv
- void sendStanza(const QDomElement &e);
- void sendDirect(const QString &s);
+ void sendStanza(const TQDomElement &e);
+ void sendDirect(const TQString &s);
void sendWhitespace();
- QDomElement recvStanza();
+ TQDomElement recvStanza();
// shutdown
void shutdown();
- void shutdownWithError(int cond, const QString &otherHost="");
+ void shutdownWithError(int cond, const TQString &otherHost="");
// <stream> information
- QString to, from, id, lang;
+ TQString to, from, id, lang;
Version version;
// error output
int errCond;
- QString errText;
- QDomElement errAppSpec;
- QString otherHost;
+ TQString errText;
+ TQDomElement errAppSpec;
+ TQString otherHost;
- QByteArray spare; // filled with unprocessed data on NStartTLS and NSASLLayer
+ TQByteArray spare; // filled with unprocessed data on NStartTLS and NSASLLayer
bool isReady() const;
enum { TypeElement, TypeStanza, TypeDirect, TypePing };
protected:
- static int stringToSASLCond(const QString &s);
- static int stringToStreamCond(const QString &s);
- static QString saslCondToString(int);
- static QString streamCondToString(int);
+ static int stringToSASLCond(const TQString &s);
+ static int stringToStreamCond(const TQString &s);
+ static TQString saslCondToString(int);
+ static TQString streamCondToString(int);
- void send(const QDomElement &e, bool clip=false);
- void sendStreamError(int cond, const QString &text="", const QDomElement &appSpec=QDomElement());
- void sendStreamError(const QString &text); // old-style
+ void send(const TQDomElement &e, bool clip=false);
+ void sendStreamError(int cond, const TQString &text="", const TQDomElement &appSpec=TQDomElement());
+ void sendStreamError(const TQString &text); // old-style
- bool errorAndClose(int cond, const QString &text="", const QDomElement &appSpec=QDomElement());
+ bool errorAndClose(int cond, const TQString &text="", const TQDomElement &appSpec=TQDomElement());
bool error(int code);
- void delayErrorAndClose(int cond, const QString &text="", const QDomElement &appSpec=QDomElement());
+ void delayErrorAndClose(int cond, const TQString &text="", const TQDomElement &appSpec=TQDomElement());
void delayError(int code);
// reimplemented
- QDomElement docElement();
+ TQDomElement docElement();
void handleDocOpen(const Parser::Event &pe);
bool handleError();
bool handleCloseFinished();
- bool doStep(const QDomElement &e);
+ bool doStep(const TQDomElement &e);
void itemWritten(int id, int size);
- virtual QString defaultNamespace();
- virtual QStringList extraNamespaces(); // stringlist: prefix,uri,prefix,uri, [...]
+ virtual TQString defaultNamespace();
+ virtual TQStringList extraNamespaces(); // stringlist: prefix,uri,prefix,uri, [...]
virtual void handleStreamOpen(const Parser::Event &pe);
- virtual bool doStep2(const QDomElement &e)=0;
+ virtual bool doStep2(const TQDomElement &e)=0;
void setReady(bool b);
- QString sasl_mech;
- QStringList sasl_mechlist;
- QByteArray sasl_step;
+ TQString sasl_mech;
+ TQStringList sasl_mechlist;
+ TQByteArray sasl_step;
bool sasl_authed;
- QDomElement stanzaToRecv;
+ TQDomElement stanzaToRecv;
private:
struct SASLCondEntry
@@ -226,17 +226,17 @@ namespace XMPP
struct SendItem
{
- QDomElement stanzaToSend;
- QString stringToSend;
+ TQDomElement stanzaToSend;
+ TQString stringToSend;
bool doWhitespace;
};
- QValueList<SendItem> sendList;
+ TQValueList<SendItem> sendList;
bool doShutdown, delayedError, closeError, ready;
int stanzasPending, stanzasWritten;
void init();
- void extractStreamError(const QDomElement &e);
+ void extractStreamError(const TQDomElement &e);
};
class CoreProtocol : public BasicProtocol
@@ -254,30 +254,30 @@ namespace XMPP
void reset();
void startClientOut(const Jid &jid, bool oldOnly, bool tlsActive, bool doAuth);
- void startServerOut(const QString &to);
- void startDialbackOut(const QString &to, const QString &from);
- void startDialbackVerifyOut(const QString &to, const QString &from, const QString &id, const QString &key);
- void startClientIn(const QString &id);
- void startServerIn(const QString &id);
+ void startServerOut(const TQString &to);
+ void startDialbackOut(const TQString &to, const TQString &from);
+ void startDialbackVerifyOut(const TQString &to, const TQString &from, const TQString &id, const TQString &key);
+ void startClientIn(const TQString &id);
+ void startServerIn(const TQString &id);
- void setLang(const QString &s);
+ void setLang(const TQString &s);
void setAllowTLS(bool b);
void setAllowBind(bool b);
void setAllowPlain(bool b); // old-mode
- void setPassword(const QString &s);
- void setFrom(const QString &s);
- void setDialbackKey(const QString &s);
+ void setPassword(const TQString &s);
+ void setFrom(const TQString &s);
+ void setDialbackKey(const TQString &s);
// input
- QString user, host;
+ TQString user, host;
// status
bool old;
StreamFeatures features;
- //static QString xmlToString(const QDomElement &e, bool clip=false);
+ //static TQString xmlToString(const TQDomElement &e, bool clip=false);
class DBItem
{
@@ -285,7 +285,7 @@ namespace XMPP
enum { ResultRequest, ResultGrant, VerifyRequest, VerifyGrant, Validated };
int type;
Jid to, from;
- QString key, id;
+ TQString key, id;
bool ok;
};
@@ -312,7 +312,7 @@ namespace XMPP
GetAuthSetResponse // read auth-set response
};
- QValueList<DBItem> dbrequests, dbpending, dbvalidated;
+ TQValueList<DBItem> dbrequests, dbpending, dbvalidated;
bool server, dialback, dialback_verify;
int step;
@@ -324,31 +324,31 @@ namespace XMPP
bool oldOnly;
bool allowPlain;
bool doTLS, doAuth, doBinding;
- QString password;
+ TQString password;
- QString dialback_id, dialback_key;
- QString self_from;
+ TQString dialback_id, dialback_key;
+ TQString self_from;
void init();
- static int getOldErrorCode(const QDomElement &e);
+ static int getOldErrorCode(const TQDomElement &e);
bool loginComplete();
- bool isValidStanza(const QDomElement &e) const;
+ bool isValidStanza(const TQDomElement &e) const;
bool grabPendingItem(const Jid &to, const Jid &from, int type, DBItem *item);
- bool normalStep(const QDomElement &e);
- bool dialbackStep(const QDomElement &e);
+ bool normalStep(const TQDomElement &e);
+ bool dialbackStep(const TQDomElement &e);
// reimplemented
bool stepAdvancesParser() const;
bool stepRequiresElement() const;
- void stringSend(const QString &s);
- void stringRecv(const QString &s);
- QString defaultNamespace();
- QStringList extraNamespaces();
+ void stringSend(const TQString &s);
+ void stringRecv(const TQString &s);
+ TQString defaultNamespace();
+ TQStringList extraNamespaces();
void handleStreamOpen(const Parser::Event &pe);
- bool doStep2(const QDomElement &e);
- void elementSend(const QDomElement &e);
- void elementRecv(const QDomElement &e);
+ bool doStep2(const TQDomElement &e);
+ void elementSend(const TQDomElement &e);
+ void elementRecv(const TQDomElement &e);
};
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h
index e6172434..6eda17f9 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h
@@ -21,11 +21,11 @@
#ifndef QCAPROVIDER_H
#define QCAPROVIDER_H
-#include<qglobal.h>
-#include<qstring.h>
-#include<qdatetime.h>
-#include<qobject.h>
-#include<qhostaddress.h>
+#include<tqglobal.h>
+#include<tqstring.h>
+#include<tqdatetime.h>
+#include<tqobject.h>
+#include<tqhostaddress.h>
#include"qca.h"
#define QCA_PLUGIN_VERSION 1
@@ -50,7 +50,7 @@ public:
virtual QCA_HashContext *clone()=0;
virtual void reset()=0;
virtual void update(const char *in, unsigned int len)=0;
- virtual void final(QByteArray *out)=0;
+ virtual void final(TQByteArray *out)=0;
};
class QCA_CipherContext
@@ -66,7 +66,7 @@ public:
virtual bool setup(int dir, int mode, const char *key, int keysize, const char *iv, bool pad)=0;
virtual bool update(const char *in, unsigned int len)=0;
- virtual bool final(QByteArray *out)=0;
+ virtual bool final(TQByteArray *out)=0;
};
class QCA_RSAKeyContext
@@ -82,17 +82,17 @@ public:
virtual bool createFromPEM(const char *in, unsigned int len)=0;
virtual bool createFromNative(void *in)=0;
virtual bool generate(unsigned int bits)=0;
- virtual bool toDER(QByteArray *out, bool publicOnly)=0;
- virtual bool toPEM(QByteArray *out, bool publicOnly)=0;
+ virtual bool toDER(TQByteArray *out, bool publicOnly)=0;
+ virtual bool toPEM(TQByteArray *out, bool publicOnly)=0;
- virtual bool encrypt(const QByteArray &in, QByteArray *out, bool oaep)=0;
- virtual bool decrypt(const QByteArray &in, QByteArray *out, bool oaep)=0;
+ virtual bool encrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0;
+ virtual bool decrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0;
};
struct QCA_CertProperty
{
- QString var;
- QString val;
+ TQString var;
+ TQString val;
};
class QCA_CertContext
@@ -104,17 +104,17 @@ public:
virtual bool isNull() const=0;
virtual bool createFromDER(const char *in, unsigned int len)=0;
virtual bool createFromPEM(const char *in, unsigned int len)=0;
- virtual bool toDER(QByteArray *out)=0;
- virtual bool toPEM(QByteArray *out)=0;
-
- virtual QString serialNumber() const=0;
- virtual QString subjectString() const=0;
- virtual QString issuerString() const=0;
- virtual QValueList<QCA_CertProperty> subject() const=0;
- virtual QValueList<QCA_CertProperty> issuer() const=0;
- virtual QDateTime notBefore() const=0;
- virtual QDateTime notAfter() const=0;
- virtual bool matchesAddress(const QString &realHost) const=0;
+ virtual bool toDER(TQByteArray *out)=0;
+ virtual bool toPEM(TQByteArray *out)=0;
+
+ virtual TQString serialNumber() const=0;
+ virtual TQString subjectString() const=0;
+ virtual TQString issuerString() const=0;
+ virtual TQValueList<QCA_CertProperty> subject() const=0;
+ virtual TQValueList<QCA_CertProperty> issuer() const=0;
+ virtual TQDateTime notBefore() const=0;
+ virtual TQDateTime notAfter() const=0;
+ virtual bool matchesAddress(const TQString &realHost) const=0;
};
class QCA_TLSContext
@@ -124,15 +124,15 @@ public:
virtual ~QCA_TLSContext() {}
virtual void reset()=0;
- virtual bool startClient(const QPtrList<QCA_CertContext> &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0;
- virtual bool startServer(const QPtrList<QCA_CertContext> &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0;
+ virtual bool startClient(const TQPtrList<QCA_CertContext> &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0;
+ virtual bool startServer(const TQPtrList<QCA_CertContext> &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0;
- virtual int handshake(const QByteArray &in, QByteArray *out)=0;
- virtual int shutdown(const QByteArray &in, QByteArray *out)=0;
- virtual bool encode(const QByteArray &plain, QByteArray *to_net, int *encoded)=0;
- virtual bool decode(const QByteArray &from_net, QByteArray *plain, QByteArray *to_net)=0;
+ virtual int handshake(const TQByteArray &in, TQByteArray *out)=0;
+ virtual int shutdown(const TQByteArray &in, TQByteArray *out)=0;
+ virtual bool encode(const TQByteArray &plain, TQByteArray *to_net, int *encoded)=0;
+ virtual bool decode(const TQByteArray &from_net, TQByteArray *plain, TQByteArray *to_net)=0;
virtual bool eof() const=0;
- virtual QByteArray unprocessed()=0;
+ virtual TQByteArray unprocessed()=0;
virtual QCA_CertContext *peerCertificate() const=0;
virtual int validityResult() const=0;
@@ -140,7 +140,7 @@ public:
struct QCA_SASLHostPort
{
- QHostAddress addr;
+ TQHostAddress addr;
Q_UINT16 port;
};
@@ -157,35 +157,35 @@ public:
// common
virtual void reset()=0;
- virtual void setCoreProps(const QString &service, const QString &host, QCA_SASLHostPort *local, QCA_SASLHostPort *remote)=0;
- virtual void setSecurityProps(bool noPlain, bool noActive, bool noDict, bool noAnon, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int ssfMax, const QString &_ext_authid, int _ext_ssf)=0;
+ virtual void setCoreProps(const TQString &service, const TQString &host, QCA_SASLHostPort *local, QCA_SASLHostPort *remote)=0;
+ virtual void setSecurityProps(bool noPlain, bool noActive, bool noDict, bool noAnon, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int ssfMax, const TQString &_ext_authid, int _ext_ssf)=0;
virtual int security() const=0;
virtual int errorCond() const=0;
// init / first step
- virtual bool clientStart(const QStringList &mechlist)=0;
+ virtual bool clientStart(const TQStringList &mechlist)=0;
virtual int clientFirstStep(bool allowClientSendFirst)=0;
- virtual bool serverStart(const QString &realm, QStringList *mechlist, const QString &name)=0;
- virtual int serverFirstStep(const QString &mech, const QByteArray *in)=0;
+ virtual bool serverStart(const TQString &realm, TQStringList *mechlist, const TQString &name)=0;
+ virtual int serverFirstStep(const TQString &mech, const TQByteArray *in)=0;
// get / set params
virtual QCA_SASLNeedParams clientParamsNeeded() const=0;
- virtual void setClientParams(const QString *user, const QString *authzid, const QString *pass, const QString *realm)=0;
- virtual QString username() const=0;
- virtual QString authzid() const=0;
+ virtual void setClientParams(const TQString *user, const TQString *authzid, const TQString *pass, const TQString *realm)=0;
+ virtual TQString username() const=0;
+ virtual TQString authzid() const=0;
// continue steps
- virtual int nextStep(const QByteArray &in)=0;
+ virtual int nextStep(const TQByteArray &in)=0;
virtual int tryAgain()=0;
// results
- virtual QString mech() const=0;
- virtual const QByteArray *clientInit() const=0;
- virtual QByteArray result() const=0;
+ virtual TQString mech() const=0;
+ virtual const TQByteArray *clientInit() const=0;
+ virtual TQByteArray result() const=0;
// security layer
- virtual bool encode(const QByteArray &in, QByteArray *out)=0;
- virtual bool decode(const QByteArray &in, QByteArray *out)=0;
+ virtual bool encode(const TQByteArray &in, TQByteArray *out)=0;
+ virtual bool decode(const TQByteArray &in, TQByteArray *out)=0;
};
#endif
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp
index 159c8058..f7d44db4 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp
@@ -28,9 +28,9 @@
#include"securestream.h"
-#include<qguardedptr.h>
-#include<qvaluelist.h>
-#include<qtimer.h>
+#include<tqguardedptr.h>
+#include<tqvaluelist.h>
+#include<tqtimer.h>
#ifdef USE_TLSHANDLER
#include"xmpp.h"
@@ -56,7 +56,7 @@ public:
int finished(int encoded);
int p;
- QValueList<Item> list;
+ TQValueList<Item> list;
};
LayerTracker::LayerTracker()
@@ -90,7 +90,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?
@@ -131,11 +131,11 @@ public:
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(QCA::SASL *s)
@@ -143,9 +143,9 @@ public:
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
@@ -154,11 +154,11 @@ public:
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
@@ -168,7 +168,7 @@ public:
prebytes = 0;
}
- void write(const QByteArray &a)
+ void write(const TQByteArray &a)
{
layer.addPlain(a.size());
switch(type) {
@@ -180,7 +180,7 @@ public:
}
}
- void writeIncoming(const QByteArray &a)
+ void writeIncoming(const TQByteArray &a)
{
switch(type) {
case TLS: { p.tls->writeIncoming(a); break; }
@@ -218,9 +218,9 @@ public:
signals:
void tlsHandshaken();
- void tlsClosed(const QByteArray &);
- void readyRead(const QByteArray &);
- void needWrite(const QByteArray &);
+ void tlsClosed(const TQByteArray &);
+ void readyRead(const TQByteArray &);
+ void needWrite(const TQByteArray &);
void error(int);
private slots:
@@ -232,13 +232,13 @@ private slots:
void tls_readyRead()
{
- QByteArray a = p.tls->read();
+ TQByteArray a = p.tls->read();
readyRead(a);
}
void tls_readyReadOutgoing(int plainBytes)
{
- QByteArray a = p.tls->readOutgoing();
+ TQByteArray a = p.tls->readOutgoing();
if(tls_done)
layer.specifyEncoded(a.size(), plainBytes);
needWrite(a);
@@ -246,7 +246,7 @@ private slots:
void tls_closed()
{
- QByteArray a = p.tls->readUnprocessed();
+ TQByteArray a = p.tls->readUnprocessed();
tlsClosed(a);
}
@@ -257,13 +257,13 @@ private slots:
void sasl_readyRead()
{
- QByteArray a = p.sasl->read();
+ TQByteArray a = p.sasl->read();
readyRead(a);
}
void sasl_readyReadOutgoing(int plainBytes)
{
- QByteArray a = p.sasl->readOutgoing();
+ TQByteArray a = p.sasl->readOutgoing();
layer.specifyEncoded(a.size(), plainBytes);
needWrite(a);
}
@@ -287,15 +287,15 @@ private slots:
void tlsHandler_closed()
{
- tlsClosed(QByteArray());
+ tlsClosed(TQByteArray());
}
- void tlsHandler_readyRead(const QByteArray &a)
+ void tlsHandler_readyRead(const TQByteArray &a)
{
readyRead(a);
}
- void tlsHandler_readyReadOutgoing(const QByteArray &a, int plainBytes)
+ void tlsHandler_readyReadOutgoing(const TQByteArray &a, int plainBytes)
{
if(tls_done)
layer.specifyEncoded(a.size(), plainBytes);
@@ -310,7 +310,7 @@ class SecureStream::Private
{
public:
ByteStream *bs;
- QPtrList<SecureLayer> layers;
+ TQPtrList<SecureLayer> layers;
int pending;
int errorCode;
bool active;
@@ -318,7 +318,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
@@ -333,7 +333,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;
@@ -348,8 +348,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;
@@ -362,25 +362,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;
@@ -394,7 +394,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;
@@ -408,7 +408,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;
@@ -422,7 +422,7 @@ void SecureStream::setLayerSASL(QCA::SASL *sasl, const QByteArray &spare)
}
#ifdef USE_TLSHANDLER
-void SecureStream::startTLSClient(XMPP::TLSHandler *t, const QString &server, const QByteArray &spare)
+void SecureStream::startTLSClient(XMPP::TLSHandler *t, const TQString &server, const TQByteArray &spare)
{
if(!d->active || d->topInProgress || d->haveTLS())
return;
@@ -459,7 +459,7 @@ bool SecureStream::isOpen() const
return d->active;
}
-void SecureStream::write(const QByteArray &a)
+void SecureStream::write(const TQByteArray &a)
{
if(!isOpen())
return;
@@ -481,7 +481,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();
@@ -493,7 +493,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);
@@ -509,17 +509,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;
@@ -532,10 +532,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;
@@ -565,7 +565,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();
@@ -576,12 +576,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);
if(bytesAvailable())
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h
index 8ae9f761..844fd3d1 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h
@@ -41,11 +41,11 @@ public:
SecureStream(ByteStream *s);
~SecureStream();
- void startTLSClient(QCA::TLS *t, const QByteArray &spare=QByteArray());
- void startTLSServer(QCA::TLS *t, const QByteArray &spare=QByteArray());
- void setLayerSASL(QCA::SASL *s, const QByteArray &spare=QByteArray());
+ void startTLSClient(QCA::TLS *t, const TQByteArray &spare=TQByteArray());
+ void startTLSServer(QCA::TLS *t, const TQByteArray &spare=TQByteArray());
+ void setLayerSASL(QCA::SASL *s, const TQByteArray &spare=TQByteArray());
#ifdef USE_TLSHANDLER
- void startTLSClient(XMPP::TLSHandler *t, const QString &server, const QByteArray &spare=QByteArray());
+ void startTLSClient(XMPP::TLSHandler *t, const TQString &server, const TQByteArray &spare=TQByteArray());
#endif
void closeTLS();
@@ -53,7 +53,7 @@ public:
// reimplemented
bool isOpen() const;
- void write(const QByteArray &);
+ void write(const TQByteArray &);
int bytesToWrite() const;
signals:
@@ -65,17 +65,17 @@ private slots:
void bs_bytesWritten(int);
void layer_tlsHandshaken();
- void layer_tlsClosed(const QByteArray &);
- void layer_readyRead(const QByteArray &);
- void layer_needWrite(const QByteArray &);
+ void layer_tlsClosed(const TQByteArray &);
+ void layer_readyRead(const TQByteArray &);
+ void layer_needWrite(const TQByteArray &);
void layer_error(int);
private:
- void linkLayer(QObject *);
+ void linkLayer(TQObject *);
int calcPrebytes() const;
- void insertData(const QByteArray &a);
- void writeRawData(const QByteArray &a);
- void incomingData(const QByteArray &a);
+ void insertData(const TQByteArray &a);
+ void writeRawData(const TQByteArray &a);
+ void incomingData(const TQByteArray &a);
class Private;
Private *d;
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp
index 82a7aac4..c825a2ca 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp
@@ -20,10 +20,10 @@
#include"simplesasl.h"
-#include<qhostaddress.h>
-#include<qstringlist.h>
-#include<qptrlist.h>
-#include<qvaluelist.h>
+#include<tqhostaddress.h>
+#include<tqstringlist.h>
+#include<tqptrlist.h>
+#include<tqvaluelist.h>
#include<qca.h>
#include<stdlib.h>
#include"base64.h"
@@ -33,17 +33,17 @@ namespace XMPP
struct Prop
{
- QCString var, val;
+ TQCString var, val;
};
-class PropList : public QValueList<Prop>
+class PropList : public TQValueList<Prop>
{
public:
- PropList() : QValueList<Prop>()
+ PropList() : TQValueList<Prop>()
{
}
- void set(const QCString &var, const QCString &val)
+ void set(const TQCString &var, const TQCString &val)
{
Prop p;
p.var = var;
@@ -51,18 +51,18 @@ public:
append(p);
}
- QCString get(const QCString &var)
+ TQCString get(const TQCString &var)
{
for(ConstIterator it = begin(); it != end(); ++it) {
if((*it).var == var)
return (*it).val;
}
- return QCString();
+ return TQCString();
}
- QCString toString() const
+ TQCString toString() const
{
- QCString str;
+ TQCString str;
bool first = true;
for(ConstIterator it = begin(); it != end(); ++it) {
if(!first)
@@ -73,7 +73,7 @@ public:
return str;
}
- bool fromString(const QCString &str)
+ bool fromString(const TQCString &str)
{
PropList list;
int at = 0;
@@ -81,7 +81,7 @@ public:
int n = str.find('=', at);
if(n == -1)
break;
- QCString var, val;
+ TQCString var, val;
var = str.mid(at, n-at);
at = n + 1;
if(str[at] == '\"') {
@@ -122,7 +122,7 @@ public:
return true;
}
- int varCount(const QCString &var)
+ int varCount(const TQCString &var)
{
int n = 0;
for(ConstIterator it = begin(); it != end(); ++it) {
@@ -132,9 +132,9 @@ public:
return n;
}
- QStringList getValues(const QCString &var)
+ TQStringList getValues(const TQCString &var)
{
- QStringList list;
+ TQStringList list;
for(ConstIterator it = begin(); it != end(); ++it) {
if((*it).var == var)
list += (*it).val;
@@ -147,19 +147,19 @@ class SimpleSASLContext : public QCA_SASLContext
{
public:
// core props
- QString service, host;
+ TQString service, host;
// state
int step;
- QByteArray in_buf;
- QString out_mech;
- QByteArray out_buf;
+ TQByteArray in_buf;
+ TQString out_mech;
+ TQByteArray out_buf;
bool capable;
int err;
QCA_SASLNeedParams need;
QCA_SASLNeedParams have;
- QString user, authz, pass, realm;
+ TQString user, authz, pass, realm;
SimpleSASLContext()
{
@@ -179,7 +179,7 @@ public:
void resetState()
{
- out_mech = QString();
+ out_mech = TQString();
out_buf.resize(0);
err = -1;
}
@@ -195,19 +195,19 @@ public:
have.authzid = false;
have.pass = false;
have.realm = false;
- user = QString();
- authz = QString();
- pass = QString();
- realm = QString();
+ user = TQString();
+ authz = TQString();
+ pass = TQString();
+ realm = TQString();
}
- void setCoreProps(const QString &_service, const QString &_host, QCA_SASLHostPort *, QCA_SASLHostPort *)
+ void setCoreProps(const TQString &_service, const TQString &_host, QCA_SASLHostPort *, QCA_SASLHostPort *)
{
service = _service;
host = _host;
}
- void setSecurityProps(bool, bool, bool, bool, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int, const QString &, int)
+ void setSecurityProps(bool, bool, bool, bool, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int, const TQString &, int)
{
if(reqForward || reqCreds || reqMutual || ssfMin > 0)
capable = false;
@@ -225,10 +225,10 @@ public:
return err;
}
- bool clientStart(const QStringList &mechlist)
+ bool clientStart(const TQStringList &mechlist)
{
bool haveMech = false;
- for(QStringList::ConstIterator it = mechlist.begin(); it != mechlist.end(); ++it) {
+ for(TQStringList::ConstIterator it = mechlist.begin(); it != mechlist.end(); ++it) {
if((*it) == "DIGEST-MD5") {
haveMech = true;
break;
@@ -249,12 +249,12 @@ public:
return clientTryAgain();
}
- bool serverStart(const QString &, QStringList *, const QString &)
+ bool serverStart(const TQString &, TQStringList *, const TQString &)
{
return false;
}
- int serverFirstStep(const QString &, const QByteArray *)
+ int serverFirstStep(const TQString &, const TQByteArray *)
{
return Error;
}
@@ -264,7 +264,7 @@ public:
return need;
}
- void setClientParams(const QString *_user, const QString *_authzid, const QString *_pass, const QString *_realm)
+ void setClientParams(const TQString *_user, const TQString *_authzid, const TQString *_pass, const TQString *_realm)
{
if(_user) {
user = *_user;
@@ -288,17 +288,17 @@ public:
}
}
- QString username() const
+ TQString username() const
{
- return QString();
+ return TQString();
}
- QString authzid() const
+ TQString authzid() const
{
- return QString();
+ return TQString();
}
- int nextStep(const QByteArray &in)
+ int nextStep(const TQByteArray &in)
{
in_buf = in.copy();
return tryAgain();
@@ -309,17 +309,17 @@ public:
return clientTryAgain();
}
- QString mech() const
+ TQString mech() const
{
return out_mech;
}
- const QByteArray *clientInit() const
+ const TQByteArray *clientInit() const
{
return 0;
}
- QByteArray result() const
+ TQByteArray result() const
{
return out_buf;
}
@@ -349,7 +349,7 @@ public:
return NeedParams;
// get props
- QCString cs(in_buf.data(), in_buf.size()+1);
+ TQCString cs(in_buf.data(), in_buf.size()+1);
PropList in;
if(!in.fromString(cs)) {
err = QCA::SASL::BadProto;
@@ -357,30 +357,30 @@ public:
}
// make a cnonce
- QByteArray a(32);
+ TQByteArray a(32);
for(int n = 0; n < (int)a.size(); ++n)
a[n] = (char)(256.0*rand()/(RAND_MAX+1.0));
- QCString cnonce = Base64::arrayToString(a).latin1();
+ TQCString cnonce = Base64::arrayToString(a).latin1();
// make other variables
realm = host;
- QCString nonce = in.get("nonce");
- QCString nc = "00000001";
- QCString uri = service.utf8() + '/' + host.utf8();
- QCString qop = "auth";
+ TQCString nonce = in.get("nonce");
+ TQCString nc = "00000001";
+ TQCString uri = service.utf8() + '/' + host.utf8();
+ TQCString qop = "auth";
// build 'response'
- QCString X = user.utf8() + ':' + realm.utf8() + ':' + pass.utf8();
- QByteArray Y = QCA::MD5::hash(X);
- QCString tmp = QCString(":") + nonce + ':' + cnonce + ':' + authz.utf8();
- QByteArray A1(Y.size() + tmp.length());
+ TQCString X = user.utf8() + ':' + realm.utf8() + ':' + pass.utf8();
+ TQByteArray Y = QCA::MD5::hash(X);
+ TQCString tmp = TQCString(":") + nonce + ':' + cnonce + ':' + authz.utf8();
+ TQByteArray A1(Y.size() + tmp.length());
memcpy(A1.data(), Y.data(), Y.size());
memcpy(A1.data() + Y.size(), tmp.data(), tmp.length());
- QCString A2 = "AUTHENTICATE:" + uri;
- QCString HA1 = QCA::MD5::hashToString(A1).latin1();
- QCString HA2 = QCA::MD5::hashToString(A2).latin1();
- QCString KD = HA1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + HA2;
- QCString Z = QCA::MD5::hashToString(KD).latin1();
+ TQCString A2 = "AUTHENTICATE:" + uri;
+ TQCString HA1 = QCA::MD5::hashToString(A1).latin1();
+ TQCString HA2 = QCA::MD5::hashToString(A2).latin1();
+ TQCString KD = HA1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + HA2;
+ TQCString Z = QCA::MD5::hashToString(KD).latin1();
// build output
PropList out;
@@ -396,7 +396,7 @@ public:
out.set("response", Z);
out.set("charset", "utf-8");
out.set("authzid", authz.utf8());
- QCString s = out.toString();
+ TQCString s = out.toString();
// done
out_buf.resize(s.length());
@@ -410,13 +410,13 @@ public:
}
}
- bool encode(const QByteArray &a, QByteArray *b)
+ bool encode(const TQByteArray &a, TQByteArray *b)
{
*b = a.copy();
return true;
}
- bool decode(const QByteArray &a, QByteArray *b)
+ bool decode(const TQByteArray &a, TQByteArray *b)
{
*b = a.copy();
return true;
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp
index 5482e2b3..d3182ffe 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp
@@ -44,9 +44,9 @@
#include"xmpp.h"
-#include<qtextstream.h>
-#include<qguardedptr.h>
-#include<qtimer.h>
+#include<tqtextstream.h>
+#include<tqguardedptr.h>
+#include<tqtimer.h>
#include<qca.h>
#include<stdlib.h>
#include"bytestream.h"
@@ -70,15 +70,15 @@ void XMPP::setDebug(Debug *p)
debug_ptr = p;
}
-static QByteArray randomArray(int size)
+static TQByteArray randomArray(int size)
{
- QByteArray a(size);
+ TQByteArray a(size);
for(int n = 0; n < size; ++n)
a[n] = (char)(256.0*rand()/(RAND_MAX+1.0));
return a;
}
-static QString genId()
+static TQString genId()
{
// need SHA1 here
if(!QCA::isSupported(QCA::CAP_SHA1))
@@ -90,7 +90,7 @@ static QString genId()
//----------------------------------------------------------------------------
// Stanza
//----------------------------------------------------------------------------
-Stanza::Error::Error(int _type, int _condition, const QString &_text, const QDomElement &_appSpec)
+Stanza::Error::Error(int _type, int _condition, const TQString &_text, const TQDomElement &_appSpec)
{
type = _type;
condition = _condition;
@@ -115,7 +115,7 @@ public:
};
static ErrorCondEntry errorCondTable[];
- static int stringToKind(const QString &s)
+ static int stringToKind(const TQString &s)
{
if(s == "message")
return Message;
@@ -127,7 +127,7 @@ public:
return -1;
}
- static QString kindToString(Kind k)
+ static TQString kindToString(Kind k)
{
if(k == Message)
return "message";
@@ -137,7 +137,7 @@ public:
return "iq";
}
- static int stringToErrorType(const QString &s)
+ static int stringToErrorType(const TQString &s)
{
for(int n = 0; errorTypeTable[n].str; ++n) {
if(s == errorTypeTable[n].str)
@@ -146,16 +146,16 @@ public:
return -1;
}
- static QString errorTypeToString(int x)
+ static TQString errorTypeToString(int x)
{
for(int n = 0; errorTypeTable[n].str; ++n) {
if(x == errorTypeTable[n].type)
return errorTypeTable[n].str;
}
- return QString();
+ return TQString();
}
- static int stringToErrorCond(const QString &s)
+ static int stringToErrorCond(const TQString &s)
{
for(int n = 0; errorCondTable[n].str; ++n) {
if(s == errorCondTable[n].str)
@@ -164,17 +164,17 @@ public:
return -1;
}
- static QString errorCondToString(int x)
+ static TQString errorCondToString(int x)
{
for(int n = 0; errorCondTable[n].str; ++n) {
if(x == errorCondTable[n].cond)
return errorCondTable[n].str;
}
- return QString();
+ return TQString();
}
Stream *s;
- QDomElement e;
+ TQDomElement e;
};
Stanza::Private::ErrorTypeEntry Stanza::Private::errorTypeTable[] =
@@ -215,7 +215,7 @@ Stanza::Stanza()
d = 0;
}
-Stanza::Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QString &id)
+Stanza::Stanza(Stream *s, Kind k, const Jid &to, const TQString &type, const TQString &id)
{
d = new Private;
@@ -235,7 +235,7 @@ Stanza::Stanza(Stream *s, Kind k, const Jid &to, const QString &type, const QStr
setId(id);
}
-Stanza::Stanza(Stream *s, const QDomElement &e)
+Stanza::Stanza(Stream *s, const TQDomElement &e)
{
d = 0;
if(e.namespaceURI() != s->baseNS())
@@ -273,59 +273,59 @@ bool Stanza::isNull() const
return (d ? false: true);
}
-QDomElement Stanza::element() const
+TQDomElement Stanza::element() const
{
return d->e;
}
-QString Stanza::toString() const
+TQString Stanza::toString() const
{
return Stream::xmlToString(d->e);
}
-QDomDocument & Stanza::doc() const
+TQDomDocument & Stanza::doc() const
{
return d->s->doc();
}
-QString Stanza::baseNS() const
+TQString Stanza::baseNS() const
{
return d->s->baseNS();
}
-QString Stanza::xhtmlImNS() const
+TQString Stanza::xhtmlImNS() const
{
return d->s->xhtmlImNS();
}
-QString Stanza::xhtmlNS() const
+TQString Stanza::xhtmlNS() const
{
return d->s->xhtmlNS();
}
-QDomElement Stanza::createElement(const QString &ns, const QString &tagName)
+TQDomElement Stanza::createElement(const TQString &ns, const TQString &tagName)
{
return d->s->doc().createElementNS(ns, tagName);
}
-QDomElement Stanza::createTextElement(const QString &ns, const QString &tagName, const QString &text)
+TQDomElement Stanza::createTextElement(const TQString &ns, const TQString &tagName, const TQString &text)
{
- QDomElement e = d->s->doc().createElementNS(ns, tagName);
+ TQDomElement e = d->s->doc().createElementNS(ns, tagName);
e.appendChild(d->s->doc().createTextNode(text));
return e;
}
-QDomElement Stanza::createXHTMLElement(const QString &xHTML)
+TQDomElement Stanza::createXHTMLElement(const TQString &xHTML)
{
- QDomDocument doc;
+ TQDomDocument doc;
doc.setContent(xHTML, true);
- QDomElement root = doc.documentElement();
- //QDomElement e;
+ TQDomElement root = doc.documentElement();
+ //TQDomElement e;
return (root);
}
-void Stanza::appendChild(const QDomElement &e)
+void Stanza::appendChild(const TQDomElement &e)
{
d->e.appendChild(e);
}
@@ -350,19 +350,19 @@ Jid Stanza::from() const
return Jid(d->e.attribute("from"));
}
-QString Stanza::id() const
+TQString Stanza::id() const
{
return d->e.attribute("id");
}
-QString Stanza::type() const
+TQString Stanza::type() const
{
return d->e.attribute("type");
}
-QString Stanza::lang() const
+TQString Stanza::lang() const
{
- return d->e.attributeNS(NS_XML, "lang", QString());
+ return d->e.attributeNS(NS_XML, "lang", TQString());
}
void Stanza::setTo(const Jid &j)
@@ -375,17 +375,17 @@ void Stanza::setFrom(const Jid &j)
d->e.setAttribute("from", j.full());
}
-void Stanza::setId(const QString &id)
+void Stanza::setId(const TQString &id)
{
d->e.setAttribute("id", id);
}
-void Stanza::setType(const QString &type)
+void Stanza::setType(const TQString &type)
{
d->e.setAttribute("type", type);
}
-void Stanza::setLang(const QString &lang)
+void Stanza::setLang(const TQString &lang)
{
d->e.setAttribute("xml:lang", lang);
}
@@ -393,7 +393,7 @@ void Stanza::setLang(const QString &lang)
Stanza::Error Stanza::error() const
{
Error err;
- QDomElement e = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
+ TQDomElement e = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
if(e.isNull())
return err;
@@ -403,11 +403,11 @@ Stanza::Error Stanza::error() const
err.type = x;
// condition: find first element
- QDomNodeList nl = e.childNodes();
- QDomElement t;
+ TQDomNodeList nl = e.childNodes();
+ TQDomElement t;
uint n;
for(n = 0; n < nl.count(); ++n) {
- QDomNode i = nl.item(n);
+ TQDomNode i = nl.item(n);
if(i.isElement()) {
t = i.toElement();
break;
@@ -429,7 +429,7 @@ Stanza::Error Stanza::error() const
// appspec: find first non-standard namespaced element
nl = e.childNodes();
for(n = 0; n < nl.count(); ++n) {
- QDomNode i = nl.item(n);
+ TQDomNode i = nl.item(n);
if(i.isElement() && i.namespaceURI() != NS_STANZAS) {
err.appSpec = i.toElement();
break;
@@ -441,7 +441,7 @@ Stanza::Error Stanza::error() const
void Stanza::setError(const Error &err)
{
// create the element if necessary
- QDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
+ TQDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
if(errElem.isNull()) {
errElem = d->e.ownerDocument().createElementNS(d->s->baseNS(), "error");
d->e.appendChild(errElem);
@@ -449,13 +449,13 @@ void Stanza::setError(const Error &err)
// error type/condition
if(d->s->old()) {
- errElem.setAttribute("code", QString::number(err.condition));
+ errElem.setAttribute("code", TQString::number(err.condition));
}
else {
- QString stype = Private::errorTypeToString(err.type);
+ TQString stype = Private::errorTypeToString(err.type);
if(stype.isEmpty())
return;
- QString scond = Private::errorCondToString(err.condition);
+ TQString scond = Private::errorCondToString(err.condition);
if(scond.isEmpty())
return;
@@ -468,7 +468,7 @@ void Stanza::setError(const Error &err)
errElem.appendChild(d->e.ownerDocument().createTextNode(err.text));
}
else {
- QDomElement te = d->e.ownerDocument().createElementNS(d->s->baseNS(), "text");
+ TQDomElement te = d->e.ownerDocument().createElementNS(d->s->baseNS(), "text");
te.appendChild(d->e.ownerDocument().createTextNode(err.text));
errElem.appendChild(te);
}
@@ -479,7 +479,7 @@ void Stanza::setError(const Error &err)
void Stanza::clearError()
{
- QDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
+ TQDomElement errElem = d->e.elementsByTagNameNS(d->s->baseNS(), "error").item(0).toElement();
if(!errElem.isNull())
d->e.removeChild(errElem);
}
@@ -488,8 +488,8 @@ void Stanza::clearError()
// Stream
//----------------------------------------------------------------------------
static XmlProtocol *foo = 0;
-Stream::Stream(QObject *parent)
-:QObject(parent)
+Stream::Stream(TQObject *parent)
+:TQObject(parent)
{
}
@@ -497,17 +497,17 @@ Stream::~Stream()
{
}
-Stanza Stream::createStanza(Stanza::Kind k, const Jid &to, const QString &type, const QString &id)
+Stanza Stream::createStanza(Stanza::Kind k, const Jid &to, const TQString &type, const TQString &id)
{
return Stanza(this, k, to, type, id);
}
-Stanza Stream::createStanza(const QDomElement &e)
+Stanza Stream::createStanza(const TQDomElement &e)
{
return Stanza(this, e);
}
-QString Stream::xmlToString(const QDomElement &e, bool clip)
+TQString Stream::xmlToString(const TQDomElement &e, bool clip)
{
if(!foo)
foo = new CoreProtocol;
@@ -569,14 +569,14 @@ public:
}
Jid jid;
- QString server;
+ TQString server;
bool oldOnly;
bool allowPlain, mutualAuth;
bool haveLocalAddr;
- QHostAddress localAddr;
+ TQHostAddress localAddr;
Q_UINT16 localPort;
int minimumSSF, maximumSSF;
- QString sasl_mech;
+ TQString sasl_mech;
bool doBinding;
bool in_rrsig;
@@ -590,7 +590,7 @@ public:
CoreProtocol client;
CoreProtocol srv;
- QString defRealm;
+ TQString defRealm;
int mode;
int state;
@@ -600,51 +600,51 @@ public:
bool tls_warned, using_tls;
bool doAuth;
- QStringList sasl_mechlist;
+ TQStringList sasl_mechlist;
int errCond;
- QString errText;
- QDomElement errAppSpec;
+ TQString errText;
+ TQDomElement errAppSpec;
- QPtrList<Stanza> in;
+ TQPtrList<Stanza> in;
- QTimer noopTimer;
+ TQTimer noopTimer;
int noop_time;
};
-ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, QObject *parent)
+ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, TQObject *parent)
:Stream(parent)
{
d = new Private;
d->mode = Client;
d->conn = conn;
- connect(d->conn, SIGNAL(connected()), SLOT(cr_connected()));
- connect(d->conn, SIGNAL(error()), SLOT(cr_error()));
+ connect(d->conn, TQT_SIGNAL(connected()), TQT_SLOT(cr_connected()));
+ connect(d->conn, TQT_SIGNAL(error()), TQT_SLOT(cr_error()));
d->noop_time = 0;
- connect(&d->noopTimer, SIGNAL(timeout()), SLOT(doNoop()));
+ connect(&d->noopTimer, TQT_SIGNAL(timeout()), TQT_SLOT(doNoop()));
d->tlsHandler = tlsHandler;
}
-ClientStream::ClientStream(const QString &host, const QString &defRealm, ByteStream *bs, QCA::TLS *tls, QObject *parent)
+ClientStream::ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, QCA::TLS *tls, TQObject *parent)
:Stream(parent)
{
d = new Private;
d->mode = Server;
d->bs = bs;
- connect(d->bs, SIGNAL(connectionClosed()), SLOT(bs_connectionClosed()));
- connect(d->bs, SIGNAL(delayedCloseFinished()), SLOT(bs_delayedCloseFinished()));
- connect(d->bs, SIGNAL(error(int)), SLOT(bs_error(int)));
+ connect(d->bs, TQT_SIGNAL(connectionClosed()), TQT_SLOT(bs_connectionClosed()));
+ connect(d->bs, TQT_SIGNAL(delayedCloseFinished()), TQT_SLOT(bs_delayedCloseFinished()));
+ connect(d->bs, TQT_SIGNAL(error(int)), TQT_SLOT(bs_error(int)));
- QByteArray spare = d->bs->read();
+ TQByteArray spare = d->bs->read();
d->ss = new SecureStream(d->bs);
- connect(d->ss, SIGNAL(readyRead()), SLOT(ss_readyRead()));
- connect(d->ss, SIGNAL(bytesWritten(int)), SLOT(ss_bytesWritten(int)));
- connect(d->ss, SIGNAL(tlsHandshaken()), SLOT(ss_tlsHandshaken()));
- connect(d->ss, SIGNAL(tlsClosed()), SLOT(ss_tlsClosed()));
- connect(d->ss, SIGNAL(error(int)), SLOT(ss_error(int)));
+ connect(d->ss, TQT_SIGNAL(readyRead()), TQT_SLOT(ss_readyRead()));
+ connect(d->ss, TQT_SIGNAL(bytesWritten(int)), TQT_SLOT(ss_bytesWritten(int)));
+ connect(d->ss, TQT_SIGNAL(tlsHandshaken()), TQT_SLOT(ss_tlsHandshaken()));
+ connect(d->ss, TQT_SIGNAL(tlsClosed()), TQT_SLOT(ss_tlsClosed()));
+ connect(d->ss, TQT_SIGNAL(error(int)), TQT_SLOT(ss_error(int)));
d->server = host;
d->defRealm = defRealm;
@@ -655,7 +655,7 @@ ClientStream::ClientStream(const QString &host, const QString &defRealm, ByteStr
//d->srv.startServerIn(genId());
//d->state = Connecting;
//d->jid = Jid();
- //d->server = QString();
+ //d->server = TQString();
}
ClientStream::~ClientStream()
@@ -761,13 +761,13 @@ bool ClientStream::isAuthenticated() const
return (d->state == Active) ? true: false;
}
-void ClientStream::setUsername(const QString &s)
+void ClientStream::setUsername(const TQString &s)
{
if(d->sasl)
d->sasl->setUsername(s);
}
-void ClientStream::setPassword(const QString &s)
+void ClientStream::setPassword(const TQString &s)
{
if(d->client.old) {
d->client.setPassword(s);
@@ -778,7 +778,7 @@ void ClientStream::setPassword(const QString &s)
}
}
-void ClientStream::setRealm(const QString &s)
+void ClientStream::setRealm(const TQString &s)
{
if(d->sasl)
d->sasl->setRealm(s);
@@ -817,7 +817,7 @@ void ClientStream::setNoopTime(int mills)
d->noopTimer.start(d->noop_time);
}
-QString ClientStream::saslMechanism() const
+TQString ClientStream::saslMechanism() const
{
return d->client.saslMech();
}
@@ -827,12 +827,12 @@ int ClientStream::saslSSF() const
return d->sasl_ssf;
}
-void ClientStream::setSASLMechanism(const QString &s)
+void ClientStream::setSASLMechanism(const TQString &s)
{
d->sasl_mech = s;
}
-void ClientStream::setLocalAddr(const QHostAddress &addr, Q_UINT16 port)
+void ClientStream::setLocalAddr(const TQHostAddress &addr, Q_UINT16 port)
{
d->haveLocalAddr = true;
d->localAddr = addr;
@@ -844,12 +844,12 @@ int ClientStream::errorCondition() const
return d->errCond;
}
-QString ClientStream::errorText() const
+TQString ClientStream::errorText() const
{
return d->errText;
}
-QDomElement ClientStream::errorAppSpec() const
+TQDomElement ClientStream::errorAppSpec() const
{
return d->errAppSpec;
}
@@ -871,22 +871,22 @@ void ClientStream::close()
}
}
-QDomDocument & ClientStream::doc() const
+TQDomDocument & ClientStream::doc() const
{
return d->client.doc;
}
-QString ClientStream::baseNS() const
+TQString ClientStream::baseNS() const
{
return NS_CLIENT;
}
-QString ClientStream::xhtmlImNS() const
+TQString ClientStream::xhtmlImNS() const
{
return NS_XHTML_IM;
}
-QString ClientStream::xhtmlNS() const
+TQString ClientStream::xhtmlNS() const
{
return NS_XHTML;
}
@@ -940,17 +940,17 @@ void ClientStream::write(const Stanza &s)
void ClientStream::cr_connected()
{
d->bs = d->conn->stream();
- connect(d->bs, SIGNAL(connectionClosed()), SLOT(bs_connectionClosed()));
- connect(d->bs, SIGNAL(delayedCloseFinished()), SLOT(bs_delayedCloseFinished()));
+ connect(d->bs, TQT_SIGNAL(connectionClosed()), TQT_SLOT(bs_connectionClosed()));
+ connect(d->bs, TQT_SIGNAL(delayedCloseFinished()), TQT_SLOT(bs_delayedCloseFinished()));
- QByteArray spare = d->bs->read();
+ TQByteArray spare = d->bs->read();
d->ss = new SecureStream(d->bs);
- connect(d->ss, SIGNAL(readyRead()), SLOT(ss_readyRead()));
- connect(d->ss, SIGNAL(bytesWritten(int)), SLOT(ss_bytesWritten(int)));
- connect(d->ss, SIGNAL(tlsHandshaken()), SLOT(ss_tlsHandshaken()));
- connect(d->ss, SIGNAL(tlsClosed()), SLOT(ss_tlsClosed()));
- connect(d->ss, SIGNAL(error(int)), SLOT(ss_error(int)));
+ connect(d->ss, TQT_SIGNAL(readyRead()), TQT_SLOT(ss_readyRead()));
+ connect(d->ss, TQT_SIGNAL(bytesWritten(int)), TQT_SLOT(ss_bytesWritten(int)));
+ connect(d->ss, TQT_SIGNAL(tlsHandshaken()), TQT_SLOT(ss_tlsHandshaken()));
+ connect(d->ss, TQT_SIGNAL(tlsClosed()), TQT_SLOT(ss_tlsClosed()));
+ connect(d->ss, TQT_SIGNAL(error(int)), TQT_SLOT(ss_error(int)));
//d->client.startDialbackOut("andbit.net", "im.pyxa.org");
//d->client.startServerOut(d->server);
@@ -968,7 +968,7 @@ void ClientStream::cr_connected()
d->client.doTLS = d->tlsHandler ? true: false;
d->client.doBinding = d->doBinding;*/
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
connected();
if(!self)
return;
@@ -1008,10 +1008,10 @@ void ClientStream::bs_error(int)
void ClientStream::ss_readyRead()
{
- QByteArray a = d->ss->read();
+ TQByteArray a = d->ss->read();
#ifdef XMPP_DEBUG
- QCString cs(a.data(), a.size()+1);
+ TQCString cs(a.data(), a.size()+1);
fprintf(stderr, "ClientStream: recv: %d [%s]\n", a.size(), cs.data());
#endif
@@ -1044,7 +1044,7 @@ void ClientStream::ss_bytesWritten(int bytes)
void ClientStream::ss_tlsHandshaken()
{
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
securityLayerActivated(LayerTLS);
if(!self)
return;
@@ -1070,17 +1070,17 @@ void ClientStream::ss_error(int x)
}
}
-void ClientStream::sasl_clientFirstStep(const QString &mech, const QByteArray *stepData)
+void ClientStream::sasl_clientFirstStep(const TQString &mech, const TQByteArray *stepData)
{
- d->client.setSASLFirst(mech, stepData ? *stepData : QByteArray());
+ d->client.setSASLFirst(mech, stepData ? *stepData : TQByteArray());
//d->client.sasl_mech = mech;
//d->client.sasl_firstStep = stepData ? true : false;
- //d->client.sasl_step = stepData ? *stepData : QByteArray();
+ //d->client.sasl_step = stepData ? *stepData : TQByteArray();
processNext();
}
-void ClientStream::sasl_nextStep(const QByteArray &stepData)
+void ClientStream::sasl_nextStep(const TQByteArray &stepData)
{
if(d->mode == Client)
d->client.setSASLNext(stepData);
@@ -1109,12 +1109,12 @@ void ClientStream::sasl_needParams(bool user, bool authzid, bool pass, bool real
d->sasl->continueAfterParams();
}
-void ClientStream::sasl_authCheck(const QString &user, const QString &)
+void ClientStream::sasl_authCheck(const TQString &user, const TQString &)
{
//#ifdef XMPP_DEBUG
// printf("authcheck: [%s], [%s]\n", user.latin1(), authzid.latin1());
//#endif
- QString u = user;
+ TQString u = user;
int n = u.find('@');
if(n != -1)
u.truncate(n);
@@ -1163,10 +1163,10 @@ void ClientStream::srvProcessNext()
else if(need == CoreProtocol::NSASLMechs) {
if(!d->sasl) {
d->sasl = new QCA::SASL;
- connect(d->sasl, SIGNAL(authCheck(const QString &, const QString &)), SLOT(sasl_authCheck(const QString &, const QString &)));
- connect(d->sasl, SIGNAL(nextStep(const QByteArray &)), SLOT(sasl_nextStep(const QByteArray &)));
- connect(d->sasl, SIGNAL(authenticated()), SLOT(sasl_authenticated()));
- connect(d->sasl, SIGNAL(error(int)), SLOT(sasl_error(int)));
+ connect(d->sasl, TQT_SIGNAL(authCheck(const TQString &, const TQString &)), TQT_SLOT(sasl_authCheck(const TQString &, const TQString &)));
+ connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &)));
+ connect(d->sasl, TQT_SIGNAL(authenticated()), TQT_SLOT(sasl_authenticated()));
+ connect(d->sasl, TQT_SIGNAL(error(int)), TQT_SLOT(sasl_error(int)));
//d->sasl->setAllowAnonymous(false);
//d->sasl->setRequirePassCredentials(true);
@@ -1175,7 +1175,7 @@ void ClientStream::srvProcessNext()
d->sasl->setMinimumSSF(0);
d->sasl->setMaximumSSF(256);
- QStringList list;
+ TQStringList list;
// TODO: d->server is probably wrong here
if(!d->sasl->startServer("xmpp", d->server, d->defRealm, &list)) {
printf("Error initializing SASL\n");
@@ -1193,18 +1193,18 @@ void ClientStream::srvProcessNext()
// TODO
return;
}
- QByteArray a = d->srv.spare;
+ TQByteArray a = d->srv.spare;
d->ss->startTLSServer(d->tls, a);
}
else if(need == CoreProtocol::NSASLFirst) {
printf("Need SASL First Step\n");
- QByteArray a = d->srv.saslStep();
+ TQByteArray a = d->srv.saslStep();
d->sasl->putServerFirstStep(d->srv.saslMech(), a);
}
else if(need == CoreProtocol::NSASLNext) {
printf("Need SASL Next Step\n");
- QByteArray a = d->srv.saslStep();
- QCString cs(a.data(), a.size()+1);
+ TQByteArray a = d->srv.saslStep();
+ TQCString cs(a.data(), a.size()+1);
printf("[%s]\n", cs.data());
d->sasl->putStep(a);
}
@@ -1230,8 +1230,8 @@ void ClientStream::srvProcessNext()
return;
}
case CoreProtocol::ESend: {
- QByteArray a = d->srv.takeOutgoingData();
- QCString cs(a.size()+1);
+ TQByteArray a = d->srv.takeOutgoingData();
+ TQCString cs(a.size()+1);
memcpy(cs.data(), a.data(), a.size());
printf("Need Send: {%s}\n", cs.data());
d->ss->write(a);
@@ -1241,7 +1241,7 @@ void ClientStream::srvProcessNext()
printf("Break (RecvOpen)\n");
// calculate key
- QCString str = QCA::SHA1::hashToString("secret").utf8();
+ TQCString str = QCA::SHA1::hashToString("secret").utf8();
str = QCA::SHA1::hashToString(str + "im.pyxa.org").utf8();
str = QCA::SHA1::hashToString(str + d->srv.id.utf8()).utf8();
d->srv.setDialbackKey(str);
@@ -1258,8 +1258,8 @@ void ClientStream::srvProcessNext()
}
case CoreProtocol::ESASLSuccess: {
printf("Break SASL Success\n");
- disconnect(d->sasl, SIGNAL(error(int)), this, SLOT(sasl_error(int)));
- QByteArray a = d->srv.spare;
+ disconnect(d->sasl, TQT_SIGNAL(error(int)), this, TQT_SLOT(sasl_error(int)));
+ TQByteArray a = d->srv.spare;
d->ss->setLayerSASL(d->sasl, a);
break;
}
@@ -1276,7 +1276,7 @@ void ClientStream::srvProcessNext()
void ClientStream::doReadyRead()
{
- //QGuardedPtr<QObject> self = this;
+ //TQGuardedPtr<TQObject> self = this;
readyRead();
//if(!self)
// return;
@@ -1290,7 +1290,7 @@ void ClientStream::processNext()
return;
}
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
while(1) {
#ifdef XMPP_DEBUG
@@ -1298,11 +1298,11 @@ void ClientStream::processNext()
#endif
bool ok = d->client.processStep();
// deal with send/received items
- for(QValueList<XmlProtocol::TransferItem>::ConstIterator it = d->client.transferItemList.begin(); it != d->client.transferItemList.end(); ++it) {
+ for(TQValueList<XmlProtocol::TransferItem>::ConstIterator it = d->client.transferItemList.begin(); it != d->client.transferItemList.end(); ++it) {
const XmlProtocol::TransferItem &i = *it;
if(i.isExternal)
continue;
- QString str;
+ TQString str;
if(i.isString) {
// skip whitespace pings
if(i.str.stripWhiteSpace().isEmpty())
@@ -1324,7 +1324,7 @@ void ClientStream::processNext()
//if(!d->in_rrsig && !d->in.isEmpty()) {
if(!d->in.isEmpty()) {
//d->in_rrsig = true;
- QTimer::singleShot(0, this, SLOT(doReadyRead()));
+ TQTimer::singleShot(0, this, TQT_SLOT(doReadyRead()));
}
if(cont)
@@ -1343,9 +1343,9 @@ void ClientStream::processNext()
return;
}
case CoreProtocol::ESend: {
- QByteArray a = d->client.takeOutgoingData();
+ TQByteArray a = d->client.takeOutgoingData();
#ifdef XMPP_DEBUG
- QCString cs(a.size()+1);
+ TQCString cs(a.size()+1);
memcpy(cs.data(), a.data(), a.size());
printf("Need Send: {%s}\n", cs.data());
#endif
@@ -1358,9 +1358,9 @@ void ClientStream::processNext()
#endif
#ifdef XMPP_TEST
- QString s = QString("handshake success (lang=[%1]").arg(d->client.lang);
+ TQString s = TQString("handshake success (lang=[%1]").arg(d->client.lang);
if(!d->client.from.isEmpty())
- s += QString(", from=[%1]").arg(d->client.from);
+ s += TQString(", from=[%1]").arg(d->client.from);
s += ')';
TD::msg(s);
#endif
@@ -1480,11 +1480,11 @@ bool ClientStream::handleNeed()
}
d->sasl = new QCA::SASL;
- connect(d->sasl, SIGNAL(clientFirstStep(const QString &, const QByteArray *)), SLOT(sasl_clientFirstStep(const QString &, const QByteArray *)));
- connect(d->sasl, SIGNAL(nextStep(const QByteArray &)), SLOT(sasl_nextStep(const QByteArray &)));
- connect(d->sasl, SIGNAL(needParams(bool, bool, bool, bool)), SLOT(sasl_needParams(bool, bool, bool, bool)));
- connect(d->sasl, SIGNAL(authenticated()), SLOT(sasl_authenticated()));
- connect(d->sasl, SIGNAL(error(int)), SLOT(sasl_error(int)));
+ connect(d->sasl, TQT_SIGNAL(clientFirstStep(const TQString &, const TQByteArray *)), TQT_SLOT(sasl_clientFirstStep(const TQString &, const TQByteArray *)));
+ connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &)));
+ connect(d->sasl, TQT_SIGNAL(needParams(bool, bool, bool, bool)), TQT_SLOT(sasl_needParams(bool, bool, bool, bool)));
+ connect(d->sasl, TQT_SIGNAL(authenticated()), TQT_SLOT(sasl_authenticated()));
+ connect(d->sasl, TQT_SIGNAL(error(int)), TQT_SLOT(sasl_error(int)));
if(d->haveLocalAddr)
d->sasl->setLocalAddr(d->localAddr, d->localPort);
@@ -1506,7 +1506,7 @@ bool ClientStream::handleNeed()
d->sasl->setMinimumSSF(d->minimumSSF);
d->sasl->setMaximumSSF(d->maximumSSF);
- QStringList ml;
+ TQStringList ml;
if(!d->sasl_mech.isEmpty())
ml += d->sasl_mech;
else
@@ -1525,16 +1525,16 @@ bool ClientStream::handleNeed()
#ifdef XMPP_DEBUG
printf("Need SASL Next Step\n");
#endif
- QByteArray a = d->client.saslStep();
+ TQByteArray a = d->client.saslStep();
d->sasl->putStep(a);
return false;
}
case CoreProtocol::NSASLLayer: {
// SecureStream will handle the errors from this point
- disconnect(d->sasl, SIGNAL(error(int)), this, SLOT(sasl_error(int)));
+ disconnect(d->sasl, TQT_SIGNAL(error(int)), this, TQT_SLOT(sasl_error(int)));
d->ss->setLayerSASL(d->sasl, d->client.spare);
if(d->sasl_ssf > 0) {
- QGuardedPtr<QObject> self = this;
+ TQGuardedPtr<TQObject> self = this;
securityLayerActivated(LayerSASL);
if(!self)
return false;
@@ -1580,7 +1580,7 @@ void ClientStream::doNoop()
}
}
-void ClientStream::writeDirect(const QString &s)
+void ClientStream::writeDirect(const TQString &s)
{
if(d->state == Active) {
#ifdef XMPP_DEBUG
@@ -1604,8 +1604,8 @@ void ClientStream::handleError()
}
else if(c == CoreProtocol::ErrStream) {
int x = d->client.errCond;
- QString text = d->client.errText;
- QDomElement appSpec = d->client.errAppSpec;
+ TQString text = d->client.errText;
+ TQDomElement appSpec = d->client.errAppSpec;
int connErr = -1;
int strErr = -1;
@@ -1730,31 +1730,31 @@ TD::~TD()
{
}
-void TD::msg(const QString &s)
+void TD::msg(const TQString &s)
{
if(debug_ptr)
debug_ptr->msg(s);
}
-void TD::outgoingTag(const QString &s)
+void TD::outgoingTag(const TQString &s)
{
if(debug_ptr)
debug_ptr->outgoingTag(s);
}
-void TD::incomingTag(const QString &s)
+void TD::incomingTag(const TQString &s)
{
if(debug_ptr)
debug_ptr->incomingTag(s);
}
-void TD::outgoingXml(const QDomElement &e)
+void TD::outgoingXml(const TQDomElement &e)
{
if(debug_ptr)
debug_ptr->outgoingXml(e);
}
-void TD::incomingXml(const QDomElement &e)
+void TD::incomingXml(const TQDomElement &e)
{
if(debug_ptr)
debug_ptr->incomingXml(e);
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/td.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/td.h
index b636e190..f4d560f4 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/td.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/td.h
@@ -1,7 +1,7 @@
#ifndef TESTDEBUG_H
#define TESTDEBUG_H
-#include<qdom.h>
+#include<tqdom.h>
class TD
{
@@ -9,11 +9,11 @@ public:
TD();
~TD();
- static void msg(const QString &);
- static void outgoingTag(const QString &);
- static void incomingTag(const QString &);
- static void outgoingXml(const QDomElement &);
- static void incomingXml(const QDomElement &);
+ static void msg(const TQString &);
+ static void outgoingTag(const TQString &);
+ static void incomingTag(const TQString &);
+ static void outgoingXml(const TQDomElement &);
+ static void incomingXml(const TQDomElement &);
};
#endif
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp
index 24d77598..313c6b6a 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp
@@ -20,7 +20,7 @@
#include"xmpp.h"
-#include<qtimer.h>
+#include<tqtimer.h>
#include"qca.h"
using namespace XMPP;
@@ -28,8 +28,8 @@ using namespace XMPP;
//----------------------------------------------------------------------------
// TLSHandler
//----------------------------------------------------------------------------
-TLSHandler::TLSHandler(QObject *parent)
-:QObject(parent)
+TLSHandler::TLSHandler(TQObject *parent)
+:TQObject(parent)
{
}
@@ -53,11 +53,11 @@ QCATLSHandler::QCATLSHandler(QCA::TLS *parent)
{
d = new Private;
d->tls = parent;
- connect(d->tls, SIGNAL(handshaken()), SLOT(tls_handshaken()));
- connect(d->tls, SIGNAL(readyRead()), SLOT(tls_readyRead()));
- connect(d->tls, SIGNAL(readyReadOutgoing(int)), SLOT(tls_readyReadOutgoing(int)));
- connect(d->tls, SIGNAL(closed()), SLOT(tls_closed()));
- connect(d->tls, SIGNAL(error(int)), SLOT(tls_error(int)));
+ connect(d->tls, TQT_SIGNAL(handshaken()), TQT_SLOT(tls_handshaken()));
+ connect(d->tls, TQT_SIGNAL(readyRead()), TQT_SLOT(tls_readyRead()));
+ connect(d->tls, TQT_SIGNAL(readyReadOutgoing(int)), TQT_SLOT(tls_readyReadOutgoing(int)));
+ connect(d->tls, TQT_SIGNAL(closed()), TQT_SLOT(tls_closed()));
+ connect(d->tls, TQT_SIGNAL(error(int)), TQT_SLOT(tls_error(int)));
d->state = 0;
d->err = -1;
}
@@ -83,20 +83,20 @@ void QCATLSHandler::reset()
d->state = 0;
}
-void QCATLSHandler::startClient(const QString &host)
+void QCATLSHandler::startClient(const TQString &host)
{
d->state = 0;
d->err = -1;
if(!d->tls->startClient(host))
- QTimer::singleShot(0, this, SIGNAL(fail()));
+ TQTimer::singleShot(0, this, TQT_SIGNAL(fail()));
}
-void QCATLSHandler::write(const QByteArray &a)
+void QCATLSHandler::write(const TQByteArray &a)
{
d->tls->write(a);
}
-void QCATLSHandler::writeIncoming(const QByteArray &a)
+void QCATLSHandler::writeIncoming(const TQByteArray &a)
{
d->tls->writeIncoming(a);
}
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.cpp
index 0ae15585..de321e7c 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.cpp
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.cpp
@@ -30,10 +30,10 @@ using namespace XMPP;
// display purposes only (the element is pretty much useless for processing
// after this). We do this because QXml is a bit overzealous about outputting
// redundant namespaces.
-static QDomElement stripExtraNS(const QDomElement &e)
+static TQDomElement stripExtraNS(const TQDomElement &e)
{
// find closest parent with a namespace
- QDomNode par = e.parentNode();
+ TQDomNode par = e.parentNode();
while(!par.isNull() && par.namespaceURI().isNull())
par = par.parentNode();
bool noShowNS = false;
@@ -41,13 +41,13 @@ static QDomElement stripExtraNS(const QDomElement &e)
noShowNS = true;
// build qName (prefix:localName)
- QString qName;
+ TQString qName;
if(!e.prefix().isEmpty())
qName = e.prefix() + ':' + e.localName();
else
qName = e.tagName();
- QDomElement i;
+ TQDomElement i;
uint x;
if(noShowNS)
i = e.ownerDocument().createElement(qName);
@@ -55,21 +55,21 @@ static QDomElement stripExtraNS(const QDomElement &e)
i = e.ownerDocument().createElementNS(e.namespaceURI(), qName);
// copy attributes
- QDomNamedNodeMap al = e.attributes();
+ TQDomNamedNodeMap al = e.attributes();
for(x = 0; x < al.count(); ++x) {
- QDomAttr a = al.item(x).cloneNode().toAttr();
+ TQDomAttr a = al.item(x).cloneNode().toAttr();
// don't show xml namespace
if(a.namespaceURI() == NS_XML)
- i.setAttribute(QString("xml:") + a.name(), a.value());
+ i.setAttribute(TQString("xml:") + a.name(), a.value());
else
i.setAttributeNodeNS(a);
}
// copy children
- QDomNodeList nl = e.childNodes();
+ TQDomNodeList nl = e.childNodes();
for(x = 0; x < nl.count(); ++x) {
- QDomNode n = nl.item(x);
+ TQDomNode n = nl.item(x);
if(n.isElement())
i.appendChild(stripExtraNS(n.toElement()));
else
@@ -80,20 +80,20 @@ static QDomElement stripExtraNS(const QDomElement &e)
// xmlToString
//
-// This function converts a QDomElement into a QString, using stripExtraNS
+// This function converts a TQDomElement into a TQString, using stripExtraNS
// to make it pretty.
-static QString xmlToString(const QDomElement &e, const QString &fakeNS, const QString &fakeQName, bool clip)
+static TQString xmlToString(const TQDomElement &e, const TQString &fakeNS, const TQString &fakeQName, bool clip)
{
- QDomElement i = e.cloneNode().toElement();
+ TQDomElement i = e.cloneNode().toElement();
// It seems QDom can only have one namespace attribute at a time (see docElement 'HACK').
// Fortunately we only need one kind depending on the input, so it is specified here.
- QDomElement fake = e.ownerDocument().createElementNS(fakeNS, fakeQName);
+ TQDomElement fake = e.ownerDocument().createElementNS(fakeNS, fakeQName);
fake.appendChild(i);
fake = stripExtraNS(fake);
- QString out;
+ TQString out;
{
- QTextStream ts(&out, IO_WriteOnly);
+ TQTextStream ts(&out, IO_WriteOnly);
fake.firstChild().save(ts, 0);
}
// 'clip' means to remove any unwanted (and unneeded) characters, such as a trailing newline
@@ -112,18 +112,18 @@ static QString xmlToString(const QDomElement &e, const QString &fakeNS, const QS
// text needed to open/close an XML stream, without resorting to generating
// the XML ourselves. This function uses QDom to do the generation, which
// ensures proper encoding and entity output.
-static void createRootXmlTags(const QDomElement &root, QString *xmlHeader, QString *tagOpen, QString *tagClose)
+static void createRootXmlTags(const TQDomElement &root, TQString *xmlHeader, TQString *tagOpen, TQString *tagClose)
{
- QDomElement e = root.cloneNode(false).toElement();
+ TQDomElement e = root.cloneNode(false).toElement();
// insert a dummy element to ensure open and closing tags are generated
- QDomElement dummy = e.ownerDocument().createElement("dummy");
+ TQDomElement dummy = e.ownerDocument().createElement("dummy");
e.appendChild(dummy);
// convert to xml->text
- QString str;
+ TQString str;
{
- QTextStream ts(&str, IO_WriteOnly);
+ TQTextStream ts(&str, IO_WriteOnly);
e.save(ts, 0);
}
@@ -148,7 +148,7 @@ XmlProtocol::TransferItem::TransferItem()
{
}
-XmlProtocol::TransferItem::TransferItem(const QString &_str, bool sent, bool external)
+XmlProtocol::TransferItem::TransferItem(const TQString &_str, bool sent, bool external)
{
isString = true;
isSent = sent;
@@ -156,7 +156,7 @@ XmlProtocol::TransferItem::TransferItem(const QString &_str, bool sent, bool ext
str = _str;
}
-XmlProtocol::TransferItem::TransferItem(const QDomElement &_elem, bool sent, bool external)
+XmlProtocol::TransferItem::TransferItem(const TQDomElement &_elem, bool sent, bool external)
{
isString = false;
isSent = sent;
@@ -184,30 +184,30 @@ void XmlProtocol::reset()
{
init();
- elem = QDomElement();
- tagOpen = QString();
- tagClose = QString();
+ elem = TQDomElement();
+ tagOpen = TQString();
+ tagClose = TQString();
xml.reset();
outData.resize(0);
trackQueue.clear();
transferItemList.clear();
}
-void XmlProtocol::addIncomingData(const QByteArray &a)
+void XmlProtocol::addIncomingData(const TQByteArray &a)
{
xml.appendData(a);
}
-QByteArray XmlProtocol::takeOutgoingData()
+TQByteArray XmlProtocol::takeOutgoingData()
{
- QByteArray a = outData.copy();
+ TQByteArray a = outData.copy();
outData.resize(0);
return a;
}
void XmlProtocol::outgoingDataWritten(int bytes)
{
- for(QValueList<TrackItem>::Iterator it = trackQueue.begin(); it != trackQueue.end();) {
+ for(TQValueList<TrackItem>::Iterator it = trackQueue.begin(); it != trackQueue.end();) {
TrackItem &i = *it;
// enough bytes?
@@ -302,21 +302,21 @@ bool XmlProtocol::processStep()
return baseStep(pe);
}
-QString XmlProtocol::xmlEncoding() const
+TQString XmlProtocol::xmlEncoding() const
{
return xml.encoding();
}
-QString XmlProtocol::elementToString(const QDomElement &e, bool clip)
+TQString XmlProtocol::elementToString(const TQDomElement &e, bool clip)
{
if(elem.isNull())
elem = elemDoc.importNode(docElement(), true).toElement();
// Determine the appropriate 'fakeNS' to use
- QString ns;
+ TQString ns;
// first, check root namespace
- QString pre = e.prefix();
+ TQString pre = e.prefix();
if(pre.isNull())
pre = "";
if(pre == elem.prefix()) {
@@ -324,11 +324,11 @@ QString XmlProtocol::elementToString(const QDomElement &e, bool clip)
}
else {
// scan the root attributes for 'xmlns' (oh joyous hacks)
- QDomNamedNodeMap al = elem.attributes();
+ TQDomNamedNodeMap al = elem.attributes();
uint n;
for(n = 0; n < al.count(); ++n) {
- QDomAttr a = al.item(n).toAttr();
- QString s = a.name();
+ TQDomAttr a = al.item(n).toAttr();
+ TQString s = a.name();
int x = s.find(':');
if(x != -1)
s = s.mid(x+1);
@@ -346,7 +346,7 @@ QString XmlProtocol::elementToString(const QDomElement &e, bool clip)
}
// build qName
- QString qn;
+ TQString qn;
if(!elem.prefix().isEmpty())
qn = elem.prefix() + ':';
qn += elem.localName();
@@ -366,22 +366,22 @@ void XmlProtocol::itemWritten(int, int)
// default does nothing
}
-void XmlProtocol::stringSend(const QString &)
+void XmlProtocol::stringSend(const TQString &)
{
// default does nothing
}
-void XmlProtocol::stringRecv(const QString &)
+void XmlProtocol::stringRecv(const TQString &)
{
// default does nothing
}
-void XmlProtocol::elementSend(const QDomElement &)
+void XmlProtocol::elementSend(const TQDomElement &)
{
// default does nothing
}
-void XmlProtocol::elementRecv(const QDomElement &)
+void XmlProtocol::elementRecv(const TQDomElement &)
{
// default does nothing
}
@@ -406,24 +406,24 @@ bool XmlProtocol::close()
return true;
}
-int XmlProtocol::writeString(const QString &s, int id, bool external)
+int XmlProtocol::writeString(const TQString &s, int id, bool external)
{
transferItemList += TransferItem(s, true, external);
return internalWriteString(s, TrackItem::Custom, id);
}
-int XmlProtocol::writeElement(const QDomElement &e, int id, bool external, bool clip)
+int XmlProtocol::writeElement(const TQDomElement &e, int id, bool external, bool clip)
{
if(e.isNull())
return 0;
transferItemList += TransferItem(e, true, external);
//elementSend(e);
- QString out = elementToString(e, clip);
+ TQString out = elementToString(e, clip);
return internalWriteString(out, TrackItem::Custom, id);
}
-QByteArray XmlProtocol::resetStream()
+TQByteArray XmlProtocol::resetStream()
{
// reset the state
if(incoming)
@@ -432,12 +432,12 @@ QByteArray XmlProtocol::resetStream()
state = SendOpen;
// grab unprocessed data before resetting
- QByteArray spare = xml.unprocessed();
+ TQByteArray spare = xml.unprocessed();
xml.reset();
return spare;
}
-int XmlProtocol::internalWriteData(const QByteArray &a, TrackItem::Type t, int id)
+int XmlProtocol::internalWriteData(const TQByteArray &a, TrackItem::Type t, int id)
{
TrackItem i;
i.type = t;
@@ -449,10 +449,10 @@ int XmlProtocol::internalWriteData(const QByteArray &a, TrackItem::Type t, int i
return a.size();
}
-int XmlProtocol::internalWriteString(const QString &s, TrackItem::Type t, int id)
+int XmlProtocol::internalWriteString(const TQString &s, TrackItem::Type t, int id)
{
- QCString cs = s.utf8();
- QByteArray a(cs.length());
+ TQCString cs = s.utf8();
+ TQByteArray a(cs.length());
memcpy(a.data(), cs.data(), a.size());
return internalWriteData(a, t, id);
}
@@ -462,10 +462,10 @@ void XmlProtocol::sendTagOpen()
if(elem.isNull())
elem = elemDoc.importNode(docElement(), true).toElement();
- QString xmlHeader;
+ TQString xmlHeader;
createRootXmlTags(elem, &xmlHeader, &tagOpen, &tagClose);
- QString s;
+ TQString s;
s += xmlHeader + '\n';
s += tagOpen + '\n';
@@ -509,7 +509,7 @@ bool XmlProtocol::baseStep(const Parser::Event &pe)
return true;
}
else if(state == Open) {
- QDomElement e;
+ TQDomElement e;
if(pe.type() == Parser::Event::Element)
e = pe.element();
return doStep(e);
@@ -533,7 +533,7 @@ bool XmlProtocol::baseStep(const Parser::Event &pe)
void XmlProtocol::setIncomingAsExternal()
{
- for(QValueList<TransferItem>::Iterator it = transferItemList.begin(); it != transferItemList.end(); ++it) {
+ for(TQValueList<TransferItem>::Iterator it = transferItemList.begin(); it != transferItemList.end(); ++it) {
TransferItem &i = *it;
// look for elements received
if(!i.isString && !i.isSent)
diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.h
index 16ff8e01..e3da8a09 100644
--- a/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.h
+++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/xmlprotocol.h
@@ -21,8 +21,8 @@
#ifndef XMLPROTOCOL_H
#define XMLPROTOCOL_H
-#include<qdom.h>
-#include<qvaluelist.h>
+#include<tqdom.h>
+#include<tqvaluelist.h>
#include"parser.h"
#define NS_XML "http://www.w3.org/XML/1998/namespace"
@@ -59,8 +59,8 @@ namespace XMPP
virtual void reset();
// byte I/O for the stream
- void addIncomingData(const QByteArray &);
- QByteArray takeOutgoingData();
+ void addIncomingData(const TQByteArray &);
+ TQByteArray takeOutgoingData();
void outgoingDataWritten(int);
// advance the state machine
@@ -70,47 +70,47 @@ namespace XMPP
int need, event, errorCode, notify;
inline bool isIncoming() const { return incoming; }
- QString xmlEncoding() const;
- QString elementToString(const QDomElement &e, bool clip=false);
+ TQString xmlEncoding() const;
+ TQString elementToString(const TQDomElement &e, bool clip=false);
class TransferItem
{
public:
TransferItem();
- TransferItem(const QString &str, bool sent, bool external=false);
- TransferItem(const QDomElement &elem, bool sent, bool external=false);
+ TransferItem(const TQString &str, bool sent, bool external=false);
+ TransferItem(const TQDomElement &elem, bool sent, bool external=false);
bool isSent; // else, received
bool isString; // else, is element
bool isExternal; // not owned by protocol
- QString str;
- QDomElement elem;
+ TQString str;
+ TQDomElement elem;
};
- QValueList<TransferItem> transferItemList;
+ TQValueList<TransferItem> transferItemList;
void setIncomingAsExternal();
protected:
- virtual QDomElement docElement()=0;
+ virtual TQDomElement docElement()=0;
virtual void handleDocOpen(const Parser::Event &pe)=0;
virtual bool handleError()=0;
virtual bool handleCloseFinished()=0;
virtual bool stepAdvancesParser() const=0;
virtual bool stepRequiresElement() const;
- virtual bool doStep(const QDomElement &e)=0;
+ virtual bool doStep(const TQDomElement &e)=0;
virtual void itemWritten(int id, int size);
// 'debug'
- virtual void stringSend(const QString &s);
- virtual void stringRecv(const QString &s);
- virtual void elementSend(const QDomElement &e);
- virtual void elementRecv(const QDomElement &e);
+ virtual void stringSend(const TQString &s);
+ virtual void stringRecv(const TQString &s);
+ virtual void elementSend(const TQDomElement &e);
+ virtual void elementRecv(const TQDomElement &e);
void startConnect();
void startAccept();
bool close();
- int writeString(const QString &s, int id, bool external);
- int writeElement(const QDomElement &e, int id, bool external, bool clip=false);
- QByteArray resetStream();
+ int writeString(const TQString &s, int id, bool external);
+ int writeElement(const TQDomElement &e, int id, bool external, bool clip=false);
+ TQByteArray resetStream();
private:
enum { SendOpen, RecvOpen, Open, Closing };
@@ -122,20 +122,20 @@ namespace XMPP
};
bool incoming;
- QDomDocument elemDoc;
- QDomElement elem;
- QString tagOpen, tagClose;
+ TQDomDocument elemDoc;
+ TQDomElement elem;
+ TQString tagOpen, tagClose;
int state;
bool peerClosed;
bool closeWritten;
Parser xml;
- QByteArray outData;
- QValueList<TrackItem> trackQueue;
+ TQByteArray outData;
+ TQValueList<TrackItem> trackQueue;
void init();
- int internalWriteData(const QByteArray &a, TrackItem::Type t, int id=-1);
- int internalWriteString(const QString &s, TrackItem::Type t, int id=-1);
+ int internalWriteData(const TQByteArray &a, TrackItem::Type t, int id=-1);
+ int internalWriteString(const TQString &s, TrackItem::Type t, int id=-1);
void sendTagOpen();
void sendTagClose();
bool baseStep(const Parser::Event &pe);