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-core/jid.cpp | 102 ++++++++++----------- 1 file changed, 51 insertions(+), 51 deletions(-) (limited to 'kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp') diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp index 2a40f050..090cc9df 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/jid.cpp @@ -20,7 +20,7 @@ #include"xmpp.h" -#include +#include #include using namespace XMPP; @@ -31,12 +31,12 @@ using namespace XMPP; class StringPrepCache { public: - static bool nameprep(const QString &in, int maxbytes, QString *out) + static bool nameprep(const TQString &in, int maxbytes, TQString *out) { if(in.isEmpty()) { if(out) - *out = QString(); + *out = TQString(); return true; } @@ -52,7 +52,7 @@ public: return true; } - QCString cs = in.utf8(); + TQCString cs = in.utf8(); cs.resize(maxbytes); if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_nameprep) != 0) { @@ -60,19 +60,19 @@ public: return false; } - QString norm = QString::fromUtf8(cs); + TQString norm = TQString::fromUtf8(cs); that->nameprep_table.insert(in, new Result(norm)); if(out) *out = norm; return true; } - static bool nodeprep(const QString &in, int maxbytes, QString *out) + static bool nodeprep(const TQString &in, int maxbytes, TQString *out) { if(in.isEmpty()) { if(out) - *out = QString(); + *out = TQString(); return true; } @@ -88,7 +88,7 @@ public: return true; } - QCString cs = in.utf8(); + TQCString cs = in.utf8(); cs.resize(maxbytes); if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_xmpp_nodeprep) != 0) { @@ -96,19 +96,19 @@ public: return false; } - QString norm = QString::fromUtf8(cs); + TQString norm = TQString::fromUtf8(cs); that->nodeprep_table.insert(in, new Result(norm)); if(out) *out = norm; return true; } - static bool resourceprep(const QString &in, int maxbytes, QString *out) + static bool resourceprep(const TQString &in, int maxbytes, TQString *out) { if(in.isEmpty()) { if(out) - *out = QString(); + *out = TQString(); return true; } @@ -124,7 +124,7 @@ public: return true; } - QCString cs = in.utf8(); + TQCString cs = in.utf8(); cs.resize(maxbytes); if(stringprep(cs.data(), maxbytes, (Stringprep_profile_flags)0, stringprep_xmpp_resourceprep) != 0) { @@ -132,7 +132,7 @@ public: return false; } - QString norm = QString::fromUtf8(cs); + TQString norm = TQString::fromUtf8(cs); that->resourceprep_table.insert(in, new Result(norm)); if(out) *out = norm; @@ -143,13 +143,13 @@ private: class Result { public: - QString *norm; + TQString *norm; Result() : norm(0) { } - Result(const QString &s) : norm(new QString(s)) + Result(const TQString &s) : norm(new TQString(s)) { } @@ -159,9 +159,9 @@ private: } }; - QDict nameprep_table; - QDict nodeprep_table; - QDict resourceprep_table; + TQDict nameprep_table; + TQDict nodeprep_table; + TQDict resourceprep_table; static StringPrepCache *instance; @@ -194,17 +194,17 @@ Jid::~Jid() { } -Jid::Jid(const QString &s) +Jid::Jid(const TQString &s) { set(s); } Jid::Jid(const char *s) { - set(QString(s)); + set(TQString(s)); } -Jid & Jid::operator=(const QString &s) +Jid & Jid::operator=(const TQString &s) { set(s); return *this; @@ -212,17 +212,17 @@ Jid & Jid::operator=(const QString &s) Jid & Jid::operator=(const char *s) { - set(QString(s)); + set(TQString(s)); return *this; } void Jid::reset() { - f = QString(); - b = QString(); - d = QString(); - n = QString(); - r = QString(); + f = TQString(); + b = TQString(); + d = TQString(); + n = TQString(); + r = TQString(); valid = false; } @@ -244,10 +244,10 @@ void Jid::update() valid = false; } -void Jid::set(const QString &s) +void Jid::set(const TQString &s) { - QString rest, domain, node, resource; - QString norm_domain, norm_node, norm_resource; + TQString rest, domain, node, resource; + TQString norm_domain, norm_node, norm_resource; int x = s.find('/'); if(x != -1) { rest = s.mid(0, x); @@ -255,7 +255,7 @@ void Jid::set(const QString &s) } else { rest = s; - resource = QString(); + resource = TQString(); } if(!validResource(resource, &norm_resource)) { reset(); @@ -268,7 +268,7 @@ void Jid::set(const QString &s) domain = rest.mid(x+1); } else { - node = QString(); + node = TQString(); domain = rest; } if(!validDomain(domain, &norm_domain) || !validNode(node, &norm_node)) { @@ -283,9 +283,9 @@ void Jid::set(const QString &s) update(); } -void Jid::set(const QString &domain, const QString &node, const QString &resource) +void Jid::set(const TQString &domain, const TQString &node, const TQString &resource) { - QString norm_domain, norm_node, norm_resource; + TQString norm_domain, norm_node, norm_resource; if(!validDomain(domain, &norm_domain) || !validNode(node, &norm_node) || !validResource(resource, &norm_resource)) { reset(); return; @@ -297,11 +297,11 @@ void Jid::set(const QString &domain, const QString &node, const QString &resourc update(); } -void Jid::setDomain(const QString &s) +void Jid::setDomain(const TQString &s) { if(!valid) return; - QString norm; + TQString norm; if(!validDomain(s, &norm)) { reset(); return; @@ -310,11 +310,11 @@ void Jid::setDomain(const QString &s) update(); } -void Jid::setNode(const QString &s) +void Jid::setNode(const TQString &s) { if(!valid) return; - QString norm; + TQString norm; if(!validNode(s, &norm)) { reset(); return; @@ -323,11 +323,11 @@ void Jid::setNode(const QString &s) update(); } -void Jid::setResource(const QString &s) +void Jid::setResource(const TQString &s) { if(!valid) return; - QString norm; + TQString norm; if(!validResource(s, &norm)) { reset(); return; @@ -336,14 +336,14 @@ void Jid::setResource(const QString &s) update(); } -Jid Jid::withNode(const QString &s) const +Jid Jid::withNode(const TQString &s) const { Jid j = *this; j.setNode(s); return j; } -Jid Jid::withResource(const QString &s) const +Jid Jid::withResource(const TQString &s) const { Jid j = *this; j.setResource(s); @@ -372,38 +372,38 @@ bool Jid::compare(const Jid &a, bool compareRes) const return true; } -bool Jid::validDomain(const QString &s, QString *norm) +bool Jid::validDomain(const TQString &s, TQString *norm) { - /*QCString cs = s.utf8(); + /*TQCString cs = s.utf8(); cs.resize(1024); if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_nameprep) != 0) return false; if(norm) - *norm = QString::fromUtf8(cs); + *norm = TQString::fromUtf8(cs); return true;*/ return StringPrepCache::nameprep(s, 1024, norm); } -bool Jid::validNode(const QString &s, QString *norm) +bool Jid::validNode(const TQString &s, TQString *norm) { - /*QCString cs = s.utf8(); + /*TQCString cs = s.utf8(); cs.resize(1024); if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_xmpp_nodeprep) != 0) return false; if(norm) - *norm = QString::fromUtf8(cs); + *norm = TQString::fromUtf8(cs); return true;*/ return StringPrepCache::nodeprep(s, 1024, norm); } -bool Jid::validResource(const QString &s, QString *norm) +bool Jid::validResource(const TQString &s, TQString *norm) { - /*QCString cs = s.utf8(); + /*TQCString cs = s.utf8(); cs.resize(1024); if(stringprep(cs.data(), 1024, (Stringprep_profile_flags)0, stringprep_xmpp_resourceprep) != 0) return false; if(norm) - *norm = QString::fromUtf8(cs); + *norm = TQString::fromUtf8(cs); return true;*/ return StringPrepCache::resourceprep(s, 1024, norm); } -- cgit v1.2.1