summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:48:06 +0000
commit47c8a359c5276062c4bc17f0e82410f29081b502 (patch)
tree2d54a5f60a5b74067632f9ef6df58c2bc38155e6 /kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp
parent6f82532777a35e0e60bbd2b290b2e93e646f349b (diff)
downloadtdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.tar.gz
tdenetwork-47c8a359c5276062c4bc17f0e82410f29081b502.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1157648 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp')
-rw-r--r--kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp b/kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp
index 1203315a..748db248 100644
--- a/kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp
+++ b/kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp
@@ -21,9 +21,9 @@
//! \class NDns ndns.h
//! \brief Simple DNS resolution using native system calls
//!
-//! This class is to be used when Qt's QDns is not good enough. Because QDns
+//! This class is to be used when Qt's TQDns is not good enough. Because QDns
//! does not use threads, it cannot make a system call asyncronously. Thus,
-//! QDns tries to imitate the behavior of each platform's native behavior, and
+//! TQDns tries to imitate the behavior of each platform's native behavior, and
//! generally falls short.
//!
//! NDns uses a thread to make the system call happen in the background. This
@@ -45,15 +45,15 @@
//!
//! // or if you want to get the IP address as a string:
//!
-//! QString ip_address = dns.resultString();
+//! TQString ip_address = dns.resultString();
//! \endcode
#include"ndns.h"
-#include<qapplication.h>
-#include<qsocketdevice.h>
-#include<qptrlist.h>
-#include<qeventloop.h>
+#include<tqapplication.h>
+#include<tqsocketdevice.h>
+#include<tqptrlist.h>
+#include<tqeventloop.h>
#ifdef Q_OS_UNIX
#include<netdb.h>
@@ -72,7 +72,7 @@
class NDnsWorkerEvent : public QCustomEvent
{
public:
- enum Type { WorkerEvent = QEvent::User + 100 };
+ enum Type { WorkerEvent = TQEvent::User + 100 };
NDnsWorkerEvent(NDnsWorker *);
NDnsWorker *worker;
@@ -81,18 +81,18 @@ public:
class NDnsWorker : public QThread
{
public:
- NDnsWorker(QObject *, const QCString &);
+ NDnsWorker(TQObject *, const TQCString &);
bool success;
bool cancelled;
- QHostAddress addr;
+ TQHostAddress addr;
protected:
void run();
private:
- QCString host;
- QObject *par;
+ TQCString host;
+ TQObject *par;
};
//! \endif
@@ -100,8 +100,8 @@ private:
// NDnsManager
//----------------------------------------------------------------------------
#ifndef HAVE_GETHOSTBYNAME_R
-static QMutex *workerMutex = 0;
-static QMutex *workerCancelled = 0;
+static TQMutex *workerMutex = 0;
+static TQMutex *workerCancelled = 0;
#endif
static NDnsManager *man = 0;
bool winsock_init = false;
@@ -118,7 +118,7 @@ class NDnsManager::Private
public:
Item *find(const NDns *n)
{
- QPtrListIterator<Item> it(list);
+ TQPtrListIterator<Item> it(list);
for(Item *i; (i = it.current()); ++it) {
if(i->ndns == n)
return i;
@@ -128,7 +128,7 @@ public:
Item *find(const NDnsWorker *w)
{
- QPtrListIterator<Item> it(list);
+ TQPtrListIterator<Item> it(list);
for(Item *i; (i = it.current()); ++it) {
if(i->worker == w)
return i;
@@ -136,7 +136,7 @@ public:
return 0;
}
- QPtrList<Item> list;
+ TQPtrList<Item> list;
};
NDnsManager::NDnsManager()
@@ -149,7 +149,7 @@ NDnsManager::NDnsManager()
#ifdef Q_OS_WIN32
if(!winsock_init) {
winsock_init = true;
- QSocketDevice *sd = new QSocketDevice;
+ TQSocketDevice *sd = new QSocketDevice;
delete sd;
}
#endif
@@ -157,7 +157,7 @@ NDnsManager::NDnsManager()
d = new Private;
d->list.setAutoDelete(true);
- connect(qApp, SIGNAL(aboutToQuit()), SLOT(app_aboutToQuit()));
+ connect(qApp, TQT_SIGNAL(aboutToQuit()), TQT_SLOT(app_aboutToQuit()));
}
NDnsManager::~NDnsManager()
@@ -172,7 +172,7 @@ NDnsManager::~NDnsManager()
#endif
}
-void NDnsManager::resolve(NDns *self, const QString &name)
+void NDnsManager::resolve(NDns *self, const TQString &name)
{
Item *i = new Item;
i->ndns = self;
@@ -204,7 +204,7 @@ bool NDnsManager::isBusy(const NDns *self) const
return (i ? true: false);
}
-bool NDnsManager::event(QEvent *e)
+bool NDnsManager::event(TQEvent *e)
{
if((int)e->type() == (int)NDnsWorkerEvent::WorkerEvent) {
NDnsWorkerEvent *we = static_cast<NDnsWorkerEvent*>(e);
@@ -215,7 +215,7 @@ bool NDnsManager::event(QEvent *e)
// should NOT happen
return true;
}
- QHostAddress addr = i->worker->addr;
+ TQHostAddress addr = i->worker->addr;
NDns *ndns = i->ndns;
delete i->worker;
d->list.removeRef(i);
@@ -242,8 +242,8 @@ void NDnsManager::tryDestroy()
void NDnsManager::app_aboutToQuit()
{
while(man) {
- QEventLoop *e = qApp->eventLoop();
- e->processEvents(QEventLoop::WaitForMore);
+ TQEventLoop *e = qApp->eventLoop();
+ e->processEvents(TQEventLoop::WaitForMore);
}
}
@@ -257,8 +257,8 @@ void NDnsManager::app_aboutToQuit()
//!
//! Constructs an NDns object with parent \a parent.
-NDns::NDns(QObject *parent)
-:QObject(parent)
+NDns::NDns(TQObject *parent)
+:TQObject(parent)
{
}
@@ -271,7 +271,7 @@ NDns::~NDns()
//!
//! Resolves hostname \a host (eg. psi.affinix.com)
-void NDns::resolve(const QString &host)
+void NDns::resolve(const TQString &host)
{
stop();
if(!man)
@@ -299,7 +299,7 @@ uint NDns::result() const
//!
//! Returns the IP address as a string. This will be an empty string if the lookup failed.
//! \sa resultsReady()
-QString NDns::resultString() const
+TQString NDns::resultString() const
{
return addr.toString();
}
@@ -313,7 +313,7 @@ bool NDns::isBusy() const
return man->isBusy(this);
}
-void NDns::finished(const QHostAddress &a)
+void NDns::finished(const TQHostAddress &a)
{
addr = a;
resultsReady();
@@ -323,7 +323,7 @@ void NDns::finished(const QHostAddress &a)
// NDnsWorkerEvent
//----------------------------------------------------------------------------
NDnsWorkerEvent::NDnsWorkerEvent(NDnsWorker *p)
-:QCustomEvent(WorkerEvent)
+:TQCustomEvent(WorkerEvent)
{
worker = p;
}
@@ -331,7 +331,7 @@ NDnsWorkerEvent::NDnsWorkerEvent(NDnsWorker *p)
//----------------------------------------------------------------------------
// NDnsWorker
//----------------------------------------------------------------------------
-NDnsWorker::NDnsWorker(QObject *_par, const QCString &_host)
+NDnsWorker::NDnsWorker(TQObject *_par, const TQCString &_host)
{
success = cancelled = false;
par = _par;
@@ -349,7 +349,7 @@ void NDnsWorker::run()
gethostbyname_r(host.data(), &buf, char_buf, sizeof(char_buf), &h, &err);
#else
// lock for gethostbyname
- QMutexLocker locker(workerMutex);
+ TQMutexLocker locker(workerMutex);
// check for cancel
workerCancelled->lock();
@@ -362,7 +362,7 @@ void NDnsWorker::run()
if(!h) {
success = false;
- QApplication::postEvent(par, new NDnsWorkerEvent(this));
+ TQApplication::postEvent(par, new NDnsWorkerEvent(this));
return;
}
@@ -370,7 +370,7 @@ void NDnsWorker::run()
addr.setAddress(ntohl(a.s_addr));
success = true;
- QApplication::postEvent(par, new NDnsWorkerEvent(this));
+ TQApplication::postEvent(par, new NDnsWorkerEvent(this));
}
// CS_NAMESPACE_END