From 47c8a359c5276062c4bc17f0e82410f29081b502 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:48:06 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../jabber/libiris/iris/xmpp-im/client.cpp | 304 +++++++-------- .../jabber/libiris/iris/xmpp-im/types.cpp | 414 ++++++++++----------- .../jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp | 406 ++++++++++---------- .../jabber/libiris/iris/xmpp-im/xmpp_tasks.h | 114 +++--- .../jabber/libiris/iris/xmpp-im/xmpp_vcard.cpp | 294 +++++++-------- .../jabber/libiris/iris/xmpp-im/xmpp_vcard.h | 178 ++++----- .../jabber/libiris/iris/xmpp-im/xmpp_xmlcommon.cpp | 176 ++++----- .../jabber/libiris/iris/xmpp-im/xmpp_xmlcommon.h | 60 +-- 8 files changed, 973 insertions(+), 973 deletions(-) (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-im') diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp index a5affaa0..c78875bc 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/client.cpp @@ -36,7 +36,7 @@ //! //! The entire Task system is heavily founded on Qt. All Tasks have a parent, //! except for the root Task, and are considered QObjects. By using Qt's RTTI -//! facilities (QObject::sender(), QObject::isA(), etc), you can use a +//! facilities (TQObject::sender(), TQObject::isA(), etc), you can use a //! "fire and forget" approach with Tasks. //! //! \code @@ -50,8 +50,8 @@ //! Session::Session() //! { //! client = new Client; -//! connect(client, SIGNAL(handshaken()), SLOT(clientHandshaken())); -//! connect(client, SIGNAL(authFinished(bool, int, const QString &)), SLOT(authFinished(bool, int, const QString &))); +//! connect(client, TQT_SIGNAL(handshaken()), TQT_SLOT(clientHandshaken())); +//! connect(client, TQT_SIGNAL(authFinished(bool, int, const TQString &)), TQT_SLOT(authFinished(bool, int, const TQString &))); //! client->connectToHost("jabber.org"); //! } //! @@ -60,7 +60,7 @@ //! client->authDigest("jabtest", "12345", "Psi"); //! } //! -//! void Session::authFinished(bool success, int, const QString &err) +//! void Session::authFinished(bool success, int, const TQString &err) //! { //! if(success) //! printf("Login success!"); @@ -70,10 +70,10 @@ //! \endcode #include -#include -#include -#include -#include +#include +#include +#include +#include #include"xmpp_tasks.h" #include"xmpp_xmlcommon.h" #include"s5b.h" @@ -83,10 +83,10 @@ /*#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include"xmpp_stream.h" #include"xmpp_tasks.h" #include"xmpp_xmlcommon.h" @@ -122,13 +122,13 @@ public: ClientPrivate() {} ClientStream *stream; - QDomDocument doc; + TQDomDocument doc; int id_seed; Task *root; - QString host, user, pass, resource; - QString osname, tzname, clientName, clientVersion, capsNode, capsVersion, capsExt; + TQString host, user, pass, resource; + TQString osname, tzname, clientName, clientVersion, capsNode, capsVersion, capsExt; DiscoItem::Identity identity; - QMap extension_features; + TQMap extension_features; int tzoffset; bool active; @@ -139,12 +139,12 @@ public: JidLinkManager *jlman; FileTransferManager *ftman; bool ftEnabled; - QValueList groupChatList; + TQValueList groupChatList; }; -Client::Client(QObject *par) -:QObject(par) +Client::Client(TQObject *par) +:TQObject(par) { d = new ClientPrivate; d->tzoffset = 0; @@ -162,10 +162,10 @@ Client::Client(QObject *par) d->stream = 0; d->s5bman = new S5BManager(this); - connect(d->s5bman, SIGNAL(incomingReady()), SLOT(s5b_incomingReady())); + connect(d->s5bman, TQT_SIGNAL(incomingReady()), TQT_SLOT(s5b_incomingReady())); d->ibbman = new IBBManager(this); - connect(d->ibbman, SIGNAL(incomingReady()), SLOT(ibb_incomingReady())); + connect(d->ibbman, TQT_SIGNAL(incomingReady()), TQT_SLOT(ibb_incomingReady())); d->jlman = new JidLinkManager(this); @@ -188,19 +188,19 @@ Client::~Client() void Client::connectToServer(ClientStream *s, const Jid &j, bool auth) { d->stream = s; - //connect(d->stream, SIGNAL(connected()), SLOT(streamConnected())); - //connect(d->stream, SIGNAL(handshaken()), SLOT(streamHandshaken())); - connect(d->stream, SIGNAL(error(int)), SLOT(streamError(int))); - //connect(d->stream, SIGNAL(sslCertificateReady(const QSSLCert &)), SLOT(streamSSLCertificateReady(const QSSLCert &))); - connect(d->stream, SIGNAL(readyRead()), SLOT(streamReadyRead())); - //connect(d->stream, SIGNAL(closeFinished()), SLOT(streamCloseFinished())); - connect(d->stream, SIGNAL(incomingXml(const QString &)), SLOT(streamIncomingXml(const QString &))); - connect(d->stream, SIGNAL(outgoingXml(const QString &)), SLOT(streamOutgoingXml(const QString &))); + //connect(d->stream, TQT_SIGNAL(connected()), TQT_SLOT(streamConnected())); + //connect(d->stream, TQT_SIGNAL(handshaken()), TQT_SLOT(streamHandshaken())); + connect(d->stream, TQT_SIGNAL(error(int)), TQT_SLOT(streamError(int))); + //connect(d->stream, TQT_SIGNAL(sslCertificateReady(const QSSLCert &)), TQT_SLOT(streamSSLCertificateReady(const QSSLCert &))); + connect(d->stream, TQT_SIGNAL(readyRead()), TQT_SLOT(streamReadyRead())); + //connect(d->stream, TQT_SIGNAL(closeFinished()), TQT_SLOT(streamCloseFinished())); + connect(d->stream, TQT_SIGNAL(incomingXml(const TQString &)), TQT_SLOT(streamIncomingXml(const TQString &))); + connect(d->stream, TQT_SIGNAL(outgoingXml(const TQString &)), TQT_SLOT(streamOutgoingXml(const TQString &))); d->stream->connectToServer(j, auth); } -void Client::start(const QString &host, const QString &user, const QString &pass, const QString &_resource) +void Client::start(const TQString &host, const TQString &user, const TQString &pass, const TQString &_resource) { // TODO d->host = host; @@ -213,14 +213,14 @@ void Client::start(const QString &host, const QString &user, const QString &pass d->resourceList += Resource(resource(), stat); JT_PushPresence *pp = new JT_PushPresence(rootTask()); - connect(pp, SIGNAL(subscription(const Jid &, const QString &)), SLOT(ppSubscription(const Jid &, const QString &))); - connect(pp, SIGNAL(presence(const Jid &, const Status &)), SLOT(ppPresence(const Jid &, const Status &))); + connect(pp, TQT_SIGNAL(subscription(const Jid &, const TQString &)), TQT_SLOT(ppSubscription(const Jid &, const TQString &))); + connect(pp, TQT_SIGNAL(presence(const Jid &, const Status &)), TQT_SLOT(ppPresence(const Jid &, const Status &))); JT_PushMessage *pm = new JT_PushMessage(rootTask()); - connect(pm, SIGNAL(message(const Message &)), SLOT(pmMessage(const Message &))); + connect(pm, TQT_SIGNAL(message(const Message &)), TQT_SLOT(pmMessage(const Message &))); JT_PushRoster *pr = new JT_PushRoster(rootTask()); - connect(pr, SIGNAL(roster(const Roster &)), SLOT(prRoster(const Roster &))); + connect(pr, TQT_SIGNAL(roster(const Roster &)), TQT_SLOT(prRoster(const Roster &))); new JT_ServInfo(rootTask()); @@ -266,10 +266,10 @@ bool Client::isActive() const return d->active; } -void Client::groupChatChangeNick(const QString &host, const QString &room, const QString &nick, const Status &_s) +void Client::groupChatChangeNick(const TQString &host, const TQString &room, const TQString &nick, const Status &_s) { Jid jid(room + "@" + host + "/" + nick); - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { GroupChat &i = *it; if(i.j.compare(jid, false)) { i.j = jid; @@ -286,10 +286,10 @@ void Client::groupChatChangeNick(const QString &host, const QString &room, const } } -bool Client::groupChatJoin(const QString &host, const QString &room, const QString &nick) +bool Client::groupChatJoin(const TQString &host, const TQString &room, const TQString &nick) { Jid jid(room + "@" + host + "/" + nick); - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end();) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end();) { GroupChat &i = *it; if(i.j.compare(jid, false)) { // if this room is shutting down, then free it up @@ -302,7 +302,7 @@ bool Client::groupChatJoin(const QString &host, const QString &room, const QStri ++it; } - debug(QString("Client: Joined: [%1]\n").arg(jid.full())); + debug(TQString("Client: Joined: [%1]\n").arg(jid.full())); GroupChat i; i.j = jid; i.status = GroupChat::Connecting; @@ -315,10 +315,10 @@ bool Client::groupChatJoin(const QString &host, const QString &room, const QStri return true; } -bool Client::groupChatJoin(const QString &host, const QString &room, const QString &nick, const QString &password) +bool Client::groupChatJoin(const TQString &host, const TQString &room, const TQString &nick, const TQString &password) { Jid jid(room + "@" + host + "/" + nick); - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end();) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end();) { GroupChat &i = *it; if(i.j.compare(jid, false)) { // if this room is shutting down, then free it up @@ -331,7 +331,7 @@ bool Client::groupChatJoin(const QString &host, const QString &room, const QStri ++it; } - debug(QString("Client: Joined: [%1]\n").arg(jid.full())); + debug(TQString("Client: Joined: [%1]\n").arg(jid.full())); GroupChat i; i.j = jid; i.status = GroupChat::Connecting; @@ -344,11 +344,11 @@ bool Client::groupChatJoin(const QString &host, const QString &room, const QStri return true; } -void Client::groupChatSetStatus(const QString &host, const QString &room, const Status &_s) +void Client::groupChatSetStatus(const TQString &host, const TQString &room, const Status &_s) { Jid jid(room + "@" + host); bool found = false; - for(QValueList::ConstIterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::ConstIterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { const GroupChat &i = *it; if(i.j.compare(jid, false)) { found = true; @@ -367,17 +367,17 @@ void Client::groupChatSetStatus(const QString &host, const QString &room, const j->go(true); } -void Client::groupChatLeave(const QString &host, const QString &room) +void Client::groupChatLeave(const TQString &host, const TQString &room) { Jid jid(room + "@" + host); - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { GroupChat &i = *it; if(!i.j.compare(jid, false)) continue; i.status = GroupChat::Closing; - debug(QString("Client: Leaving: [%1]\n").arg(i.j.full())); + debug(TQString("Client: Leaving: [%1]\n").arg(i.j.full())); JT_Presence *j = new JT_Presence(rootTask()); Status s; @@ -404,7 +404,7 @@ void Client::close(bool) { if(d->stream) { if(d->active) { - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { GroupChat &i = *it; i.status = GroupChat::Closing; @@ -467,17 +467,17 @@ void Client::streamCloseFinished() closeFinished(); }*/ -static QDomElement oldStyleNS(const QDomElement &e) +static TQDomElement oldStyleNS(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; if(!par.isNull() && par.namespaceURI() == e.namespaceURI()) noShowNS = true; - QDomElement i; + TQDomElement i; uint x; //if(noShowNS) i = e.ownerDocument().createElement(e.tagName()); @@ -485,7 +485,7 @@ static QDomElement oldStyleNS(const QDomElement &e) // i = e.ownerDocument().createElementNS(e.namespaceURI(), e.tagName()); // copy attributes - QDomNamedNodeMap al = e.attributes(); + TQDomNamedNodeMap al = e.attributes(); for(x = 0; x < al.count(); ++x) i.setAttributeNode(al.item(x).cloneNode().toAttr()); @@ -493,9 +493,9 @@ static QDomElement oldStyleNS(const QDomElement &e) i.setAttribute("xmlns", e.namespaceURI()); // 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(oldStyleNS(n.toElement())); else @@ -507,44 +507,44 @@ static QDomElement oldStyleNS(const QDomElement &e) void Client::streamReadyRead() { // HACK HACK HACK - QGuardedPtr pstream = d->stream; + TQGuardedPtr pstream = d->stream; while(pstream && d->stream->stanzaAvailable()) { Stanza s = d->stream->read(); - QString out = s.toString(); - debug(QString("Client: incoming: [\n%1]\n").arg(out)); + TQString out = s.toString(); + debug(TQString("Client: incoming: [\n%1]\n").arg(out)); xmlIncoming(out); - QDomElement x = oldStyleNS(s.element()); + TQDomElement x = oldStyleNS(s.element()); distribute(x); } } -void Client::streamIncomingXml(const QString &s) +void Client::streamIncomingXml(const TQString &s) { - QString str = s; + TQString str = s; if(str.at(str.length()-1) != '\n') str += '\n'; xmlIncoming(str); } -void Client::streamOutgoingXml(const QString &s) +void Client::streamOutgoingXml(const TQString &s) { - QString str = s; + TQString str = s; if(str.at(str.length()-1) != '\n') str += '\n'; xmlOutgoing(str); } -void Client::debug(const QString &str) +void Client::debug(const TQString &str) { debugText(str); } -QString Client::genUniqueId() +TQString Client::genUniqueId() { - QString s; + TQString s; s.sprintf("a%x", d->id_seed); d->id_seed += 0x10; return s; @@ -555,12 +555,12 @@ Task *Client::rootTask() return d->root; } -QDomDocument *Client::doc() const +TQDomDocument *Client::doc() const { return &d->doc; } -void Client::distribute(const QDomElement &x) +void Client::distribute(const TQDomElement &x) { if(x.hasAttribute("from")) { Jid j(x.attribute("from")); @@ -575,41 +575,41 @@ void Client::distribute(const QDomElement &x) } } -static QDomElement addCorrectNS(const QDomElement &e) +static TQDomElement addCorrectNS(const TQDomElement &e) { uint x; // grab child nodes - /*QDomDocumentFragment frag = e.ownerDocument().createDocumentFragment(); - QDomNodeList nl = e.childNodes(); + /*TQDomDocumentFragment frag = e.ownerDocument().createDocumentFragment(); + TQDomNodeList nl = e.childNodes(); for(x = 0; x < nl.count(); ++x) frag.appendChild(nl.item(x).cloneNode());*/ // find closest xmlns - QDomNode n = e; + TQDomNode n = e; while(!n.isNull() && !n.toElement().hasAttribute("xmlns")) n = n.parentNode(); - QString ns; + TQString ns; if(n.isNull() || !n.toElement().hasAttribute("xmlns")) ns = "jabber:client"; else ns = n.toElement().attribute("xmlns"); // make a new node - QDomElement i = e.ownerDocument().createElementNS(ns, e.tagName()); + TQDomElement i = e.ownerDocument().createElementNS(ns, e.tagName()); // copy attributes - QDomNamedNodeMap al = e.attributes(); + TQDomNamedNodeMap al = e.attributes(); for(x = 0; x < al.count(); ++x) { - QDomAttr a = al.item(x).toAttr(); + TQDomAttr a = al.item(x).toAttr(); if(a.name() != "xmlns") i.setAttributeNodeNS(a.cloneNode().toAttr()); } // 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(addCorrectNS(n.toElement())); else @@ -620,40 +620,40 @@ static QDomElement addCorrectNS(const QDomElement &e) return i; } -void Client::send(const QDomElement &x) +void Client::send(const TQDomElement &x) { if(!d->stream) return; - //QString out; - //QTextStream ts(&out, IO_WriteOnly); + //TQString out; + //TQTextStream ts(&out, IO_WriteOnly); //x.save(ts, 0); - //QString out = Stream::xmlToString(x); - //debug(QString("Client: outgoing: [\n%1]\n").arg(out)); + //TQString out = Stream::xmlToString(x); + //debug(TQString("Client: outgoing: [\n%1]\n").arg(out)); //xmlOutgoing(out); - QDomElement e = addCorrectNS(x); + TQDomElement e = addCorrectNS(x); Stanza s = d->stream->createStanza(e); if(s.isNull()) { //printf("bad stanza??\n"); return; } - QString out = s.toString(); - debug(QString("Client: outgoing: [\n%1]\n").arg(out)); + TQString out = s.toString(); + debug(TQString("Client: outgoing: [\n%1]\n").arg(out)); xmlOutgoing(out); //printf("x[%s] x2[%s] s[%s]\n", Stream::xmlToString(x).latin1(), Stream::xmlToString(e).latin1(), s.toString().latin1()); d->stream->write(s); } -void Client::send(const QString &str) +void Client::send(const TQString &str) { if(!d->stream) return; - debug(QString("Client: outgoing: [\n%1]\n").arg(str)); + debug(TQString("Client: outgoing: [\n%1]\n").arg(str)); xmlOutgoing(str); static_cast(d->stream)->writeDirect(str); } @@ -673,29 +673,29 @@ const ResourceList & Client::resourceList() const return d->resourceList; } -QString Client::host() const +TQString Client::host() const { return d->host; } -QString Client::user() const +TQString Client::user() const { return d->user; } -QString Client::pass() const +TQString Client::pass() const { return d->pass; } -QString Client::resource() const +TQString Client::resource() const { return d->resource; } Jid Client::jid() const { - QString s; + TQString s; if(!d->user.isEmpty()) s += d->user + '@'; s += d->host; @@ -707,7 +707,7 @@ Jid Client::jid() const return Jid(s); } -void Client::ppSubscription(const Jid &j, const QString &s) +void Client::ppSubscription(const Jid &j, const TQString &s) { subscription(j, s); } @@ -715,17 +715,17 @@ void Client::ppSubscription(const Jid &j, const QString &s) void Client::ppPresence(const Jid &j, const Status &s) { if(s.isAvailable()) - debug(QString("Client: %1 is available.\n").arg(j.full())); + debug(TQString("Client: %1 is available.\n").arg(j.full())); else - debug(QString("Client: %1 is unavailable.\n").arg(j.full())); + debug(TQString("Client: %1 is unavailable.\n").arg(j.full())); - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { GroupChat &i = *it; if(i.j.compare(j, false)) { bool us = (i.j.resource() == j.resource() || j.resource().isEmpty()) ? true: false; - debug(QString("for groupchat i=[%1] pres=[%2], [us=%3].\n").arg(i.j.full()).arg(j.full()).arg(us)); + debug(TQString("for groupchat i=[%1] pres=[%2], [us=%3].\n").arg(i.j.full()).arg(j.full()).arg(us)); switch(i.status) { case GroupChat::Connecting: if(us && s.hasError()) { @@ -796,7 +796,7 @@ void Client::updateSelfPresence(const Jid &j, const Status &s) // unavailable? remove the resource if(!s.isAvailable()) { if(found) { - debug(QString("Client: Removing self resource: name=[%1]\n").arg(j.resource())); + debug(TQString("Client: Removing self resource: name=[%1]\n").arg(j.resource())); (*rit).setStatus(s); resourceUnavailable(j, *rit); d->resourceList.remove(rit); @@ -808,12 +808,12 @@ void Client::updateSelfPresence(const Jid &j, const Status &s) if(!found) { r = Resource(j.resource(), s); d->resourceList += r; - debug(QString("Client: Adding self resource: name=[%1]\n").arg(j.resource())); + debug(TQString("Client: Adding self resource: name=[%1]\n").arg(j.resource())); } else { (*rit).setStatus(s); r = *rit; - debug(QString("Client: Updating self resource: name=[%1]\n").arg(j.resource())); + debug(TQString("Client: Updating self resource: name=[%1]\n").arg(j.resource())); } resourceAvailable(j, r); @@ -829,7 +829,7 @@ void Client::updatePresence(LiveRosterItem *i, const Jid &j, const Status &s) if(!s.isAvailable()) { if(found) { (*rit).setStatus(s); - debug(QString("Client: Removing resource from [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); + debug(TQString("Client: Removing resource from [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); resourceUnavailable(j, *rit); i->resourceList().remove(rit); i->setLastUnavailableStatus(s); @@ -841,12 +841,12 @@ void Client::updatePresence(LiveRosterItem *i, const Jid &j, const Status &s) if(!found) { r = Resource(j.resource(), s); i->resourceList() += r; - debug(QString("Client: Adding resource to [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); + debug(TQString("Client: Adding resource to [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); } else { (*rit).setStatus(s); r = *rit; - debug(QString("Client: Updating resource to [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); + debug(TQString("Client: Updating resource to [%1]: name=[%2]\n").arg(i->jid().full()).arg(j.resource())); } resourceAvailable(j, r); @@ -855,10 +855,10 @@ void Client::updatePresence(LiveRosterItem *i, const Jid &j, const Status &s) void Client::pmMessage(const Message &m) { - debug(QString("Client: Message from %1\n").arg(m.from().full())); + debug(TQString("Client: Message from %1\n").arg(m.from().full())); if(m.type() == "groupchat") { - for(QValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { + for(TQValueList::Iterator it = d->groupChatList.begin(); it != d->groupChatList.end(); it++) { const GroupChat &i = *it; if(!i.j.compare(m.from(), false)) @@ -883,7 +883,7 @@ void Client::rosterRequest() return; JT_Roster *r = new JT_Roster(rootTask()); - connect(r, SIGNAL(finished()), SLOT(slotRosterRequestFinished())); + connect(r, TQT_SIGNAL(finished()), TQT_SLOT(slotRosterRequestFinished())); r->get(); d->roster.flagAllForDelete(); // mod_groups patch r->go(true); @@ -927,7 +927,7 @@ void Client::importRoster(const Roster &r) void Client::importRosterItem(const RosterItem &item) { - QString substr; + TQString substr; switch(item.subscription().type()) { case Subscription::Both: substr = "<-->"; break; @@ -942,10 +942,10 @@ void Client::importRosterItem(const RosterItem &item) substr = "----"; break; } - QString dstr, str; + TQString dstr, str; str.sprintf(" %s %-32s", substr.latin1(), item.jid().full().latin1()); if(!item.name().isEmpty()) - str += QString(" [") + item.name() + "]"; + str += TQString(" [") + item.name() + "]"; str += '\n'; // Remove @@ -986,7 +986,7 @@ void Client::sendMessage(const Message &m) j->go(true); } -void Client::sendSubscription(const Jid &jid, const QString &type) +void Client::sendSubscription(const Jid &jid, const TQString &type) { JT_Presence *j = new JT_Presence(rootTask()); j->sub(jid, type); @@ -1006,12 +1006,12 @@ void Client::setPresence(const Status &s) //r.setStatus(s); } -QString Client::OSName() const +TQString Client::OSName() const { return d->osname; } -QString Client::timeZone() const +TQString Client::timeZone() const { return d->tzname; } @@ -1021,58 +1021,58 @@ int Client::timeZoneOffset() const return d->tzoffset; } -QString Client::clientName() const +TQString Client::clientName() const { return d->clientName; } -QString Client::clientVersion() const +TQString Client::clientVersion() const { return d->clientVersion; } -QString Client::capsNode() const +TQString Client::capsNode() const { return d->capsNode; } -QString Client::capsVersion() const +TQString Client::capsVersion() const { return d->capsVersion; } -QString Client::capsExt() const +TQString Client::capsExt() const { return d->capsExt; } -void Client::setOSName(const QString &name) +void Client::setOSName(const TQString &name) { d->osname = name; } -void Client::setTimeZone(const QString &name, int offset) +void Client::setTimeZone(const TQString &name, int offset) { d->tzname = name; d->tzoffset = offset; } -void Client::setClientName(const QString &s) +void Client::setClientName(const TQString &s) { d->clientName = s; } -void Client::setClientVersion(const QString &s) +void Client::setClientVersion(const TQString &s) { d->clientVersion = s; } -void Client::setCapsNode(const QString &s) +void Client::setCapsNode(const TQString &s) { d->capsNode = s; } -void Client::setCapsVersion(const QString &s) +void Client::setCapsVersion(const TQString &s) { d->capsVersion = s; } @@ -1087,7 +1087,7 @@ void Client::setIdentity(DiscoItem::Identity identity) d->identity = identity; } -void Client::addExtension(const QString& ext, const Features& features) +void Client::addExtension(const TQString& ext, const Features& features) { if (!ext.isEmpty()) { d->extension_features[ext] = features; @@ -1095,7 +1095,7 @@ void Client::addExtension(const QString& ext, const Features& features) } } -void Client::removeExtension(const QString& ext) +void Client::removeExtension(const TQString& ext) { if (d->extension_features.contains(ext)) { d->extension_features.remove(ext); @@ -1103,12 +1103,12 @@ void Client::removeExtension(const QString& ext) } } -QStringList Client::extensions() const +TQStringList Client::extensions() const { return d->extension_features.keys(); } -const Features& Client::extension(const QString& ext) const +const Features& Client::extension(const TQString& ext) const { return d->extension_features[ext]; } @@ -1146,32 +1146,32 @@ class Task::TaskPrivate public: TaskPrivate() {} - QString id; + TQString id; bool success; int statusCode; - QString statusString; + TQString statusString; Client *client; bool insig, deleteme, autoDelete; bool done; }; Task::Task(Task *parent) -:QObject(parent) +:TQObject(parent) { init(); d->client = parent->client(); d->id = client()->genUniqueId(); - connect(d->client, SIGNAL(disconnected()), SLOT(clientDisconnected())); + connect(d->client, TQT_SIGNAL(disconnected()), TQT_SLOT(clientDisconnected())); } Task::Task(Client *parent, bool) -:QObject(0) +:TQObject(0) { init(); d->client = parent; - connect(d->client, SIGNAL(disconnected()), SLOT(clientDisconnected())); + connect(d->client, TQT_SIGNAL(disconnected()), TQT_SLOT(clientDisconnected())); } Task::~Task() @@ -1191,7 +1191,7 @@ void Task::init() Task *Task::parent() const { - return (Task *)QObject::parent(); + return (Task *)TQObject::parent(); } Client *Task::client() const @@ -1199,12 +1199,12 @@ Client *Task::client() const return d->client; } -QDomDocument *Task::doc() const +TQDomDocument *Task::doc() const { return client()->doc(); } -QString Task::id() const +TQString Task::id() const { return d->id; } @@ -1219,7 +1219,7 @@ int Task::statusCode() const return d->statusCode; } -const QString & Task::statusString() const +const TQString & Task::statusString() const { return d->statusString; } @@ -1231,17 +1231,17 @@ void Task::go(bool autoDelete) onGo(); } -bool Task::take(const QDomElement &x) +bool Task::take(const TQDomElement &x) { - const QObjectList *p = children(); + const TQObjectList *p = children(); if(!p) return false; // pass along the xml - QObjectListIt it(*p); + TQObjectListIt it(*p); Task *t; for(; it.current(); ++it) { - QObject *obj = it.current(); + TQObject *obj = it.current(); if(!obj->inherits("XMPP::Task")) continue; @@ -1275,16 +1275,16 @@ void Task::onDisconnect() d->statusString = tr("Disconnected"); // delay this so that tasks that react don't block the shutdown - QTimer::singleShot(0, this, SLOT(done())); + TQTimer::singleShot(0, this, TQT_SLOT(done())); } } -void Task::send(const QDomElement &x) +void Task::send(const TQDomElement &x) { client()->send(x); } -void Task::setSuccess(int code, const QString &str) +void Task::setSuccess(int code, const TQString &str) { if(!d->done) { d->success = true; @@ -1294,7 +1294,7 @@ void Task::setSuccess(int code, const QString &str) } } -void Task::setError(const QDomElement &e) +void Task::setError(const TQDomElement &e) { if(!d->done) { d->success = false; @@ -1303,7 +1303,7 @@ void Task::setError(const QDomElement &e) } } -void Task::setError(int code, const QString &str) +void Task::setError(int code, const TQString &str) { if(!d->done) { d->success = false; @@ -1338,7 +1338,7 @@ void Task::clientDisconnected() void Task::debug(const char *fmt, ...) { char *buf; - QString str; + TQString str; int size = 1024; int r; @@ -1350,7 +1350,7 @@ void Task::debug(const char *fmt, ...) va_end(ap); if(r != -1) - str = QString(buf); + str = TQString(buf); delete [] buf; @@ -1360,12 +1360,12 @@ void Task::debug(const char *fmt, ...) debug(str); } -void Task::debug(const QString &str) +void Task::debug(const TQString &str) { - client()->debug(QString("%1: ").arg(className()) + str); + client()->debug(TQString("%1: ").arg(className()) + str); } -bool Task::iqVerify(const QDomElement &x, const Jid &to, const QString &id, const QString &xmlns) +bool Task::iqVerify(const TQDomElement &x, const Jid &to, const TQString &id, const TQString &xmlns) { if(x.tagName() != "iq") return false; @@ -1485,7 +1485,7 @@ void LiveRosterItem::setFlagForDelete(bool b) // LiveRoster //--------------------------------------------------------------------------- LiveRoster::LiveRoster() -:QValueList() +:TQValueList() { } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/types.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/types.cpp index 512839c3..f2fcf7c9 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/types.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/types.cpp @@ -20,25 +20,25 @@ #include"im.h" #include "protocol.h" -#include -#include +#include +#include #define NS_XML "http://www.w3.org/XML/1998/namespace" -static QDomElement textTag(QDomDocument *doc, const QString &name, const QString &content) +static TQDomElement textTag(TQDomDocument *doc, const TQString &name, const TQString &content) { - QDomElement tag = doc->createElement(name); - QDomText text = doc->createTextNode(content); + TQDomElement tag = doc->createElement(name); + TQDomText text = doc->createTextNode(content); tag.appendChild(text); return tag; } -static QString tagContent(const QDomElement &e) +static TQString tagContent(const TQDomElement &e) { // look for some tag content - for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomText i = n.toText(); + for(TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomText i = n.toText(); if(i.isNull()) continue; return i.data(); @@ -47,10 +47,10 @@ static QString tagContent(const QDomElement &e) return ""; } -static QDateTime stamp2TS(const QString &ts) +static TQDateTime stamp2TS(const TQString &ts) { if(ts.length() != 17) - return QDateTime(); + return TQDateTime(); int year = ts.mid(0,4).toInt(); int month = ts.mid(4,2).toInt(); @@ -60,22 +60,22 @@ static QDateTime stamp2TS(const QString &ts) int min = ts.mid(12,2).toInt(); int sec = ts.mid(15,2).toInt(); - QDate xd; + TQDate xd; xd.setYMD(year, month, day); if(!xd.isValid()) - return QDateTime(); + return TQDateTime(); - QTime xt; + TQTime xt; xt.setHMS(hour, min, sec); if(!xt.isValid()) - return QDateTime(); + return TQDateTime(); - return QDateTime(xd, xt); + return TQDateTime(xd, xt); } -/*static QString TS2stamp(const QDateTime &d) +/*static TQString TS2stamp(const TQDateTime &d) { - QString str; + TQString str; str.sprintf("%04d%02d%02dT%02d:%02d:%02d", d.date().year(), @@ -97,17 +97,17 @@ namespace XMPP class Url::Private { public: - QString url; - QString desc; + TQString url; + TQString desc; }; //! \brief Construct Url object with a given URL and Description. //! //! This function will construct a Url object. -//! \param QString - url (default: empty string) -//! \param QString - description of url (default: empty string) +//! \param TQString - url (default: empty string) +//! \param TQString - description of url (default: empty string) //! \sa setUrl() setDesc() -Url::Url(const QString &url, const QString &desc) +Url::Url(const TQString &url, const TQString &desc) { d = new Private; d->url = url; @@ -140,7 +140,7 @@ Url::~Url() //! \brief Get url information. //! //! Returns url information. -QString Url::url() const +TQString Url::url() const { return d->url; } @@ -148,7 +148,7 @@ QString Url::url() const //! \brief Get Description information. //! //! Returns desction of the URL. -QString Url::desc() const +TQString Url::desc() const { return d->desc; } @@ -157,7 +157,7 @@ QString Url::desc() const //! //! Set url information. //! \param url - url string (eg: http://psi.affinix.com/) -void Url::setUrl(const QString &url) +void Url::setUrl(const TQString &url) { d->url = url; } @@ -166,7 +166,7 @@ void Url::setUrl(const QString &url) //! //! Set description of the url. //! \param desc - description of url -void Url::setDesc(const QString &desc) +void Url::setDesc(const TQString &desc) { d->desc = desc; } @@ -178,19 +178,19 @@ class Message::Private { public: Jid to, from; - QString id, type, lang; + TQString id, type, lang; StringMap subject, body, xHTMLBody; - QString thread; + TQString thread; Stanza::Error error; // extensions - QDateTime timeStamp; + TQDateTime timeStamp; UrlList urlList; - QValueList eventList; - QString eventId; - QString xencrypted, invite; + TQValueList eventList; + TQString eventId; + TQString xencrypted, invite; bool spooled, wasEncrypted; }; @@ -247,24 +247,24 @@ Jid Message::from() const return d->from; } -QString Message::id() const +TQString Message::id() const { return d->id; } //! \brief Return type information -QString Message::type() const +TQString Message::type() const { return d->type; } -QString Message::lang() const +TQString Message::lang() const { return d->lang; } //! \brief Return subject information. -QString Message::subject(const QString &lang) const +TQString Message::subject(const TQString &lang) const { return d->subject[lang]; } @@ -275,17 +275,17 @@ QString Message::subject(const QString &lang) const //! it exists. //! \param rich - Returns richtext if true and plain text if false. (default: false) //! \note Richtext is in Qt's richtext format and not in xhtml. -QString Message::body(const QString &lang) const +TQString Message::body(const TQString &lang) const { return d->body[lang]; } -QString Message::xHTMLBody(const QString &lang) const +TQString Message::xHTMLBody(const TQString &lang) const { return d->xHTMLBody[lang]; } -QString Message::thread() const +TQString Message::thread() const { return d->thread; } @@ -310,7 +310,7 @@ void Message::setFrom(const Jid &j) //d->flag = false; } -void Message::setId(const QString &s) +void Message::setId(const TQString &s) { d->id = s; } @@ -318,13 +318,13 @@ void Message::setId(const QString &s) //! \brief Set Type of message //! //! \param type - type of message your going to send -void Message::setType(const QString &s) +void Message::setType(const TQString &s) { d->type = s; //d->flag = false; } -void Message::setLang(const QString &s) +void Message::setLang(const TQString &s) { d->lang = s; } @@ -332,7 +332,7 @@ void Message::setLang(const QString &s) //! \brief Set subject //! //! \param subject - Subject information -void Message::setSubject(const QString &s, const QString &lang) +void Message::setSubject(const TQString &s, const TQString &lang) { d->subject[lang] = s; //d->flag = false; @@ -343,20 +343,20 @@ void Message::setSubject(const QString &s, const QString &lang) //! \param body - body information //! \param rich - set richtext if true and set plaintext if false. //! \note Richtext support will be implemented in the future... Sorry. -void Message::setBody(const QString &s, const QString &lang) +void Message::setBody(const TQString &s, const TQString &lang) { d->body[lang] = s; } -void Message::setXHTMLBody(const QString &s, const QString &lang, const QString &attr) +void Message::setXHTMLBody(const TQString &s, const TQString &lang, const TQString &attr) { //ugly but needed if s is not a node but a list of leaf - QString content = "\n" + s +"\n"; + TQString content = "\n" + s +"\n"; d->xHTMLBody[lang] = content; } -void Message::setThread(const QString &s) +void Message::setThread(const TQString &s) { d->thread = s; } @@ -366,12 +366,12 @@ void Message::setError(const Stanza::Error &err) d->error = err; } -QDateTime Message::timeStamp() const +TQDateTime Message::timeStamp() const { return d->timeStamp; } -void Message::setTimeStamp(const QDateTime &ts) +void Message::setTimeStamp(const TQDateTime &ts) { d->timeStamp = ts; } @@ -404,12 +404,12 @@ void Message::setUrlList(const UrlList &list) d->urlList = list; } -QString Message::eventId() const +TQString Message::eventId() const { return d->eventId; } -void Message::setEventId(const QString& id) +void Message::setEventId(const TQString& id) { d->eventId = id; } @@ -433,22 +433,22 @@ void Message::addEvent(MsgEvent e) } } -QString Message::xencrypted() const +TQString Message::xencrypted() const { return d->xencrypted; } -void Message::setXEncrypted(const QString &s) +void Message::setXEncrypted(const TQString &s) { d->xencrypted = s; } -QString Message::invite() const +TQString Message::invite() const { return d->invite; } -void Message::setInvite(const QString &s) +void Message::setInvite(const TQString &s) { d->invite = s; } @@ -485,29 +485,29 @@ Stanza Message::toStanza(Stream *stream) const StringMap::ConstIterator it; for(it = d->subject.begin(); it != d->subject.end(); ++it) { - const QString &str = it.data(); + const TQString &str = it.data(); if(!str.isEmpty()) { - QDomElement e = s.createTextElement(s.baseNS(), "subject", str); + TQDomElement e = s.createTextElement(s.baseNS(), "subject", str); if(!it.key().isEmpty()) e.setAttributeNS(NS_XML, "xml:lang", it.key()); s.appendChild(e); } } for(it = d->body.begin(); it != d->body.end(); ++it) { - const QString &str = it.data(); + const TQString &str = it.data(); if(!str.isEmpty()) { - QDomElement e = s.createTextElement(s.baseNS(), "body", str); + TQDomElement e = s.createTextElement(s.baseNS(), "body", str); if(!it.key().isEmpty()) e.setAttributeNS(NS_XML, "xml:lang", it.key()); s.appendChild(e); } } if ( !d->xHTMLBody.isEmpty()) { - QDomElement parent = s.createElement(s.xhtmlImNS(), "html"); + TQDomElement parent = s.createElement(s.xhtmlImNS(), "html"); for(it = d->xHTMLBody.begin(); it != d->xHTMLBody.end(); ++it) { - const QString &str = it.data(); + const TQString &str = it.data(); if(!str.isEmpty()) { - QDomElement child = s.createXHTMLElement(str); + TQDomElement child = s.createXHTMLElement(str); if(!it.key().isEmpty()) child.setAttributeNS(NS_XML, "xml:lang", it.key()); parent.appendChild(child); @@ -520,14 +520,14 @@ Stanza Message::toStanza(Stream *stream) const // timestamp /*if(!d->timeStamp.isNull()) { - QDomElement e = s.createElement("jabber:x:delay", "x"); + TQDomElement e = s.createElement("jabber:x:delay", "x"); e.setAttribute("stamp", TS2stamp(d->timeStamp)); s.appendChild(e); }*/ // urls - for(QValueList::ConstIterator uit = d->urlList.begin(); uit != d->urlList.end(); ++uit) { - QDomElement x = s.createElement("jabber:x:oob", "x"); + for(TQValueList::ConstIterator uit = d->urlList.begin(); uit != d->urlList.end(); ++uit) { + TQDomElement x = s.createElement("jabber:x:oob", "x"); x.appendChild(s.createTextElement("jabber:x:oob", "url", (*uit).url())); if(!(*uit).desc().isEmpty()) x.appendChild(s.createTextElement("jabber:x:oob", "desc", (*uit).desc())); @@ -536,7 +536,7 @@ Stanza Message::toStanza(Stream *stream) const // events if (!d->eventList.isEmpty()) { - QDomElement x = s.createElement("jabber:x:event", "x"); + TQDomElement x = s.createElement("jabber:x:event", "x"); if (d->body.isEmpty()) { if (d->eventId.isEmpty()) @@ -548,7 +548,7 @@ Stanza Message::toStanza(Stream *stream) const s.appendChild( s.createElement(NS_CHATSTATES , "active" ) ); bool need_x_event=false; - for(QValueList::ConstIterator ev = d->eventList.begin(); ev != d->eventList.end(); ++ev) { + for(TQValueList::ConstIterator ev = d->eventList.begin(); ev != d->eventList.end(); ++ev) { switch (*ev) { case OfflineEvent: x.appendChild(s.createElement("jabber:x:event", "offline")); @@ -594,7 +594,7 @@ Stanza Message::toStanza(Stream *stream) const // invite if(!d->invite.isEmpty()) { - QDomElement e = s.createElement("jabber:x:conference", "x"); + TQDomElement e = s.createElement("jabber:x:conference", "x"); e.setAttribute("jid", d->invite); s.appendChild(e); } @@ -615,24 +615,24 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) d->subject.clear(); d->body.clear(); - d->thread = QString(); + d->thread = TQString(); d->eventList.clear(); - QDomElement root = s.element(); + TQDomElement root = s.element(); - QDomNodeList nl = root.childNodes(); + TQDomNodeList nl = root.childNodes(); uint n; for(n = 0; n < nl.count(); ++n) { - QDomNode i = nl.item(n); + TQDomNode i = nl.item(n); if(i.isElement()) { - QDomElement e = i.toElement(); + TQDomElement e = i.toElement(); if(e.namespaceURI() == s.baseNS()) { if(e.tagName() == "subject") { - QString lang = e.attributeNS(NS_XML, "lang", ""); + TQString lang = e.attributeNS(NS_XML, "lang", ""); d->subject[lang] = e.text(); } else if(e.tagName() == "body") { - QString lang = e.attributeNS(NS_XML, "lang", ""); + TQString lang = e.attributeNS(NS_XML, "lang", ""); d->body[lang] = e.text(); } else if(e.tagName() == "thread") @@ -640,13 +640,13 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) } else if (e.namespaceURI() == s.xhtmlImNS()) { if (e.tagName() == "html") { - QDomNodeList htmlNL= e.childNodes(); + TQDomNodeList htmlNL= e.childNodes(); for (unsigned int x = 0; x < htmlNL.count(); x++) { - QDomElement i = htmlNL.item(x).toElement(); + TQDomElement i = htmlNL.item(x).toElement(); if (i.tagName() == "body") { - QDomDocument RichText; - QString lang = i.attributeNS(NS_XML, "lang", ""); + TQDomDocument RichText; + TQString lang = i.attributeNS(NS_XML, "lang", ""); RichText.appendChild(i); d-> xHTMLBody[lang] = RichText.toString(); } @@ -690,14 +690,14 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) d->error = s.error(); // timestamp - QDomElement t = root.elementsByTagNameNS("jabber:x:delay", "x").item(0).toElement(); + TQDomElement t = root.elementsByTagNameNS("jabber:x:delay", "x").item(0).toElement(); if(!t.isNull()) { d->timeStamp = stamp2TS(t.attribute("stamp")); d->timeStamp = d->timeStamp.addSecs(timeZoneOffset * 3600); d->spooled = true; } else { - d->timeStamp = QDateTime::currentDateTime(); + d->timeStamp = TQDateTime::currentDateTime(); d->spooled = false; } @@ -705,7 +705,7 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) d->urlList.clear(); nl = root.elementsByTagNameNS("jabber:x:oob", "x"); for(n = 0; n < nl.count(); ++n) { - QDomElement t = nl.item(n).toElement(); + TQDomElement t = nl.item(n).toElement(); Url u; u.setUrl(t.elementsByTagName("url").item(0).toElement().text()); u.setDesc(t.elementsByTagName("desc").item(0).toElement().text()); @@ -717,7 +717,7 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) if (nl.count()) { nl = nl.item(0).childNodes(); for(n = 0; n < nl.count(); ++n) { - QString evtag = nl.item(n).toElement().tagName(); + TQString evtag = nl.item(n).toElement().tagName(); if (evtag == "id") { d->eventId = nl.item(n).toElement().text(); } @@ -739,14 +739,14 @@ bool Message::fromStanza(const Stanza &s, int timeZoneOffset) if(!t.isNull()) d->xencrypted = t.text(); else - d->xencrypted = QString(); + d->xencrypted = TQString(); // invite t = root.elementsByTagNameNS("jabber:x:conference", "x").item(0).toElement(); if(!t.isNull()) d->invite = t.attribute("jid"); else - d->invite = QString(); + d->invite = TQString(); return true; } @@ -764,7 +764,7 @@ int Subscription::type() const return value; } -QString Subscription::toString() const +TQString Subscription::toString() const { switch(value) { case Remove: @@ -781,7 +781,7 @@ QString Subscription::toString() const } } -bool Subscription::fromString(const QString &s) +bool Subscription::fromString(const TQString &s) { if(s == "remove") value = Remove; @@ -803,13 +803,13 @@ bool Subscription::fromString(const QString &s) //--------------------------------------------------------------------------- // Status //--------------------------------------------------------------------------- -Status::Status(const QString &show, const QString &status, int priority, bool available) +Status::Status(const TQString &show, const TQString &status, int priority, bool available) { v_isAvailable = available; v_show = show; v_status = status; v_priority = priority; - v_timeStamp = QDateTime::currentDateTime(); + v_timeStamp = TQDateTime::currentDateTime(); v_isInvisible = false; ecode = -1; } @@ -823,7 +823,7 @@ bool Status::hasError() const return (ecode != -1); } -void Status::setError(int code, const QString &str) +void Status::setError(int code, const TQString &str) { ecode = code; estr = str; @@ -844,47 +844,47 @@ void Status::setPriority(int x) v_priority = x; } -void Status::setShow(const QString & _show) +void Status::setShow(const TQString & _show) { v_show = _show; } -void Status::setStatus(const QString & _status) +void Status::setStatus(const TQString & _status) { v_status = _status; } -void Status::setTimeStamp(const QDateTime & _timestamp) +void Status::setTimeStamp(const TQDateTime & _timestamp) { v_timeStamp = _timestamp; } -void Status::setKeyID(const QString &key) +void Status::setKeyID(const TQString &key) { v_key = key; } -void Status::setXSigned(const QString &s) +void Status::setXSigned(const TQString &s) { v_xsigned = s; } -void Status::setSongTitle(const QString & _songtitle) +void Status::setSongTitle(const TQString & _songtitle) { v_songTitle = _songtitle; } -void Status::setCapsNode(const QString & _capsNode) +void Status::setCapsNode(const TQString & _capsNode) { v_capsNode = _capsNode; } -void Status::setCapsVersion(const QString & _capsVersion) +void Status::setCapsVersion(const TQString & _capsVersion) { v_capsVersion = _capsVersion; } -void Status::setCapsExt(const QString & _capsExt) +void Status::setCapsExt(const TQString & _capsExt) { v_capsExt = _capsExt; } @@ -912,46 +912,46 @@ int Status::priority() const return v_priority; } -const QString & Status::show() const +const TQString & Status::show() const { return v_show; } -const QString & Status::status() const +const TQString & Status::status() const { return v_status; } -QDateTime Status::timeStamp() const +TQDateTime Status::timeStamp() const { return v_timeStamp; } -const QString & Status::keyID() const +const TQString & Status::keyID() const { return v_key; } -const QString & Status::xsigned() const +const TQString & Status::xsigned() const { return v_xsigned; } -const QString & Status::songTitle() const +const TQString & Status::songTitle() const { return v_songTitle; } -const QString & Status::capsNode() const +const TQString & Status::capsNode() const { return v_capsNode; } -const QString & Status::capsVersion() const +const TQString & Status::capsVersion() const { return v_capsVersion; } -const QString & Status::capsExt() const +const TQString & Status::capsExt() const { return v_capsExt; } @@ -961,7 +961,7 @@ int Status::errorCode() const return ecode; } -const QString & Status::errorString() const +const TQString & Status::errorString() const { return estr; } @@ -970,7 +970,7 @@ const QString & Status::errorString() const //--------------------------------------------------------------------------- // Resource //--------------------------------------------------------------------------- -Resource::Resource(const QString &name, const Status &stat) +Resource::Resource(const TQString &name, const Status &stat) { v_name = name; v_status = stat; @@ -980,7 +980,7 @@ Resource::~Resource() { } -const QString & Resource::name() const +const TQString & Resource::name() const { return v_name; } @@ -995,7 +995,7 @@ const Status & Resource::status() const return v_status; } -void Resource::setName(const QString & _name) +void Resource::setName(const TQString & _name) { v_name = _name; } @@ -1010,7 +1010,7 @@ void Resource::setStatus(const Status & _status) // ResourceList //--------------------------------------------------------------------------- ResourceList::ResourceList() -:QValueList() +:TQValueList() { } @@ -1018,7 +1018,7 @@ ResourceList::~ResourceList() { } -ResourceList::Iterator ResourceList::find(const QString & _find) +ResourceList::Iterator ResourceList::find(const TQString & _find) { for(ResourceList::Iterator it = begin(); it != end(); ++it) { if((*it).name() == _find) @@ -1040,7 +1040,7 @@ ResourceList::Iterator ResourceList::priority() return highest; } -ResourceList::ConstIterator ResourceList::find(const QString & _find) const +ResourceList::ConstIterator ResourceList::find(const TQString & _find) const { for(ResourceList::ConstIterator it = begin(); it != end(); ++it) { if((*it).name() == _find) @@ -1080,12 +1080,12 @@ const Jid & RosterItem::jid() const return v_jid; } -const QString & RosterItem::name() const +const TQString & RosterItem::name() const { return v_name; } -const QStringList & RosterItem::groups() const +const TQStringList & RosterItem::groups() const { return v_groups; } @@ -1095,7 +1095,7 @@ const Subscription & RosterItem::subscription() const return v_subscription; } -const QString & RosterItem::ask() const +const TQString & RosterItem::ask() const { return v_ask; } @@ -1105,9 +1105,9 @@ bool RosterItem::isPush() const return v_push; } -bool RosterItem::inGroup(const QString &g) const +bool RosterItem::inGroup(const TQString &g) const { - for(QStringList::ConstIterator it = v_groups.begin(); it != v_groups.end(); ++it) { + for(TQStringList::ConstIterator it = v_groups.begin(); it != v_groups.end(); ++it) { if(*it == g) return true; } @@ -1119,12 +1119,12 @@ void RosterItem::setJid(const Jid &_jid) v_jid = _jid; } -void RosterItem::setName(const QString &_name) +void RosterItem::setName(const TQString &_name) { v_name = _name; } -void RosterItem::setGroups(const QStringList &_groups) +void RosterItem::setGroups(const TQStringList &_groups) { v_groups = _groups; } @@ -1134,7 +1134,7 @@ void RosterItem::setSubscription(const Subscription &type) v_subscription = type; } -void RosterItem::setAsk(const QString &_ask) +void RosterItem::setAsk(const TQString &_ask) { v_ask = _ask; } @@ -1144,7 +1144,7 @@ void RosterItem::setIsPush(bool b) v_push = b; } -bool RosterItem::addGroup(const QString &g) +bool RosterItem::addGroup(const TQString &g) { if(inGroup(g)) return false; @@ -1153,9 +1153,9 @@ bool RosterItem::addGroup(const QString &g) return true; } -bool RosterItem::removeGroup(const QString &g) +bool RosterItem::removeGroup(const TQString &g) { - for(QStringList::Iterator it = v_groups.begin(); it != v_groups.end(); ++it) { + for(TQStringList::Iterator it = v_groups.begin(); it != v_groups.end(); ++it) { if(*it == g) { v_groups.remove(it); return true; @@ -1165,40 +1165,40 @@ bool RosterItem::removeGroup(const QString &g) return false; } -QDomElement RosterItem::toXml(QDomDocument *doc) const +TQDomElement RosterItem::toXml(TQDomDocument *doc) const { - QDomElement item = doc->createElement("item"); + TQDomElement item = doc->createElement("item"); item.setAttribute("jid", v_jid.full()); item.setAttribute("name", v_name); item.setAttribute("subscription", v_subscription.toString()); if(!v_ask.isEmpty()) item.setAttribute("ask", v_ask); - for(QStringList::ConstIterator it = v_groups.begin(); it != v_groups.end(); ++it) + for(TQStringList::ConstIterator it = v_groups.begin(); it != v_groups.end(); ++it) item.appendChild(textTag(doc, "group", *it)); return item; } -bool RosterItem::fromXml(const QDomElement &item) +bool RosterItem::fromXml(const TQDomElement &item) { if(item.tagName() != "item") return false; Jid j(item.attribute("jid")); if(!j.isValid()) return false; - QString na = item.attribute("name"); + TQString na = item.attribute("name"); Subscription s; if(!s.fromString(item.attribute("subscription")) ) return false; - QStringList g; - for(QDomNode n = item.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQStringList g; + for(TQDomNode n = item.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; if(i.tagName() == "group") g += tagContent(i); } - QString a = item.attribute("ask"); + TQString a = item.attribute("ask"); v_jid = j; v_name = na; @@ -1214,7 +1214,7 @@ bool RosterItem::fromXml(const QDomElement &item) // Roster //--------------------------------------------------------------------------- Roster::Roster() -:QValueList() +:TQValueList() { } @@ -1246,7 +1246,7 @@ Roster::ConstIterator Roster::find(const Jid &j) const //--------------------------------------------------------------------------- // FormField //--------------------------------------------------------------------------- -FormField::FormField(const QString &type, const QString &value) +FormField::FormField(const TQString &type, const TQString &value) { v_type = misc; if(!type.isEmpty()) { @@ -1266,29 +1266,29 @@ int FormField::type() const return v_type; } -QString FormField::realName() const +TQString FormField::realName() const { return typeToTagName(v_type); } -QString FormField::fieldName() const +TQString FormField::fieldName() const { switch(v_type) { - case username: return QObject::tr("Username"); - case nick: return QObject::tr("Nickname"); - case password: return QObject::tr("Password"); - case name: return QObject::tr("Name"); - case first: return QObject::tr("First Name"); - case last: return QObject::tr("Last Name"); - case email: return QObject::tr("E-mail"); - case address: return QObject::tr("Address"); - case city: return QObject::tr("City"); - case state: return QObject::tr("State"); - case zip: return QObject::tr("Zipcode"); - case phone: return QObject::tr("Phone"); - case url: return QObject::tr("URL"); - case date: return QObject::tr("Date"); - case misc: return QObject::tr("Misc"); + case username: return TQObject::tr("Username"); + case nick: return TQObject::tr("Nickname"); + case password: return TQObject::tr("Password"); + case name: return TQObject::tr("Name"); + case first: return TQObject::tr("First Name"); + case last: return TQObject::tr("Last Name"); + case email: return TQObject::tr("E-mail"); + case address: return TQObject::tr("Address"); + case city: return TQObject::tr("City"); + case state: return TQObject::tr("State"); + case zip: return TQObject::tr("Zipcode"); + case phone: return TQObject::tr("Phone"); + case url: return TQObject::tr("URL"); + case date: return TQObject::tr("Date"); + case misc: return TQObject::tr("Misc"); default: return ""; }; } @@ -1298,7 +1298,7 @@ bool FormField::isSecret() const return (type() == password); } -const QString & FormField::value() const +const TQString & FormField::value() const { return v_value; } @@ -1308,7 +1308,7 @@ void FormField::setType(int x) v_type = x; } -bool FormField::setType(const QString &in) +bool FormField::setType(const TQString &in) { int x = tagNameToType(in); if(x == -1) @@ -1318,12 +1318,12 @@ bool FormField::setType(const QString &in) return true; } -void FormField::setValue(const QString &in) +void FormField::setValue(const TQString &in) { v_value = in; } -int FormField::tagNameToType(const QString &in) const +int FormField::tagNameToType(const TQString &in) const { if(!in.compare("username")) return username; if(!in.compare("nick")) return nick; @@ -1344,7 +1344,7 @@ int FormField::tagNameToType(const QString &in) const return -1; } -QString FormField::typeToTagName(int type) const +TQString FormField::typeToTagName(int type) const { switch(type) { case username: return "username"; @@ -1371,7 +1371,7 @@ QString FormField::typeToTagName(int type) const // Form //--------------------------------------------------------------------------- Form::Form(const Jid &j) -:QValueList() +:TQValueList() { setJid(j); } @@ -1385,12 +1385,12 @@ Jid Form::jid() const return v_jid; } -QString Form::instructions() const +TQString Form::instructions() const { return v_instructions; } -QString Form::key() const +TQString Form::key() const { return v_key; } @@ -1400,12 +1400,12 @@ void Form::setJid(const Jid &j) v_jid = j; } -void Form::setInstructions(const QString &s) +void Form::setInstructions(const TQString &s) { v_instructions = s; } -void Form::setKey(const QString &s) +void Form::setKey(const TQString &s) { v_key = s; } @@ -1428,22 +1428,22 @@ const Jid & SearchResult::jid() const return v_jid; } -const QString & SearchResult::nick() const +const TQString & SearchResult::nick() const { return v_nick; } -const QString & SearchResult::first() const +const TQString & SearchResult::first() const { return v_first; } -const QString & SearchResult::last() const +const TQString & SearchResult::last() const { return v_last; } -const QString & SearchResult::email() const +const TQString & SearchResult::email() const { return v_email; } @@ -1453,22 +1453,22 @@ void SearchResult::setJid(const Jid &jid) v_jid = jid; } -void SearchResult::setNick(const QString &nick) +void SearchResult::setNick(const TQString &nick) { v_nick = nick; } -void SearchResult::setFirst(const QString &first) +void SearchResult::setFirst(const TQString &first) { v_first = first; } -void SearchResult::setLast(const QString &last) +void SearchResult::setLast(const TQString &last) { v_last = last; } -void SearchResult::setEmail(const QString &email) +void SearchResult::setEmail(const TQString &email) { v_email = email; } @@ -1481,14 +1481,14 @@ Features::Features() { } -Features::Features(const QStringList &l) +Features::Features(const TQStringList &l) { setList(l); } -Features::Features(const QString &str) +Features::Features(const TQString &str) { - QStringList l; + TQStringList l; l << str; setList(l); @@ -1498,19 +1498,19 @@ Features::~Features() { } -QStringList Features::list() const +TQStringList Features::list() const { return _list; } -void Features::setList(const QStringList &l) +void Features::setList(const TQStringList &l) { _list = l; } -bool Features::test(const QStringList &ns) const +bool Features::test(const TQStringList &ns) const { - QStringList::ConstIterator it = ns.begin(); + TQStringList::ConstIterator it = ns.begin(); for ( ; it != ns.end(); ++it) if ( _list.find( *it ) != _list.end() ) return true; @@ -1521,7 +1521,7 @@ bool Features::test(const QStringList &ns) const #define FID_REGISTER "jabber:iq:register" bool Features::canRegister() const { - QStringList ns; + TQStringList ns; ns << FID_REGISTER; return test(ns); @@ -1530,7 +1530,7 @@ bool Features::canRegister() const #define FID_SEARCH "jabber:iq:search" bool Features::canSearch() const { - QStringList ns; + TQStringList ns; ns << FID_SEARCH; return test(ns); @@ -1539,7 +1539,7 @@ bool Features::canSearch() const #define FID_XHTML "http://jabber.org/protocol/xhtml-im" bool Features::canXHTML() const { - QStringList ns; + TQStringList ns; ns << FID_XHTML; @@ -1549,7 +1549,7 @@ bool Features::canXHTML() const #define FID_GROUPCHAT "jabber:iq:conference" bool Features::canGroupchat() const { - QStringList ns; + TQStringList ns; ns << "http://jabber.org/protocol/muc"; ns << FID_GROUPCHAT; @@ -1559,7 +1559,7 @@ bool Features::canGroupchat() const #define FID_VOICE "http://www.google.com/xmpp/protocol/voice/v1" bool Features::canVoice() const { - QStringList ns; + TQStringList ns; ns << FID_VOICE; return test(ns); @@ -1568,7 +1568,7 @@ bool Features::canVoice() const #define FID_GATEWAY "jabber:iq:gateway" bool Features::isGateway() const { - QStringList ns; + TQStringList ns; ns << FID_GATEWAY; return test(ns); @@ -1577,7 +1577,7 @@ bool Features::isGateway() const #define FID_DISCO "http://jabber.org/protocol/disco" bool Features::canDisco() const { - QStringList ns; + TQStringList ns; ns << FID_DISCO; ns << "http://jabber.org/protocol/disco#info"; ns << "http://jabber.org/protocol/disco#items"; @@ -1588,7 +1588,7 @@ bool Features::canDisco() const #define FID_VCARD "vcard-temp" bool Features::haveVCard() const { - QStringList ns; + TQStringList ns; ns << FID_VCARD; return test(ns); @@ -1602,7 +1602,7 @@ class Features::FeatureName : public QObject Q_OBJECT public: FeatureName() - : QObject(qApp) + : TQObject(qApp) { id2s[FID_Invalid] = tr("ERROR: Incorrect usage of Features class"); id2s[FID_None] = tr("None"); @@ -1617,7 +1617,7 @@ public: id2s[FID_Add] = tr("Add to roster"); // compute reverse map - //QMap::Iterator it = id2s.begin(); + //TQMap::Iterator it = id2s.begin(); //for ( ; it != id2s.end(); ++it) // s2id[it.data()] = it.key(); @@ -1632,9 +1632,9 @@ public: id2f[FID_Add] = FID_ADD; } - //QMap s2id; - QMap id2s; - QMap id2f; + //TQMap s2id; + TQMap id2s; + TQMap id2f; }; static Features::FeatureName *featureName = 0; @@ -1661,13 +1661,13 @@ long Features::id() const return FID_None; } -long Features::id(const QString &feature) +long Features::id(const TQString &feature) { Features f(feature); return f.id(); } -QString Features::feature(long id) +TQString Features::feature(long id) { if ( !featureName ) featureName = new FeatureName(); @@ -1675,7 +1675,7 @@ QString Features::feature(long id) return featureName->id2f[id]; } -QString Features::name(long id) +TQString Features::name(long id) { if ( !featureName ) featureName = new FeatureName(); @@ -1683,12 +1683,12 @@ QString Features::name(long id) return featureName->id2s[id]; } -QString Features::name() const +TQString Features::name() const { return name(id()); } -QString Features::name(const QString &feature) +TQString Features::name(const TQString &feature) { Features f(feature); return f.name(f.id()); @@ -1706,8 +1706,8 @@ public: } Jid jid; - QString name; - QString node; + TQString name; + TQString node; Action action; Features features; @@ -1789,22 +1789,22 @@ void DiscoItem::setJid(const Jid &j) d->jid = j; } -const QString &DiscoItem::name() const +const TQString &DiscoItem::name() const { return d->name; } -void DiscoItem::setName(const QString &n) +void DiscoItem::setName(const TQString &n) { d->name = n; } -const QString &DiscoItem::node() const +const TQString &DiscoItem::node() const { return d->node; } -void DiscoItem::setNode(const QString &n) +void DiscoItem::setNode(const TQString &n) { d->node = n; } @@ -1843,7 +1843,7 @@ void DiscoItem::setIdentities(const Identities &i) } -DiscoItem::Action DiscoItem::string2action(QString s) +DiscoItem::Action DiscoItem::string2action(TQString s) { Action a; @@ -1857,16 +1857,16 @@ DiscoItem::Action DiscoItem::string2action(QString s) return a; } -QString DiscoItem::action2string(Action a) +TQString DiscoItem::action2string(Action a) { - QString s; + TQString s; if ( a == Update ) s = "update"; else if ( a == Remove ) s = "remove"; else - s = QString::null; + s = TQString::null; return s; } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp index 4c937dd0..95f61e69 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.cpp @@ -27,23 +27,23 @@ //#include"xmpp_types.h" #include"xmpp_vcard.h" -#include -#include +#include +#include using namespace XMPP; -static QString lineEncode(QString str) +static TQString lineEncode(TQString str) { - str.replace(QRegExp("\\\\"), "\\\\"); // backslash to double-backslash - str.replace(QRegExp("\\|"), "\\p"); // pipe to \p - str.replace(QRegExp("\n"), "\\n"); // newline to \n + str.replace(TQRegExp("\\\\"), "\\\\"); // backslash to double-backslash + str.replace(TQRegExp("\\|"), "\\p"); // pipe to \p + str.replace(TQRegExp("\n"), "\\n"); // newline to \n return str; } -static QString lineDecode(const QString &str) +static TQString lineDecode(const TQString &str) { - QString ret; + TQString ret; for(unsigned int n = 0; n < str.length(); ++n) { if(str.at(n) == '\\') { @@ -66,12 +66,12 @@ static QString lineDecode(const QString &str) return ret; } -static Roster xmlReadRoster(const QDomElement &q, bool push) +static Roster xmlReadRoster(const TQDomElement &q, bool push) { Roster r; - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; @@ -115,24 +115,24 @@ JT_Register::~JT_Register() delete d; } -void JT_Register::reg(const QString &user, const QString &pass) +void JT_Register::reg(const TQString &user, const TQString &pass) { d->type = 0; to = client()->host(); iq = createIQ(doc(), "set", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:register"); iq.appendChild(query); query.appendChild(textTag(doc(), "username", user)); query.appendChild(textTag(doc(), "password", pass)); } -void JT_Register::changepw(const QString &pass) +void JT_Register::changepw(const TQString &pass) { d->type = 1; to = client()->host(); iq = createIQ(doc(), "set", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:register"); iq.appendChild(query); query.appendChild(textTag(doc(), "username", client()->user())); @@ -144,7 +144,7 @@ void JT_Register::unreg(const Jid &j) d->type = 2; to = j.isEmpty() ? client()->host() : j.full(); iq = createIQ(doc(), "set", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:register"); iq.appendChild(query); @@ -160,7 +160,7 @@ void JT_Register::getForm(const Jid &j) d->type = 3; to = j; iq = createIQ(doc(), "get", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:register"); iq.appendChild(query); } @@ -170,7 +170,7 @@ void JT_Register::setForm(const Form &form) d->type = 4; to = form.jid(); iq = createIQ(doc(), "set", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:register"); iq.appendChild(query); @@ -195,7 +195,7 @@ void JT_Register::onGo() send(iq); } -bool JT_Register::take(const QDomElement &x) +bool JT_Register::take(const TQDomElement &x) { if(!iqVerify(x, to, id())) return false; @@ -206,9 +206,9 @@ bool JT_Register::take(const QDomElement &x) d->form.clear(); d->form.setJid(from); - QDomElement q = queryTag(x); - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQDomElement q = queryTag(x); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; @@ -270,7 +270,7 @@ void JT_UnRegister::onGo() d->jt_reg = new JT_Register(this); d->jt_reg->getForm(d->j); - connect(d->jt_reg, SIGNAL(finished()), SLOT(getFormFinished())); + connect(d->jt_reg, TQT_SIGNAL(finished()), TQT_SLOT(getFormFinished())); d->jt_reg->go(false); } @@ -279,7 +279,7 @@ void JT_UnRegister::getFormFinished() disconnect(d->jt_reg, 0, this, 0); d->jt_reg->unreg(d->j); - connect(d->jt_reg, SIGNAL(finished()), SLOT(unregFinished())); + connect(d->jt_reg, TQT_SIGNAL(finished()), TQT_SLOT(unregFinished())); d->jt_reg->go(false); } @@ -303,7 +303,7 @@ public: Private() {} Roster roster; - QValueList itemList; + TQValueList itemList; }; JT_Roster::JT_Roster(Task *parent) @@ -323,20 +323,20 @@ void JT_Roster::get() type = 0; //to = client()->host(); iq = createIQ(doc(), "get", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:roster"); iq.appendChild(query); } -void JT_Roster::set(const Jid &jid, const QString &name, const QStringList &groups) +void JT_Roster::set(const Jid &jid, const TQString &name, const TQStringList &groups) { type = 1; //to = client()->host(); - QDomElement item = doc()->createElement("item"); + TQDomElement item = doc()->createElement("item"); item.setAttribute("jid", jid.full()); if(!name.isEmpty()) item.setAttribute("name", name); - for(QStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it) + for(TQStringList::ConstIterator it = groups.begin(); it != groups.end(); ++it) item.appendChild(textTag(doc(), "group", *it)); d->itemList += item; } @@ -345,7 +345,7 @@ void JT_Roster::remove(const Jid &jid) { type = 1; //to = client()->host(); - QDomElement item = doc()->createElement("item"); + TQDomElement item = doc()->createElement("item"); item.setAttribute("jid", jid.full()); item.setAttribute("subscription", "remove"); d->itemList += item; @@ -358,10 +358,10 @@ void JT_Roster::onGo() else if(type == 1) { //to = client()->host(); iq = createIQ(doc(), "set", to.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:roster"); iq.appendChild(query); - for(QValueList::ConstIterator it = d->itemList.begin(); it != d->itemList.end(); ++it) + for(TQValueList::ConstIterator it = d->itemList.begin(); it != d->itemList.end(); ++it) query.appendChild(*it); send(iq); } @@ -372,25 +372,25 @@ const Roster & JT_Roster::roster() const return d->roster; } -QString JT_Roster::toString() const +TQString JT_Roster::toString() const { if(type != 1) return ""; - QDomElement i = doc()->createElement("request"); + TQDomElement i = doc()->createElement("request"); i.setAttribute("type", "JT_Roster"); - for(QValueList::ConstIterator it = d->itemList.begin(); it != d->itemList.end(); ++it) + for(TQValueList::ConstIterator it = d->itemList.begin(); it != d->itemList.end(); ++it) i.appendChild(*it); return lineEncode(Stream::xmlToString(i)); return ""; } -bool JT_Roster::fromString(const QString &str) +bool JT_Roster::fromString(const TQString &str) { - QDomDocument *dd = new QDomDocument; + TQDomDocument *dd = new QDomDocument; if(!dd->setContent(lineDecode(str).utf8())) return false; - QDomElement e = doc()->importNode(dd->documentElement(), true).toElement(); + TQDomElement e = doc()->importNode(dd->documentElement(), true).toElement(); delete dd; if(e.tagName() != "request" || e.attribute("type") != "JT_Roster") @@ -398,8 +398,8 @@ bool JT_Roster::fromString(const QString &str) type = 1; d->itemList.clear(); - for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; d->itemList += i; @@ -408,7 +408,7 @@ bool JT_Roster::fromString(const QString &str) return true; } -bool JT_Roster::take(const QDomElement &x) +bool JT_Roster::take(const TQDomElement &x) { if(!iqVerify(x, client()->host(), id())) return false; @@ -416,7 +416,7 @@ bool JT_Roster::take(const QDomElement &x) // get if(type == 0) { if(x.attribute("type") == "result") { - QDomElement q = queryTag(x); + TQDomElement q = queryTag(x); d->roster = xmlReadRoster(q, false); setSuccess(); } @@ -457,7 +457,7 @@ JT_PushRoster::~JT_PushRoster() { } -bool JT_PushRoster::take(const QDomElement &e) +bool JT_PushRoster::take(const TQDomElement &e) { // must be an iq-set tag if(e.tagName() != "iq" || e.attribute("type") != "set") @@ -504,21 +504,21 @@ void JT_Presence::pres(const Status &s) if(!s.status().isEmpty()) tag.appendChild(textTag(doc(), "status", s.status())); - tag.appendChild( textTag(doc(), "priority", QString("%1").arg(s.priority()) ) ); + tag.appendChild( textTag(doc(), "priority", TQString("%1").arg(s.priority()) ) ); if(!s.keyID().isEmpty()) { - QDomElement x = textTag(doc(), "x", s.keyID()); + TQDomElement x = textTag(doc(), "x", s.keyID()); x.setAttribute("xmlns", "http://jabber.org/protocol/e2e"); tag.appendChild(x); } if(!s.xsigned().isEmpty()) { - QDomElement x = textTag(doc(), "x", s.xsigned()); + TQDomElement x = textTag(doc(), "x", s.xsigned()); x.setAttribute("xmlns", "jabber:x:signed"); tag.appendChild(x); } if(!s.capsNode().isEmpty() && !s.capsVersion().isEmpty()) { - QDomElement c = doc()->createElement("c"); + TQDomElement c = doc()->createElement("c"); c.setAttribute("xmlns","http://jabber.org/protocol/caps"); c.setAttribute("node",s.capsNode()); c.setAttribute("ver",s.capsVersion()); @@ -535,7 +535,7 @@ void JT_Presence::pres(const Jid &to, const Status &s) tag.setAttribute("to", to.full()); } -void JT_Presence::sub(const Jid &to, const QString &subType) +void JT_Presence::sub(const Jid &to, const TQString &subType) { type = 1; @@ -563,7 +563,7 @@ JT_PushPresence::~JT_PushPresence() { } -bool JT_PushPresence::take(const QDomElement &e) +bool JT_PushPresence::take(const TQDomElement &e) { if(e.tagName() != "presence") return false; @@ -572,12 +572,12 @@ bool JT_PushPresence::take(const QDomElement &e) Status p; if(e.hasAttribute("type")) { - QString type = e.attribute("type"); + TQString type = e.attribute("type"); if(type == "unavailable") { p.setIsAvailable(false); } else if(type == "error") { - QString str = ""; + TQString str = ""; int code = 0; getErrorFromElement(e, &code, &str); p.setError(code, str); @@ -588,7 +588,7 @@ bool JT_PushPresence::take(const QDomElement &e) } } - QDomElement tag; + TQDomElement tag; bool found; tag = findSubTag(e, "status", &found); @@ -601,23 +601,23 @@ bool JT_PushPresence::take(const QDomElement &e) if(found) p.setPriority(tagContent(tag).toInt()); - for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; if(i.tagName() == "x" && i.attribute("xmlns") == "jabber:x:delay") { if(i.hasAttribute("stamp")) { - QDateTime dt; + TQDateTime dt; if(stamp2TS(i.attribute("stamp"), &dt)) dt = dt.addSecs(client()->timeZoneOffset() * 3600); p.setTimeStamp(dt); } } else if(i.tagName() == "x" && i.attribute("xmlns") == "gabber:x:music:info") { - QDomElement t; + TQDomElement t; bool found; - QString title, state; + TQString title, state; t = findSubTag(i, "title", &found); if(found) @@ -651,17 +651,17 @@ bool JT_PushPresence::take(const QDomElement &e) //---------------------------------------------------------------------------- // JT_Message //---------------------------------------------------------------------------- -static QDomElement oldStyleNS(const QDomElement &e) +static TQDomElement oldStyleNS(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; if(!par.isNull() && par.namespaceURI() == e.namespaceURI()) noShowNS = true; - QDomElement i; + TQDomElement i; uint x; //if(noShowNS) i = e.ownerDocument().createElement(e.tagName()); @@ -669,7 +669,7 @@ static QDomElement oldStyleNS(const QDomElement &e) // i = e.ownerDocument().createElementNS(e.namespaceURI(), e.tagName()); // copy attributes - QDomNamedNodeMap al = e.attributes(); + TQDomNamedNodeMap al = e.attributes(); for(x = 0; x < al.count(); ++x) i.setAttributeNode(al.item(x).cloneNode().toAttr()); @@ -677,9 +677,9 @@ static QDomElement oldStyleNS(const QDomElement &e) i.setAttribute("xmlns", e.namespaceURI()); // 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(oldStyleNS(n.toElement())); else @@ -702,7 +702,7 @@ JT_Message::~JT_Message() void JT_Message::onGo() { Stanza s = m.toStanza(&(client()->stream())); - QDomElement e = oldStyleNS(s.element()); + TQDomElement e = oldStyleNS(s.element()); send(e); setSuccess(); } @@ -711,41 +711,41 @@ void JT_Message::onGo() //---------------------------------------------------------------------------- // JT_PushMessage //---------------------------------------------------------------------------- -static QDomElement addCorrectNS(const QDomElement &e) +static TQDomElement addCorrectNS(const TQDomElement &e) { uint x; // grab child nodes - /*QDomDocumentFragment frag = e.ownerDocument().createDocumentFragment(); - QDomNodeList nl = e.childNodes(); + /*TQDomDocumentFragment frag = e.ownerDocument().createDocumentFragment(); + TQDomNodeList nl = e.childNodes(); for(x = 0; x < nl.count(); ++x) frag.appendChild(nl.item(x).cloneNode());*/ // find closest xmlns - QDomNode n = e; + TQDomNode n = e; while(!n.isNull() && !n.toElement().hasAttribute("xmlns")) n = n.parentNode(); - QString ns; + TQString ns; if(n.isNull() || !n.toElement().hasAttribute("xmlns")) ns = "jabber:client"; else ns = n.toElement().attribute("xmlns"); // make a new node - QDomElement i = e.ownerDocument().createElementNS(ns, e.tagName()); + TQDomElement i = e.ownerDocument().createElementNS(ns, e.tagName()); // copy attributes - QDomNamedNodeMap al = e.attributes(); + TQDomNamedNodeMap al = e.attributes(); for(x = 0; x < al.count(); ++x) { - QDomAttr a = al.item(x).toAttr(); + TQDomAttr a = al.item(x).toAttr(); if(a.name() != "xmlns") i.setAttributeNodeNS(al.item(x).cloneNode().toAttr()); } // 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(addCorrectNS(n.toElement())); else @@ -765,7 +765,7 @@ JT_PushMessage::~JT_PushMessage() { } -bool JT_PushMessage::take(const QDomElement &e) +bool JT_PushMessage::take(const TQDomElement &e) { if(e.tagName() != "message") return false; @@ -796,7 +796,7 @@ public: Private() {} int seconds; - QString message; + TQString message; }; JT_GetLastActivity::JT_GetLastActivity(Task *parent) @@ -814,7 +814,7 @@ void JT_GetLastActivity::get(const Jid &j) { jid = j; iq = createIQ(doc(), "get", jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:last"); iq.appendChild(query); } @@ -824,7 +824,7 @@ int JT_GetLastActivity::seconds() const return d->seconds; } -const QString &JT_GetLastActivity::message() const +const TQString &JT_GetLastActivity::message() const { return d->message; } @@ -834,13 +834,13 @@ void JT_GetLastActivity::onGo() send(iq); } -bool JT_GetLastActivity::take(const QDomElement &x) +bool JT_GetLastActivity::take(const TQDomElement &x) { if(!iqVerify(x, jid, id())) return false; if(x.attribute("type") == "result") { - QDomElement q = queryTag(x); + TQDomElement q = queryTag(x); d->message = q.text(); bool ok; @@ -869,7 +869,7 @@ void JT_GetServices::get(const Jid &j) jid = j; iq = createIQ(doc(), "get", jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:agents"); iq.appendChild(query); } @@ -884,17 +884,17 @@ void JT_GetServices::onGo() send(iq); } -bool JT_GetServices::take(const QDomElement &x) +bool JT_GetServices::take(const TQDomElement &x) { if(!iqVerify(x, jid, id())) return false; if(x.attribute("type") == "result") { - QDomElement q = queryTag(x); + TQDomElement q = queryTag(x); // agents - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; @@ -903,7 +903,7 @@ bool JT_GetServices::take(const QDomElement &x) a.setJid(Jid(i.attribute("jid"))); - QDomElement tag; + TQDomElement tag; bool found; tag = findSubTag(i, "name", &found); @@ -911,7 +911,7 @@ bool JT_GetServices::take(const QDomElement &x) a.setName(tagContent(tag)); // determine which namespaces does item support - QStringList ns; + TQStringList ns; tag = findSubTag(i, "register", &found); if(found) @@ -950,7 +950,7 @@ class JT_VCard::Private public: Private() {} - QDomElement iq; + TQDomElement iq; Jid jid; VCard vcard; }; @@ -972,7 +972,7 @@ void JT_VCard::get(const Jid &_jid) type = 0; d->jid = _jid; d->iq = createIQ(doc(), "get", d->jid.full(), id()); - QDomElement v = doc()->createElement("vCard"); + TQDomElement v = doc()->createElement("vCard"); v.setAttribute("xmlns", "vcard-temp"); v.setAttribute("version", "2.0"); v.setAttribute("prodid", "-//HandGen//NONSGML vGen v1.0//EN"); @@ -1003,7 +1003,7 @@ void JT_VCard::onGo() send(d->iq); } -bool JT_VCard::take(const QDomElement &x) +bool JT_VCard::take(const TQDomElement &x) { Jid to = d->jid; if (to.userHost() == client()->jid().userHost()) @@ -1013,8 +1013,8 @@ bool JT_VCard::take(const QDomElement &x) if(x.attribute("type") == "result") { if(type == 0) { - for(QDomNode n = x.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement q = n.toElement(); + for(TQDomNode n = x.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement q = n.toElement(); if(q.isNull()) continue; @@ -1052,7 +1052,7 @@ public: Jid jid; Form form; - QValueList resultList; + TQValueList resultList; }; JT_Search::JT_Search(Task *parent) @@ -1072,7 +1072,7 @@ void JT_Search::get(const Jid &jid) type = 0; d->jid = jid; iq = createIQ(doc(), "get", d->jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:search"); iq.appendChild(query); } @@ -1082,7 +1082,7 @@ void JT_Search::set(const Form &form) type = 1; d->jid = form.jid(); iq = createIQ(doc(), "set", d->jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:search"); iq.appendChild(query); @@ -1102,7 +1102,7 @@ const Form & JT_Search::form() const return d->form; } -const QValueList & JT_Search::results() const +const TQValueList & JT_Search::results() const { return d->resultList; } @@ -1112,7 +1112,7 @@ void JT_Search::onGo() send(iq); } -bool JT_Search::take(const QDomElement &x) +bool JT_Search::take(const TQDomElement &x) { if(!iqVerify(x, d->jid, id())) return false; @@ -1123,9 +1123,9 @@ bool JT_Search::take(const QDomElement &x) d->form.clear(); d->form.setJid(from); - QDomElement q = queryTag(x); - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQDomElement q = queryTag(x); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; @@ -1145,16 +1145,16 @@ bool JT_Search::take(const QDomElement &x) else { d->resultList.clear(); - QDomElement q = queryTag(x); - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQDomElement q = queryTag(x); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; if(i.tagName() == "item") { SearchResult r(Jid(i.attribute("jid"))); - QDomElement tag; + TQDomElement tag; bool found; tag = findSubTag(i, "nick", &found); @@ -1196,7 +1196,7 @@ void JT_ClientVersion::get(const Jid &jid) { j = jid; iq = createIQ(doc(), "get", j.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:version"); iq.appendChild(query); } @@ -1206,15 +1206,15 @@ void JT_ClientVersion::onGo() send(iq); } -bool JT_ClientVersion::take(const QDomElement &x) +bool JT_ClientVersion::take(const TQDomElement &x) { if(!iqVerify(x, j, id())) return false; if(x.attribute("type") == "result") { bool found; - QDomElement q = queryTag(x); - QDomElement tag; + TQDomElement q = queryTag(x); + TQDomElement tag; tag = findSubTag(q, "name", &found); if(found) v_name = tagContent(tag); @@ -1239,17 +1239,17 @@ const Jid & JT_ClientVersion::jid() const return j; } -const QString & JT_ClientVersion::name() const +const TQString & JT_ClientVersion::name() const { return v_name; } -const QString & JT_ClientVersion::version() const +const TQString & JT_ClientVersion::version() const { return v_ver; } -const QString & JT_ClientVersion::os() const +const TQString & JT_ClientVersion::os() const { return v_os; } @@ -1263,7 +1263,7 @@ const QString & JT_ClientVersion::os() const { j = _j; iq = createIQ("get", j.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:time"); iq.appendChild(query); } @@ -1273,15 +1273,15 @@ void JT_ClientTime::go() send(iq); } -bool JT_ClientTime::take(const QDomElement &x) +bool JT_ClientTime::take(const TQDomElement &x) { if(x.attribute("id") != id()) return FALSE; if(x.attribute("type") == "result") { bool found; - QDomElement q = queryTag(x); - QDomElement tag; + TQDomElement q = queryTag(x); + TQDomElement tag; tag = findSubTag(q, "utc", &found); if(found) stamp2TS(tagContent(tag), &utc); @@ -1316,15 +1316,15 @@ JT_ServInfo::~JT_ServInfo() { } -bool JT_ServInfo::take(const QDomElement &e) +bool JT_ServInfo::take(const TQDomElement &e) { if(e.tagName() != "iq" || e.attribute("type") != "get") return false; - QString ns = queryNS(e); + TQString ns = queryNS(e); if(ns == "jabber:iq:version") { - QDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id")); - QDomElement query = doc()->createElement("query"); + TQDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id")); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:version"); iq.appendChild(query); query.appendChild(textTag(doc(), "name", client()->clientName())); @@ -1334,29 +1334,29 @@ bool JT_ServInfo::take(const QDomElement &e) return true; } //else if(ns == "jabber:iq:time") { - // QDomElement iq = createIQ("result", e.attribute("from"), e.attribute("id")); - // QDomElement query = doc()->createElement("query"); + // TQDomElement iq = createIQ("result", e.attribute("from"), e.attribute("id")); + // TQDomElement query = doc()->createElement("query"); // query.setAttribute("xmlns", "jabber:iq:time"); // iq.appendChild(query); - // QDateTime local = QDateTime::currentDateTime(); - // QDateTime utc = local.addSecs(-getTZOffset() * 3600); - // QString str = getTZString(); + // TQDateTime local = TQDateTime::currentDateTime(); + // TQDateTime utc = local.addSecs(-getTZOffset() * 3600); + // TQString str = getTZString(); // query.appendChild(textTag("utc", TS2stamp(utc))); // query.appendChild(textTag("tz", str)); - // query.appendChild(textTag("display", QString("%1 %2").arg(local.toString()).arg(str))); + // query.appendChild(textTag("display", TQString("%1 %2").arg(local.toString()).arg(str))); // send(iq); // return TRUE; //} else if(ns == "http://jabber.org/protocol/disco#info") { // Find out the node - QString node; + TQString node; bool found; - QDomElement q = findSubTag(e, "query", &found); + TQDomElement q = findSubTag(e, "query", &found); if(found) // NOTE: Should always be true, since a NS was found above node = q.attribute("node"); - QDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id")); - QDomElement query = doc()->createElement("query"); + TQDomElement iq = createIQ(doc(), "result", e.attribute("from"), e.attribute("id")); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "http://jabber.org/protocol/disco#info"); if (!node.isEmpty()) query.setAttribute("node", node); @@ -1364,7 +1364,7 @@ bool JT_ServInfo::take(const QDomElement &e) // Identity DiscoItem::Identity identity = client()->identity(); - QDomElement id = doc()->createElement("identity"); + TQDomElement id = doc()->createElement("identity"); if (!identity.category.isEmpty() && !identity.type.isEmpty()) { id.setAttribute("category",identity.category); id.setAttribute("type",identity.type); @@ -1379,7 +1379,7 @@ bool JT_ServInfo::take(const QDomElement &e) } query.appendChild(id); - QDomElement feature; + TQDomElement feature; if (node.isEmpty() || node == client()->capsNode() + "#" + client()->capsVersion()) { // Standard features feature = doc()->createElement("feature"); @@ -1404,10 +1404,10 @@ bool JT_ServInfo::take(const QDomElement &e) if (node.isEmpty()) { // Extended features - QStringList exts = client()->extensions(); - for (QStringList::ConstIterator i = exts.begin(); i != exts.end(); ++i) { - const QStringList& l = client()->extension(*i).list(); - for ( QStringList::ConstIterator j = l.begin(); j != l.end(); ++j ) { + TQStringList exts = client()->extensions(); + for (TQStringList::ConstIterator i = exts.begin(); i != exts.end(); ++i) { + const TQStringList& l = client()->extension(*i).list(); + for ( TQStringList::ConstIterator j = l.begin(); j != l.end(); ++j ) { feature = doc()->createElement("feature"); feature.setAttribute("var", *j); query.appendChild(feature); @@ -1416,10 +1416,10 @@ bool JT_ServInfo::take(const QDomElement &e) } } else if (node.startsWith(client()->capsNode() + "#")) { - QString ext = node.right(node.length()-client()->capsNode().length()-1); + TQString ext = node.right(node.length()-client()->capsNode().length()-1); if (client()->extensions().contains(ext)) { - const QStringList& l = client()->extension(ext).list(); - for ( QStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { + const TQStringList& l = client()->extension(ext).list(); + for ( TQStringList::ConstIterator it = l.begin(); it != l.end(); ++it ) { feature = doc()->createElement("feature"); feature.setAttribute("var", *it); query.appendChild(feature); @@ -1455,18 +1455,18 @@ void JT_Gateway::get(const Jid &jid) type = 0; v_jid = jid; iq = createIQ(doc(), "get", v_jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:gateway"); iq.appendChild(query); } -void JT_Gateway::set(const Jid &jid, const QString &prompt) +void JT_Gateway::set(const Jid &jid, const TQString &prompt) { type = 1; v_jid = jid; v_prompt = prompt; iq = createIQ(doc(), "set", v_jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:gateway"); iq.appendChild(query); query.appendChild(textTag(doc(), "prompt", v_prompt)); @@ -1482,26 +1482,26 @@ Jid JT_Gateway::jid() const return v_jid; } -QString JT_Gateway::desc() const +TQString JT_Gateway::desc() const { return v_desc; } -QString JT_Gateway::prompt() const +TQString JT_Gateway::prompt() const { return v_prompt; } -bool JT_Gateway::take(const QDomElement &x) +bool JT_Gateway::take(const TQDomElement &x) { if(!iqVerify(x, v_jid, id())) return false; if(x.attribute("type") == "result") { if(type == 0) { - QDomElement query = queryTag(x); + TQDomElement query = queryTag(x); bool found; - QDomElement tag; + TQDomElement tag; tag = findSubTag(query, "desc", &found); if(found) v_desc = tagContent(tag); @@ -1510,9 +1510,9 @@ bool JT_Gateway::take(const QDomElement &x) v_prompt = tagContent(tag); } else { - QDomElement query = queryTag(x); + TQDomElement query = queryTag(x); bool found; - QDomElement tag; + TQDomElement tag; tag = findSubTag(query, "prompt", &found); if(found) v_prompt = tagContent(tag); @@ -1533,7 +1533,7 @@ bool JT_Gateway::take(const QDomElement &x) class JT_Browse::Private { public: - QDomElement iq; + TQDomElement iq; Jid jid; AgentList agentList; AgentItem root; @@ -1556,7 +1556,7 @@ void JT_Browse::get (const Jid &j) d->jid = j; d->iq = createIQ(doc(), "get", d->jid.full(), id()); - QDomElement query = doc()->createElement("item"); + TQDomElement query = doc()->createElement("item"); query.setAttribute("xmlns", "jabber:iq:browse"); d->iq.appendChild(query); } @@ -1576,7 +1576,7 @@ void JT_Browse::onGo () send(d->iq); } -AgentItem JT_Browse::browseHelper (const QDomElement &i) +AgentItem JT_Browse::browseHelper (const TQDomElement &i) { AgentItem a; @@ -1598,9 +1598,9 @@ AgentItem JT_Browse::browseHelper (const QDomElement &i) a.setType ( i.attribute("type") ); - QStringList ns; - for(QDomNode n = i.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQStringList ns; + for(TQDomNode n = i.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; @@ -1618,21 +1618,21 @@ AgentItem JT_Browse::browseHelper (const QDomElement &i) return a; } -bool JT_Browse::take(const QDomElement &x) +bool JT_Browse::take(const TQDomElement &x) { if(!iqVerify(x, d->jid, id())) return false; if(x.attribute("type") == "result") { - for(QDomNode n = x.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = x.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; d->root = browseHelper (i); - for(QDomNode nn = i.firstChild(); !nn.isNull(); nn = nn.nextSibling()) { - QDomElement e = nn.toElement(); + for(TQDomNode nn = i.firstChild(); !nn.isNull(); nn = nn.nextSibling()) { + TQDomElement e = nn.toElement(); if ( e.isNull() ) continue; if ( e.tagName() == "ns" ) @@ -1659,7 +1659,7 @@ class JT_DiscoItems::Private public: Private() { } - QDomElement iq; + TQDomElement iq; Jid jid; DiscoList items; }; @@ -1680,13 +1680,13 @@ void JT_DiscoItems::get(const DiscoItem &item) get(item.jid(), item.node()); } -void JT_DiscoItems::get (const Jid &j, const QString &node) +void JT_DiscoItems::get (const Jid &j, const TQString &node) { d->items.clear(); d->jid = j; d->iq = createIQ(doc(), "get", d->jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "http://jabber.org/protocol/disco#items"); if ( !node.isEmpty() ) @@ -1705,16 +1705,16 @@ void JT_DiscoItems::onGo () send(d->iq); } -bool JT_DiscoItems::take(const QDomElement &x) +bool JT_DiscoItems::take(const TQDomElement &x) { if(!iqVerify(x, d->jid, id())) return false; if(x.attribute("type") == "result") { - QDomElement q = queryTag(x); + TQDomElement q = queryTag(x); - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement e = n.toElement(); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement e = n.toElement(); if( e.isNull() ) continue; @@ -1747,9 +1747,9 @@ class JT_DiscoInfo::Private public: Private() { } - QDomElement iq; + TQDomElement iq; Jid jid; - QString node; + TQString node; DiscoItem item; }; @@ -1772,21 +1772,21 @@ void JT_DiscoInfo::get(const DiscoItem &item) get(item.jid(), item.node(), id); } -void JT_DiscoInfo::get (const Jid &j, const QString &node, DiscoItem::Identity ident) +void JT_DiscoInfo::get (const Jid &j, const TQString &node, DiscoItem::Identity ident) { d->item = DiscoItem(); // clear item d->jid = j; d->node = node; d->iq = createIQ(doc(), "get", d->jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "http://jabber.org/protocol/disco#info"); if ( !node.isEmpty() ) query.setAttribute("node", node); if ( !ident.category.isEmpty() && !ident.type.isEmpty() ) { - QDomElement i = doc()->createElement("item"); + TQDomElement i = doc()->createElement("item"); i.setAttribute("category", ident.category); i.setAttribute("type", ident.type); @@ -1816,7 +1816,7 @@ const Jid& JT_DiscoInfo::jid() const * Is here because sometimes the responder does not include this information * in the reply. */ -const QString& JT_DiscoInfo::node() const +const TQString& JT_DiscoInfo::node() const { return d->node; } @@ -1833,24 +1833,24 @@ void JT_DiscoInfo::onGo () send(d->iq); } -bool JT_DiscoInfo::take(const QDomElement &x) +bool JT_DiscoInfo::take(const TQDomElement &x) { if(!iqVerify(x, d->jid, id())) return false; if(x.attribute("type") == "result") { - QDomElement q = queryTag(x); + TQDomElement q = queryTag(x); DiscoItem item; item.setJid( d->jid ); item.setNode( q.attribute("node") ); - QStringList features; + TQStringList features; DiscoItem::Identities identities; - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement e = n.toElement(); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement e = n.toElement(); if( e.isNull() ) continue; @@ -1890,7 +1890,7 @@ class JT_DiscoPublish::Private public: Private() { } - QDomElement iq; + TQDomElement iq; Jid jid; DiscoList list; }; @@ -1912,7 +1912,7 @@ void JT_DiscoPublish::set(const Jid &j, const DiscoList &list) d->jid = j; d->iq = createIQ(doc(), "set", d->jid.full(), id()); - QDomElement query = doc()->createElement("query"); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "http://jabber.org/protocol/disco#items"); // FIXME: unsure about this @@ -1921,7 +1921,7 @@ void JT_DiscoPublish::set(const Jid &j, const DiscoList &list) DiscoList::ConstIterator it = list.begin(); for ( ; it != list.end(); ++it) { - QDomElement w = doc()->createElement("item"); + TQDomElement w = doc()->createElement("item"); w.setAttribute("jid", (*it).jid().full()); if ( !(*it).name().isEmpty() ) @@ -1941,7 +1941,7 @@ void JT_DiscoPublish::onGo () send(d->iq); } -bool JT_DiscoPublish::take(const QDomElement &x) +bool JT_DiscoPublish::take(const TQDomElement &x) { if(!iqVerify(x, d->jid, id())) return false; @@ -1988,21 +1988,21 @@ void JT_MucPresence::pres(const Status &s) if(!s.status().isEmpty()) tag.appendChild(textTag(doc(), "status", s.status())); - tag.appendChild( textTag(doc(), "priority", QString("%1").arg(s.priority()) ) ); + tag.appendChild( textTag(doc(), "priority", TQString("%1").arg(s.priority()) ) ); if(!s.keyID().isEmpty()) { - QDomElement x = textTag(doc(), "x", s.keyID()); + TQDomElement x = textTag(doc(), "x", s.keyID()); x.setAttribute("xmlns", "http://jabber.org/protocol/e2e"); tag.appendChild(x); } if(!s.xsigned().isEmpty()) { - QDomElement x = textTag(doc(), "x", s.xsigned()); + TQDomElement x = textTag(doc(), "x", s.xsigned()); x.setAttribute("xmlns", "jabber:x:signed"); tag.appendChild(x); } if(!s.capsNode().isEmpty() && !s.capsVersion().isEmpty()) { - QDomElement c = doc()->createElement("c"); + TQDomElement c = doc()->createElement("c"); c.setAttribute("xmlns","http://jabber.org/protocol/caps"); c.setAttribute("node",s.capsNode()); c.setAttribute("ver",s.capsVersion()); @@ -2013,11 +2013,11 @@ void JT_MucPresence::pres(const Status &s) } } -void JT_MucPresence::pres(const Jid &to, const Status &s, const QString &password) +void JT_MucPresence::pres(const Jid &to, const Status &s, const TQString &password) { pres(s); tag.setAttribute("to", to.full()); - QDomElement x = textTag(doc(), "x", s.xsigned()); + TQDomElement x = textTag(doc(), "x", s.xsigned()); x.setAttribute("xmlns", "http://jabber.org/protocol/muc"); x.appendChild( textTag(doc(), "password", password.latin1()) ); tag.appendChild(x); @@ -2038,8 +2038,8 @@ class JT_PrivateStorage::Private public: Private() : type(-1) {} - QDomElement iq; - QDomElement elem; + TQDomElement iq; + TQDomElement elem; int type; }; @@ -2054,27 +2054,27 @@ JT_PrivateStorage::~JT_PrivateStorage() delete d; } -void JT_PrivateStorage::get(const QString& tag, const QString& xmlns) +void JT_PrivateStorage::get(const TQString& tag, const TQString& xmlns) { d->type = 0; - d->iq = createIQ(doc(), "get" , QString() , id() ); - QDomElement query = doc()->createElement("query"); + d->iq = createIQ(doc(), "get" , TQString() , id() ); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:private"); d->iq.appendChild(query); - QDomElement s = doc()->createElement(tag); + TQDomElement s = doc()->createElement(tag); if(!xmlns.isEmpty()) s.setAttribute("xmlns", xmlns); query.appendChild(s); } -void JT_PrivateStorage::set(const QDomElement& element) +void JT_PrivateStorage::set(const TQDomElement& element) { d->type = 1; d->elem=element; - QDomNode n=doc()->importNode(element,true); + TQDomNode n=doc()->importNode(element,true); - d->iq = createIQ(doc(), "set" , QString() , id() ); - QDomElement query = doc()->createElement("query"); + d->iq = createIQ(doc(), "set" , TQString() , id() ); + TQDomElement query = doc()->createElement("query"); query.setAttribute("xmlns", "jabber:iq:private"); d->iq.appendChild(query); query.appendChild(n); @@ -2085,17 +2085,17 @@ void JT_PrivateStorage::onGo() send(d->iq); } -bool JT_PrivateStorage::take(const QDomElement &x) +bool JT_PrivateStorage::take(const TQDomElement &x) { - QString to = client()->host(); + TQString to = client()->host(); if(!iqVerify(x, to, id())) return false; if(x.attribute("type") == "result") { if(d->type == 0) { - QDomElement q = queryTag(x); - for(QDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + TQDomElement q = queryTag(x); + for(TQDomNode n = q.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; d->elem=i; @@ -2113,7 +2113,7 @@ bool JT_PrivateStorage::take(const QDomElement &x) } -QDomElement JT_PrivateStorage::element( ) +TQDomElement JT_PrivateStorage::element( ) { return d->elem; } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.h b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.h index bf1cc44d..c8085013 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.h +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_tasks.h @@ -21,8 +21,8 @@ #ifndef JABBER_TASKS_H #define JABBER_TASKS_H -#include -#include +#include +#include #include"im.h" #include"xmpp_vcard.h" @@ -39,8 +39,8 @@ namespace XMPP JT_Register(Task *parent); ~JT_Register(); - void reg(const QString &user, const QString &pass); - void changepw(const QString &pass); + void reg(const TQString &user, const TQString &pass); + void changepw(const TQString &pass); void unreg(const Jid &j=""); const Form & form() const; @@ -48,10 +48,10 @@ namespace XMPP void setForm(const Form &); void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: - QDomElement iq; + TQDomElement iq; Jid to; class Private; @@ -86,20 +86,20 @@ namespace XMPP ~JT_Roster(); void get(); - void set(const Jid &, const QString &name, const QStringList &groups); + void set(const Jid &, const TQString &name, const TQStringList &groups); void remove(const Jid &); const Roster & roster() const; - QString toString() const; - bool fromString(const QString &); + TQString toString() const; + bool fromString(const TQString &); void onGo(); - bool take(const QDomElement &x); + bool take(const TQDomElement &x); private: int type; - QDomElement iq; + TQDomElement iq; Jid to; class Private; @@ -113,7 +113,7 @@ namespace XMPP JT_PushRoster(Task *parent); ~JT_PushRoster(); - bool take(const QDomElement &); + bool take(const TQDomElement &); signals: void roster(const Roster &); @@ -132,12 +132,12 @@ namespace XMPP void pres(const Status &); void pres(const Jid &, const Status &); - void sub(const Jid &, const QString &subType); + void sub(const Jid &, const TQString &subType); void onGo(); private: - QDomElement tag; + TQDomElement tag; int type; class Private; @@ -151,11 +151,11 @@ namespace XMPP JT_PushPresence(Task *parent); ~JT_PushPresence(); - bool take(const QDomElement &); + bool take(const TQDomElement &); signals: void presence(const Jid &, const Status &); - void subscription(const Jid &, const QString &); + void subscription(const Jid &, const TQString &); private: class Private; @@ -185,7 +185,7 @@ namespace XMPP JT_PushMessage(Task *parent); ~JT_PushMessage(); - bool take(const QDomElement &); + bool take(const TQDomElement &); signals: void message(const Message &); @@ -205,16 +205,16 @@ namespace XMPP void get(const Jid &); int seconds() const; - const QString &message() const; + const TQString &message() const; void onGo(); - bool take(const QDomElement &x); + bool take(const TQDomElement &x); private: class Private; Private *d; - QDomElement iq; + TQDomElement iq; Jid jid; }; @@ -229,13 +229,13 @@ namespace XMPP const AgentList & agents() const; void onGo(); - bool take(const QDomElement &x); + bool take(const TQDomElement &x); private: class Private; Private *d; - QDomElement iq; + TQDomElement iq; Jid jid; AgentList agentList; }; @@ -254,7 +254,7 @@ namespace XMPP const VCard & vcard() const; void onGo(); - bool take(const QDomElement &x); + bool take(const TQDomElement &x); private: int type; @@ -271,16 +271,16 @@ namespace XMPP ~JT_Search(); const Form & form() const; - const QValueList & results() const; + const TQValueList & results() const; void get(const Jid &); void set(const Form &); void onGo(); - bool take(const QDomElement &x); + bool take(const TQDomElement &x); private: - QDomElement iq; + TQDomElement iq; int type; class Private; @@ -295,18 +295,18 @@ namespace XMPP void get(const Jid &); void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); const Jid & jid() const; - const QString & name() const; - const QString & version() const; - const QString & os() const; + const TQString & name() const; + const TQString & version() const; + const TQString & os() const; private: - QDomElement iq; + TQDomElement iq; Jid j; - QString v_name, v_ver, v_os; + TQString v_name, v_ver, v_os; }; /* class JT_ClientTime : public Task @@ -316,14 +316,14 @@ namespace XMPP JT_ClientTime(Task *, const Jid &); void go(); - bool take(const QDomElement &); + bool take(const TQDomElement &); Jid j; - QDateTime utc; - QString timezone, display; + TQDateTime utc; + TQString timezone, display; private: - QDomElement iq; + TQDomElement iq; }; */ class JT_ServInfo : public Task @@ -333,7 +333,7 @@ namespace XMPP JT_ServInfo(Task *); ~JT_ServInfo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); }; class JT_Gateway : public Task @@ -343,20 +343,20 @@ namespace XMPP JT_Gateway(Task *); void get(const Jid &); - void set(const Jid &, const QString &prompt); + void set(const Jid &, const TQString &prompt); void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); Jid jid() const; - QString desc() const; - QString prompt() const; + TQString desc() const; + TQString prompt() const; private: - QDomElement iq; + TQDomElement iq; int type; Jid v_jid; - QString v_prompt, v_desc; + TQString v_prompt, v_desc; }; class JT_Browse : public Task @@ -372,13 +372,13 @@ namespace XMPP const AgentItem & root() const; void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: class Private; Private *d; - AgentItem browseHelper (const QDomElement &i); + AgentItem browseHelper (const TQDomElement &i); }; class JT_DiscoItems : public Task @@ -388,13 +388,13 @@ namespace XMPP JT_DiscoItems(Task *); ~JT_DiscoItems(); - void get(const Jid &, const QString &node = QString::null); + void get(const Jid &, const TQString &node = TQString::null); void get(const DiscoItem &); const DiscoList &items() const; void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: class Private; @@ -408,15 +408,15 @@ namespace XMPP JT_DiscoInfo(Task *); ~JT_DiscoInfo(); - void get(const Jid &, const QString &node = QString::null, const DiscoItem::Identity = DiscoItem::Identity()); + void get(const Jid &, const TQString &node = TQString::null, const DiscoItem::Identity = DiscoItem::Identity()); void get(const DiscoItem &); const DiscoItem &item() const; const Jid& jid() const; - const QString& node() const; + const TQString& node() const; void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: class Private; @@ -433,7 +433,7 @@ namespace XMPP void set(const Jid &, const DiscoList &); void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: class Private; @@ -448,12 +448,12 @@ namespace XMPP ~JT_MucPresence(); void pres(const Status &); - void pres(const Jid &, const Status &, const QString &password); + void pres(const Jid &, const Status &, const TQString &password); void onGo(); private: - QDomElement tag; + TQDomElement tag; int type; class Private; @@ -467,13 +467,13 @@ namespace XMPP JT_PrivateStorage(Task *parent); ~JT_PrivateStorage(); - void set(const QDomElement &); - void get(const QString &tag, const QString& xmlns); + void set(const TQDomElement &); + void get(const TQString &tag, const TQString& xmlns); - QDomElement element(); + TQDomElement element(); void onGo(); - bool take(const QDomElement &); + bool take(const TQDomElement &); private: class Private; diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.cpp index e79d9b9f..5f5214fd 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.cpp @@ -22,30 +22,30 @@ #include "base64.h" -#include -#include +#include +#include -#include // needed for image format recognition -#include +#include // needed for image format recognition +#include // Justin's XML helper functions -static QDomElement textTag(QDomDocument *doc, const QString &name, const QString &content) +static TQDomElement textTag(TQDomDocument *doc, const TQString &name, const TQString &content) { - QDomElement tag = doc->createElement(name); - QDomText text = doc->createTextNode(content); + TQDomElement tag = doc->createElement(name); + TQDomText text = doc->createTextNode(content); tag.appendChild(text); return tag; } -static QDomElement findSubTag(const QDomElement &e, const QString &name, bool *found) +static TQDomElement findSubTag(const TQDomElement &e, const TQString &name, bool *found) { if(found) *found = FALSE; - for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { - QDomElement i = n.toElement(); + for(TQDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling()) { + TQDomElement i = n.toElement(); if(i.isNull()) continue; if(i.tagName().upper() == name.upper()) { // mblsha: ignore case when searching @@ -55,33 +55,33 @@ static QDomElement findSubTag(const QDomElement &e, const QString &name, bool *f } } - QDomElement tmp; + TQDomElement tmp; return tmp; } // mblsha's own functions -static QDomElement emptyTag(QDomDocument *doc, const QString &name) +static TQDomElement emptyTag(TQDomDocument *doc, const TQString &name) { - QDomElement tag = doc->createElement(name); + TQDomElement tag = doc->createElement(name); return tag; } -static bool hasSubTag(const QDomElement &e, const QString &name) +static bool hasSubTag(const TQDomElement &e, const TQString &name) { bool found; findSubTag(e, name, &found); return found; } -static QString subTagText(const QDomElement &e, const QString &name) +static TQString subTagText(const TQDomElement &e, const TQString &name) { bool found; - QDomElement i = findSubTag(e, name, &found); + TQDomElement i = findSubTag(e, name, &found); if ( found ) return i.text().stripWhiteSpace(); - return QString::null; + return TQString::null; } using namespace XMPP; @@ -89,11 +89,11 @@ using namespace XMPP; //---------------------------------------------------------------------------- // VCard //---------------------------------------------------------------------------- -static QString image2type(const QByteArray &ba) +static TQString image2type(const TQByteArray &ba) { - QBuffer buf(ba); + TQBuffer buf(ba); buf.open(IO_ReadOnly); - QString format = QImageIO::imageFormat( &buf ); + TQString format = TQImageIO::imageFormat( &buf ); // TODO: add more formats if ( format == "PNG" || format == "PsiPNG" ) @@ -117,9 +117,9 @@ static QString image2type(const QByteArray &ba) } // Long lines of encoded binary data SHOULD BE folded to 75 characters using the folding method defined in [MIME-DIR]. -static QString foldString(const QString &s) +static TQString foldString(const TQString &s) { - QString ret; + TQString ret; for (int i = 0; i < (int)s.length(); i++) { if ( !(i % 75) ) @@ -136,47 +136,47 @@ public: Private(); ~Private(); - QString version; - QString fullName; - QString familyName, givenName, middleName, prefixName, suffixName; - QString nickName; + TQString version; + TQString fullName; + TQString familyName, givenName, middleName, prefixName, suffixName; + TQString nickName; - QByteArray photo; - QString photoURI; + TQByteArray photo; + TQString photoURI; - QString bday; + TQString bday; AddressList addressList; LabelList labelList; PhoneList phoneList; EmailList emailList; - QString jid; - QString mailer; - QString timezone; + TQString jid; + TQString mailer; + TQString timezone; Geo geo; - QString title; - QString role; + TQString title; + TQString role; - QByteArray logo; - QString logoURI; + TQByteArray logo; + TQString logoURI; VCard *agent; - QString agentURI; + TQString agentURI; Org org; - QStringList categories; - QString note; - QString prodId; - QString rev; - QString sortString; - - QByteArray sound; - QString soundURI, soundPhonetic; - - QString uid; - QString url; - QString desc; + TQStringList categories; + TQString note; + TQString prodId; + TQString rev; + TQString sortString; + + TQByteArray sound; + TQString soundURI, soundPhonetic; + + TQString uid; + TQString url; + TQString desc; PrivacyClass privacyClass; - QByteArray key; + TQByteArray key; bool isEmpty(); }; @@ -263,9 +263,9 @@ VCard::~VCard() delete d; } -QDomElement VCard::toXml(QDomDocument *doc) const +TQDomElement VCard::toXml(TQDomDocument *doc) const { - QDomElement v = doc->createElement("vCard"); + TQDomElement v = doc->createElement("vCard"); v.setAttribute("version", "2.0"); v.setAttribute("prodid", "-//HandGen//NONSGML vGen v1.0//EN"); v.setAttribute("xmlns", "vcard-temp"); @@ -277,7 +277,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const if ( !d->familyName.isEmpty() || !d->givenName.isEmpty() || !d->middleName.isEmpty() || !d->prefixName.isEmpty() || !d->suffixName.isEmpty() ) { - QDomElement w = doc->createElement("N"); + TQDomElement w = doc->createElement("N"); if ( !d->familyName.isEmpty() ) w.appendChild( textTag(doc, "FAMILY", d->familyName) ); @@ -297,7 +297,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const v.appendChild( textTag(doc, "NICKNAME", d->nickName) ); if ( !d->photo.isEmpty() || !d->photoURI.isEmpty() ) { - QDomElement w = doc->createElement("PHOTO"); + TQDomElement w = doc->createElement("PHOTO"); if ( !d->photo.isEmpty() ) { w.appendChild( textTag(doc, "TYPE", image2type(d->photo)) ); @@ -315,7 +315,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const if ( !d->addressList.isEmpty() ) { AddressList::Iterator it = d->addressList.begin(); for ( ; it != d->addressList.end(); ++it ) { - QDomElement w = doc->createElement("ADR"); + TQDomElement w = doc->createElement("ADR"); Address a = *it; if ( a.home ) @@ -355,7 +355,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const if ( !d->labelList.isEmpty() ) { LabelList::Iterator it = d->labelList.begin(); for ( ; it != d->labelList.end(); ++it ) { - QDomElement w = doc->createElement("LABEL"); + TQDomElement w = doc->createElement("LABEL"); Label l = *it; if ( l.home ) @@ -374,7 +374,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const w.appendChild( emptyTag(doc, "PREF") ); if ( !l.lines.isEmpty() ) { - QStringList::Iterator it = l.lines.begin(); + TQStringList::Iterator it = l.lines.begin(); for ( ; it != l.lines.end(); ++it ) w.appendChild( textTag(doc, "LINE", *it) ); } @@ -386,7 +386,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const if ( !d->phoneList.isEmpty() ) { PhoneList::Iterator it = d->phoneList.begin(); for ( ; it != d->phoneList.end(); ++it ) { - QDomElement w = doc->createElement("TEL"); + TQDomElement w = doc->createElement("TEL"); Phone p = *it; if ( p.home ) @@ -426,7 +426,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const if ( !d->emailList.isEmpty() ) { EmailList::Iterator it = d->emailList.begin(); for ( ; it != d->emailList.end(); ++it ) { - QDomElement w = doc->createElement("EMAIL"); + TQDomElement w = doc->createElement("EMAIL"); Email e = *it; if ( e.home ) @@ -453,7 +453,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const v.appendChild( textTag(doc, "TZ", d->timezone) ); if ( !d->geo.lat.isEmpty() || !d->geo.lon.isEmpty() ) { - QDomElement w = doc->createElement("GEO"); + TQDomElement w = doc->createElement("GEO"); if ( !d->geo.lat.isEmpty() ) w.appendChild( textTag(doc, "LAT", d->geo.lat) ); @@ -469,7 +469,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const v.appendChild( textTag(doc, "ROLE", d->role) ); if ( !d->logo.isEmpty() || !d->logoURI.isEmpty() ) { - QDomElement w = doc->createElement("LOGO"); + TQDomElement w = doc->createElement("LOGO"); if ( !d->logo.isEmpty() ) { w.appendChild( textTag(doc, "TYPE", image2type(d->logo)) ); @@ -482,7 +482,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const } if ( !d->agentURI.isEmpty() || (d->agent && d->agent->isEmpty()) ) { - QDomElement w = doc->createElement("AGENT"); + TQDomElement w = doc->createElement("AGENT"); if ( d->agent && !d->agent->isEmpty() ) w.appendChild( d->agent->toXml(doc) ); @@ -493,13 +493,13 @@ QDomElement VCard::toXml(QDomDocument *doc) const } if ( !d->org.name.isEmpty() || !d->org.unit.isEmpty() ) { - QDomElement w = doc->createElement("ORG"); + TQDomElement w = doc->createElement("ORG"); if ( !d->org.name.isEmpty() ) w.appendChild( textTag(doc, "ORGNAME", d->org.name) ); if ( !d->org.unit.isEmpty() ) { - QStringList::Iterator it = d->org.unit.begin(); + TQStringList::Iterator it = d->org.unit.begin(); for ( ; it != d->org.unit.end(); ++it ) w.appendChild( textTag(doc, "ORGUNIT", *it) ); } @@ -508,9 +508,9 @@ QDomElement VCard::toXml(QDomDocument *doc) const } if ( !d->categories.isEmpty() ) { - QDomElement w = doc->createElement("CATEGORIES"); + TQDomElement w = doc->createElement("CATEGORIES"); - QStringList::Iterator it = d->categories.begin(); + TQStringList::Iterator it = d->categories.begin(); for ( ; it != d->categories.end(); ++it ) w.appendChild( textTag(doc, "KEYWORD", *it) ); @@ -527,7 +527,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const v.appendChild( textTag(doc, "SORT-STRING", d->sortString) ); if ( !d->sound.isEmpty() || !d->soundURI.isEmpty() || !d->soundPhonetic.isEmpty() ) { - QDomElement w = doc->createElement("SOUND"); + TQDomElement w = doc->createElement("SOUND"); if ( !d->sound.isEmpty() ) w.appendChild( textTag(doc, "BINVAL", foldString( Base64::arrayToString(d->sound)) ) ); @@ -547,7 +547,7 @@ QDomElement VCard::toXml(QDomDocument *doc) const v.appendChild( textTag(doc, "DESC", d->desc) ); if ( d->privacyClass != pcNone ) { - QDomElement w = doc->createElement("CLASS"); + TQDomElement w = doc->createElement("CLASS"); if ( d->privacyClass == pcPublic ) w.appendChild( emptyTag(doc, "PUBLIC") ); @@ -560,11 +560,11 @@ QDomElement VCard::toXml(QDomDocument *doc) const } if ( !d->key.isEmpty() ) { - QDomElement w = doc->createElement("KEY"); + TQDomElement w = doc->createElement("KEY"); // TODO: Justin, please check out this code w.appendChild( textTag(doc, "TYPE", "text/plain")); // FIXME - w.appendChild( textTag(doc, "CRED", QString::fromUtf8(d->key)) ); // FIXME + w.appendChild( textTag(doc, "CRED", TQString::fromUtf8(d->key)) ); // FIXME v.appendChild(w); } @@ -572,21 +572,21 @@ QDomElement VCard::toXml(QDomDocument *doc) const return v; } -bool VCard::fromXml(const QDomElement &q) +bool VCard::fromXml(const TQDomElement &q) { if ( q.tagName().upper() != "VCARD" ) return false; - QDomNode n = q.firstChild(); + TQDomNode n = q.firstChild(); for ( ; !n.isNull(); n = n.nextSibling() ) { - QDomElement i = n.toElement(); + TQDomElement i = n.toElement(); if ( i.isNull() ) continue; - QString tag = i.tagName().upper(); + TQString tag = i.tagName().upper(); bool found; - QDomElement e; + TQDomElement e; if ( tag == "VERSION" ) d->version = i.text().stripWhiteSpace(); @@ -647,9 +647,9 @@ bool VCard::fromXml(const QDomElement &q) l.intl = hasSubTag(i, "INTL"); l.pref = hasSubTag(i, "PREF"); - QDomNode nn = i.firstChild(); + TQDomNode nn = i.firstChild(); for ( ; !nn.isNull(); nn = nn.nextSibling() ) { - QDomElement ii = nn.toElement(); + TQDomElement ii = nn.toElement(); if ( ii.isNull() ) continue; @@ -734,9 +734,9 @@ bool VCard::fromXml(const QDomElement &q) else if ( tag == "ORG" ) { d->org.name = subTagText(i, "ORGNAME"); - QDomNode nn = i.firstChild(); + TQDomNode nn = i.firstChild(); for ( ; !nn.isNull(); nn = nn.nextSibling() ) { - QDomElement ii = nn.toElement(); + TQDomElement ii = nn.toElement(); if ( ii.isNull() ) continue; @@ -745,9 +745,9 @@ bool VCard::fromXml(const QDomElement &q) } } else if ( tag == "CATEGORIES") { - QDomNode nn = i.firstChild(); + TQDomNode nn = i.firstChild(); for ( ; !nn.isNull(); nn = nn.nextSibling() ) { - QDomElement ee = nn.toElement(); + TQDomElement ee = nn.toElement(); if ( ee.isNull() ) continue; @@ -785,7 +785,7 @@ bool VCard::fromXml(const QDomElement &q) else if ( tag == "KEY" ) { // TODO: Justin, please check out this code e = findSubTag(i, "TYPE", &found); - QString type = "text/plain"; + TQString type = "text/plain"; if ( found ) type = e.text().stripWhiteSpace(); @@ -838,122 +838,122 @@ VCard::Org::Org() // vCard properties... -const QString &VCard::version() const +const TQString &VCard::version() const { return d->version; } -void VCard::setVersion(const QString &v) +void VCard::setVersion(const TQString &v) { d->version = v; } -const QString &VCard::fullName() const +const TQString &VCard::fullName() const { return d->fullName; } -void VCard::setFullName(const QString &n) +void VCard::setFullName(const TQString &n) { d->fullName = n; } -const QString &VCard::familyName() const +const TQString &VCard::familyName() const { return d->familyName; } -void VCard::setFamilyName(const QString &n) +void VCard::setFamilyName(const TQString &n) { d->familyName = n; } -const QString &VCard::givenName() const +const TQString &VCard::givenName() const { return d->givenName; } -void VCard::setGivenName(const QString &n) +void VCard::setGivenName(const TQString &n) { d->givenName = n; } -const QString &VCard::middleName() const +const TQString &VCard::middleName() const { return d->middleName; } -void VCard::setMiddleName(const QString &n) +void VCard::setMiddleName(const TQString &n) { d->middleName = n; } -const QString &VCard::prefixName() const +const TQString &VCard::prefixName() const { return d->prefixName; } -void VCard::setPrefixName(const QString &p) +void VCard::setPrefixName(const TQString &p) { d->prefixName = p; } -const QString &VCard::suffixName() const +const TQString &VCard::suffixName() const { return d->suffixName; } -void VCard::setSuffixName(const QString &s) +void VCard::setSuffixName(const TQString &s) { d->suffixName = s; } -const QString &VCard::nickName() const +const TQString &VCard::nickName() const { return d->nickName; } -void VCard::setNickName(const QString &n) +void VCard::setNickName(const TQString &n) { d->nickName = n; } -const QByteArray &VCard::photo() const +const TQByteArray &VCard::photo() const { return d->photo; } -void VCard::setPhoto(const QByteArray &i) +void VCard::setPhoto(const TQByteArray &i) { d->photo = i; } -const QString &VCard::photoURI() const +const TQString &VCard::photoURI() const { return d->photoURI; } -void VCard::setPhotoURI(const QString &p) +void VCard::setPhotoURI(const TQString &p) { d->photoURI = p; } -const QDate VCard::bday() const +const TQDate VCard::bday() const { - return QDate::fromString(d->bday); + return TQDate::fromString(d->bday); } -void VCard::setBday(const QDate &date) +void VCard::setBday(const TQDate &date) { d->bday = date.toString(); } -const QString &VCard::bdayStr() const +const TQString &VCard::bdayStr() const { return d->bday; } -void VCard::setBdayStr(const QString &date) +void VCard::setBdayStr(const TQString &date) { d->bday = date; } @@ -998,32 +998,32 @@ void VCard::setEmailList(const VCard::EmailList &e) d->emailList = e; } -const QString &VCard::jid() const +const TQString &VCard::jid() const { return d->jid; } -void VCard::setJid(const QString &j) +void VCard::setJid(const TQString &j) { d->jid = j; } -const QString &VCard::mailer() const +const TQString &VCard::mailer() const { return d->mailer; } -void VCard::setMailer(const QString &m) +void VCard::setMailer(const TQString &m) { d->mailer = m; } -const QString &VCard::timezone() const +const TQString &VCard::timezone() const { return d->timezone; } -void VCard::setTimezone(const QString &t) +void VCard::setTimezone(const TQString &t) { d->timezone = t; } @@ -1038,42 +1038,42 @@ void VCard::setGeo(const VCard::Geo &g) d->geo = g; } -const QString &VCard::title() const +const TQString &VCard::title() const { return d->title; } -void VCard::setTitle(const QString &t) +void VCard::setTitle(const TQString &t) { d->title = t; } -const QString &VCard::role() const +const TQString &VCard::role() const { return d->role; } -void VCard::setRole(const QString &r) +void VCard::setRole(const TQString &r) { d->role = r; } -const QByteArray &VCard::logo() const +const TQByteArray &VCard::logo() const { return d->logo; } -void VCard::setLogo(const QByteArray &i) +void VCard::setLogo(const TQByteArray &i) { d->logo = i; } -const QString &VCard::logoURI() const +const TQString &VCard::logoURI() const { return d->logoURI; } -void VCard::setLogoURI(const QString &l) +void VCard::setLogoURI(const TQString &l) { d->logoURI = l; } @@ -1090,12 +1090,12 @@ void VCard::setAgent(const VCard &v) *(d->agent) = v; } -const QString VCard::agentURI() const +const TQString VCard::agentURI() const { return d->agentURI; } -void VCard::setAgentURI(const QString &a) +void VCard::setAgentURI(const TQString &a) { d->agentURI = a; } @@ -1110,112 +1110,112 @@ void VCard::setOrg(const VCard::Org &o) d->org = o; } -const QStringList &VCard::categories() const +const TQStringList &VCard::categories() const { return d->categories; } -void VCard::setCategories(const QStringList &c) +void VCard::setCategories(const TQStringList &c) { d->categories = c; } -const QString &VCard::note() const +const TQString &VCard::note() const { return d->note; } -void VCard::setNote(const QString &n) +void VCard::setNote(const TQString &n) { d->note = n; } -const QString &VCard::prodId() const +const TQString &VCard::prodId() const { return d->prodId; } -void VCard::setProdId(const QString &p) +void VCard::setProdId(const TQString &p) { d->prodId = p; } -const QString &VCard::rev() const +const TQString &VCard::rev() const { return d->rev; } -void VCard::setRev(const QString &r) +void VCard::setRev(const TQString &r) { d->rev = r; } -const QString &VCard::sortString() const +const TQString &VCard::sortString() const { return d->sortString; } -void VCard::setSortString(const QString &s) +void VCard::setSortString(const TQString &s) { d->sortString = s; } -const QByteArray &VCard::sound() const +const TQByteArray &VCard::sound() const { return d->sound; } -void VCard::setSound(const QByteArray &s) +void VCard::setSound(const TQByteArray &s) { d->sound = s; } -const QString &VCard::soundURI() const +const TQString &VCard::soundURI() const { return d->soundURI; } -void VCard::setSoundURI(const QString &s) +void VCard::setSoundURI(const TQString &s) { d->soundURI = s; } -const QString &VCard::soundPhonetic() const +const TQString &VCard::soundPhonetic() const { return d->soundPhonetic; } -void VCard::setSoundPhonetic(const QString &s) +void VCard::setSoundPhonetic(const TQString &s) { d->soundPhonetic = s; } -const QString &VCard::uid() const +const TQString &VCard::uid() const { return d->uid; } -void VCard::setUid(const QString &u) +void VCard::setUid(const TQString &u) { d->uid = u; } -const QString &VCard::url() const +const TQString &VCard::url() const { return d->url; } -void VCard::setUrl(const QString &u) +void VCard::setUrl(const TQString &u) { d->url = u; } -const QString &VCard::desc() const +const TQString &VCard::desc() const { return d->desc; } -void VCard::setDesc(const QString &desc) +void VCard::setDesc(const TQString &desc) { d->desc = desc; } @@ -1230,12 +1230,12 @@ void VCard::setPrivacyClass(const VCard::PrivacyClass &c) d->privacyClass = c; } -const QByteArray &VCard::key() const +const TQByteArray &VCard::key() const { return d->key; } -void VCard::setKey(const QByteArray &k) +void VCard::setKey(const TQByteArray &k) { d->key = k; } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.h b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.h index 4a097251..885e08a9 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.h +++ b/kopete/protocols/jabber/libiris/iris/xmpp-im/xmpp_vcard.h @@ -21,12 +21,12 @@ #ifndef JABBER_VCARD_H #define JABBER_VCARD_H -#include -#include -#include +#include +#include +#include -#include -#include +#include +#include class QDate; @@ -40,49 +40,49 @@ namespace XMPP VCard & operator=(const VCard &); ~VCard(); - QDomElement toXml(QDomDocument *) const; - bool fromXml(const QDomElement &); + TQDomElement toXml(TQDomDocument *) const; + bool fromXml(const TQDomElement &); bool isEmpty() const; - const QString &version() const; - void setVersion(const QString &); + const TQString &version() const; + void setVersion(const TQString &); - const QString &fullName() const; - void setFullName(const QString &); + const TQString &fullName() const; + void setFullName(const TQString &); - const QString &familyName() const; - void setFamilyName(const QString &); + const TQString &familyName() const; + void setFamilyName(const TQString &); - const QString &givenName() const; - void setGivenName(const QString &); + const TQString &givenName() const; + void setGivenName(const TQString &); - const QString &middleName() const; - void setMiddleName(const QString &); + const TQString &middleName() const; + void setMiddleName(const TQString &); - const QString &prefixName() const; - void setPrefixName(const QString &); + const TQString &prefixName() const; + void setPrefixName(const TQString &); - const QString &suffixName() const; - void setSuffixName(const QString &); + const TQString &suffixName() const; + void setSuffixName(const TQString &); - const QString &nickName() const; - void setNickName(const QString &); + const TQString &nickName() const; + void setNickName(const TQString &); - const QByteArray &photo() const; - void setPhoto(const QByteArray &); + const TQByteArray &photo() const; + void setPhoto(const TQByteArray &); - const QString &photoURI() const; - void setPhotoURI(const QString &); + const TQString &photoURI() const; + void setPhotoURI(const TQString &); - const QDate bday() const; - void setBday(const QDate &); + const TQDate bday() const; + void setBday(const TQDate &); - const QString &bdayStr() const; - void setBdayStr(const QString &); + const TQString &bdayStr() const; + void setBdayStr(const TQString &); class Address { @@ -99,15 +99,15 @@ namespace XMPP bool pref; - QString pobox; - QString extaddr; - QString street; - QString locality; - QString region; - QString pcode; - QString country; + TQString pobox; + TQString extaddr; + TQString street; + TQString locality; + TQString region; + TQString pcode; + TQString country; }; - typedef QValueList
AddressList; + typedef TQValueList
AddressList; const AddressList &addressList() const; void setAddressList(const AddressList &); @@ -125,9 +125,9 @@ namespace XMPP bool pref; - QStringList lines; + TQStringList lines; }; - typedef QValueList