diff options
Diffstat (limited to 'kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp')
-rw-r--r-- | kopete/protocols/jabber/libiris/cutestuff/network/ndns.cpp | 68 |
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 |