diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:46:43 +0000 |
commit | ffe8a83e053396df448e9413828527613ca3bd46 (patch) | |
tree | a73d4169e02df4a50f9a12cb165fcd0ab5bac7c6 /kdecore/network | |
parent | 682bf3bfdcbcbb1fca85e8a36ed03e062e0555d5 (diff) | |
download | tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.tar.gz tdelibs-ffe8a83e053396df448e9413828527613ca3bd46.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1157647 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/network')
34 files changed, 635 insertions, 635 deletions
diff --git a/kdecore/network/kbufferedsocket.cpp b/kdecore/network/kbufferedsocket.cpp index 7207a9c4f..52d826c88 100644 --- a/kdecore/network/kbufferedsocket.cpp +++ b/kdecore/network/kbufferedsocket.cpp @@ -24,8 +24,8 @@ #include <config.h> -#include <qmutex.h> -#include <qtimer.h> +#include <tqmutex.h> +#include <tqtimer.h> #include "ksocketdevice.h" #include "ksocketaddress.h" @@ -47,8 +47,8 @@ public: } }; -KBufferedSocket::KBufferedSocket(const QString& host, const QString& service, - QObject *parent, const char *name) +KBufferedSocket::KBufferedSocket(const TQString& host, const TQString& service, + TQObject *parent, const char *name) : KStreamSocket(host, service, parent, name), d(new KBufferedSocketPrivate) { @@ -86,7 +86,7 @@ void KBufferedSocket::close() else { setState(Closing); - QSocketNotifier *n = socketDevice()->readNotifier(); + TQSocketNotifier *n = socketDevice()->readNotifier(); if (n) n->setEnabled(false); emit stateChanged(Closing); @@ -177,7 +177,7 @@ Q_LONG KBufferedSocket::writeBlock(const char *data, Q_ULONG len) resetError(); // enable notifier to send data - QSocketNotifier *n = socketDevice()->writeNotifier(); + TQSocketNotifier *n = socketDevice()->writeNotifier(); if (n) n->setEnabled(true); @@ -200,7 +200,7 @@ void KBufferedSocket::enableRead(bool enable) if (!enable && d->input) { // reenable it - QSocketNotifier *n = socketDevice()->readNotifier(); + TQSocketNotifier *n = socketDevice()->readNotifier(); if (n) n->setEnabled(true); } @@ -208,7 +208,7 @@ void KBufferedSocket::enableRead(bool enable) if (enable && state() != Connected && d->input && !d->input->isEmpty()) // this means the buffer is still dirty // allow the signal to be emitted - QTimer::singleShot(0, this, SLOT(slotReadActivity())); + TQTimer::singleShot(0, this, TQT_SLOT(slotReadActivity())); } void KBufferedSocket::enableWrite(bool enable) @@ -217,7 +217,7 @@ void KBufferedSocket::enableWrite(bool enable) if (!enable && d->output && !d->output->isEmpty()) { // reenable it - QSocketNotifier *n = socketDevice()->writeNotifier(); + TQSocketNotifier *n = socketDevice()->writeNotifier(); if (n) n->setEnabled(true); } @@ -243,7 +243,7 @@ void KBufferedSocket::stateChanging(SocketState newState) void KBufferedSocket::setInputBuffering(bool enable) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (!enable) { delete d->input; @@ -262,7 +262,7 @@ KIOBufferBase* KBufferedSocket::inputBuffer() void KBufferedSocket::setOutputBuffering(bool enable) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (!enable) { delete d->output; @@ -302,7 +302,7 @@ bool KBufferedSocket::canReadLine() const return d->input->canReadLine(); } -QCString KBufferedSocket::readLine() +TQCString KBufferedSocket::readLine() { return d->input->readLine(); } @@ -358,7 +358,7 @@ void KBufferedSocket::slotReadActivity() { // buffer isn't empty // keep emitting signals till it is - QTimer::singleShot(0, this, SLOT(slotReadActivity())); + TQTimer::singleShot(0, this, TQT_SLOT(slotReadActivity())); emit readyRead(); } } diff --git a/kdecore/network/kbufferedsocket.h b/kdecore/network/kbufferedsocket.h index b0b99f8d1..d99862781 100644 --- a/kdecore/network/kbufferedsocket.h +++ b/kdecore/network/kbufferedsocket.h @@ -25,9 +25,9 @@ #ifndef KBUFFEREDSOCKET_H #define KBUFFEREDSOCKET_H -#include <qobject.h> -#include <qcstring.h> -#include <qvaluelist.h> +#include <tqobject.h> +#include <tqcstring.h> +#include <tqvaluelist.h> #include "kstreamsocket.h" #include <kdelibs_export.h> @@ -49,7 +49,7 @@ class KBufferedSocketPrivate; * * @note Buffered sockets only make sense if you're using them from * the main (event-loop) thread. This is actually a restriction - * imposed by Qt's QSocketNotifier. If you want to use a socket + * imposed by Qt's TQSocketNotifier. If you want to use a socket * in an auxiliary thread, please use KStreamSocket. * * @see KNetwork::KStreamSocket, KNetwork::KServerSocket @@ -67,8 +67,8 @@ public: * @param parent the parent object for this object * @param name the internal name for this object */ - KBufferedSocket(const QString& node = QString::null, const QString& service = QString::null, - QObject* parent = 0L, const char *name = 0L); + KBufferedSocket(const TQString& node = TQString::null, const TQString& service = TQString::null, + TQObject* parent = 0L, const char *name = 0L); /** * Destructor. @@ -195,7 +195,7 @@ public: /** * Reads a line of data from the socket buffers. */ - QCString readLine(); + TQCString readLine(); // KDE4: make virtual, add timeout to match the Qt4 signature // and move to another class up the hierarchy diff --git a/kdecore/network/kclientsocketbase.cpp b/kdecore/network/kclientsocketbase.cpp index b777dc8de..2da802d56 100644 --- a/kdecore/network/kclientsocketbase.cpp +++ b/kdecore/network/kclientsocketbase.cpp @@ -24,9 +24,9 @@ #include <config.h> -#include <qsocketnotifier.h> -#include <qtimer.h> -#include <qmutex.h> +#include <tqsocketnotifier.h> +#include <tqtimer.h> +#include <tqmutex.h> #include "ksocketaddress.h" #include "kresolver.h" @@ -47,8 +47,8 @@ public: bool enableRead : 1, enableWrite : 1; }; -KClientSocketBase::KClientSocketBase(QObject *parent, const char *name) - : QObject(parent, name), d(new KClientSocketBasePrivate) +KClientSocketBase::KClientSocketBase(TQObject *parent, const char *name) + : TQObject(parent, name), d(new KClientSocketBasePrivate) { d->state = Idle; d->enableRead = true; @@ -74,7 +74,7 @@ void KClientSocketBase::setState(SocketState state) bool KClientSocketBase::setSocketOptions(int opts) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); KSocketBase::setSocketOptions(opts); // call parent // don't create the device unnecessarily @@ -140,14 +140,14 @@ bool KClientSocketBase::lookup() { if (d->localResolver.serviceName().isNull() && !d->localResolver.nodeName().isNull()) - d->localResolver.setServiceName(QString::fromLatin1("")); + d->localResolver.setServiceName(TQString::fromLatin1("")); // don't restart the lookups if they had succeeded and // the input values weren't changed - QObject::connect(&d->peerResolver, SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedSlot())); - QObject::connect(&d->localResolver, SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedSlot())); + TQObject::connect(&d->peerResolver, TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedSlot())); + TQObject::connect(&d->localResolver, TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedSlot())); if (d->localResolver.status() <= 0) d->localResolver.start(); @@ -164,7 +164,7 @@ bool KClientSocketBase::lookup() if (blocking()) lookupFinishedSlot(); else - QTimer::singleShot(0, this, SLOT(lookupFinishedSlot())); + TQTimer::singleShot(0, this, TQT_SLOT(lookupFinishedSlot())); } else { @@ -387,10 +387,10 @@ bool KClientSocketBase::emitsReadyRead() const void KClientSocketBase::enableRead(bool enable) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); d->enableRead = enable; - QSocketNotifier *n = socketDevice()->readNotifier(); + TQSocketNotifier *n = socketDevice()->readNotifier(); if (n) n->setEnabled(enable); } @@ -402,10 +402,10 @@ bool KClientSocketBase::emitsReadyWrite() const void KClientSocketBase::enableWrite(bool enable) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); d->enableWrite = enable; - QSocketNotifier *n = socketDevice()->writeNotifier(); + TQSocketNotifier *n = socketDevice()->writeNotifier(); if (n) n->setEnabled(enable); } @@ -427,8 +427,8 @@ void KClientSocketBase::lookupFinishedSlot() if (d->peerResolver.isRunning() || d->localResolver.isRunning() || state() != HostLookup) return; - QObject::disconnect(&d->peerResolver, 0L, this, SLOT(lookupFinishedSlot())); - QObject::disconnect(&d->localResolver, 0L, this, SLOT(lookupFinishedSlot())); + TQObject::disconnect(&d->peerResolver, 0L, this, TQT_SLOT(lookupFinishedSlot())); + TQObject::disconnect(&d->localResolver, 0L, this, TQT_SLOT(lookupFinishedSlot())); if (d->peerResolver.status() < 0 || d->localResolver.status() < 0) { setState(Idle); // backtrack @@ -449,11 +449,11 @@ void KClientSocketBase::stateChanging(SocketState newState) { if (newState == Connected && socketDevice()) { - QSocketNotifier *n = socketDevice()->readNotifier(); + TQSocketNotifier *n = socketDevice()->readNotifier(); if (n) { n->setEnabled(d->enableRead); - QObject::connect(n, SIGNAL(activated(int)), this, SLOT(slotReadActivity())); + TQObject::connect(n, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadActivity())); } else return; @@ -462,7 +462,7 @@ void KClientSocketBase::stateChanging(SocketState newState) if (n) { n->setEnabled(d->enableWrite); - QObject::connect(n, SIGNAL(activated(int)), this, SLOT(slotWriteActivity())); + TQObject::connect(n, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotWriteActivity())); } else return; diff --git a/kdecore/network/kclientsocketbase.h b/kdecore/network/kclientsocketbase.h index ccd94994a..1a6d3b8b1 100644 --- a/kdecore/network/kclientsocketbase.h +++ b/kdecore/network/kclientsocketbase.h @@ -25,8 +25,8 @@ #ifndef KCLIENTSOCKETBASE_H #define KCLIENTSOCKETBASE_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include "ksocketbase.h" #include "kresolver.h" @@ -46,7 +46,7 @@ class KClientSocketBasePrivate; * * @author Thiago Macieira <thiago.macieira@kdemail.net> */ -class KDECORE_EXPORT KClientSocketBase : public QObject, public KActiveSocketBase +class KDECORE_EXPORT KClientSocketBase : public TQObject, public KActiveSocketBase { Q_OBJECT @@ -87,10 +87,10 @@ public: /** * Default constructor. * - * @param parent the parent QObject object + * @param parent the parent TQObject object * @param name the name of this object */ - KClientSocketBase(QObject* parent, const char *name); + KClientSocketBase(TQObject* parent, const char *name); /** * Destructor. @@ -202,14 +202,14 @@ public: * @param node the nodename * @param service the service */ - virtual bool bind(const QString& node = QString::null, - const QString& service = QString::null) = 0; + virtual bool bind(const TQString& node = TQString::null, + const TQString& service = TQString::null) = 0; /** * Reimplemented from KSocketBase. Connect this socket to this * specific address. * - * Unlike @ref bind(const QString&, const QString&) above, this function + * Unlike @ref bind(const TQString&, const TQString&) above, this function * really does bind the socket. No lookup is performed. The @ref bound * signal will be emitted. */ @@ -243,8 +243,8 @@ public: * @param node the nodename * @param service the service */ - virtual bool connect(const QString& node = QString::null, - const QString& service = QString::null) = 0; + virtual bool connect(const TQString& node = TQString::null, + const TQString& service = TQString::null) = 0; /** * @overload @@ -255,10 +255,10 @@ public: /** * @deprecated * This is a convenience function provided to ease migrating from - * Qt 3.x's QSocket class. + * Qt 3.x's TQSocket class. */ - inline void connectToHost(const QString& host, Q_UINT16 port) - { connect(host, QString::number(port)); } + inline void connectToHost(const TQString& host, Q_UINT16 port) + { connect(host, TQString::number(port)); } /** * Disconnects the socket. @@ -267,7 +267,7 @@ public: virtual bool disconnect(); /** - * Opens the socket. Reimplemented from QIODevice. + * Opens the socket. Reimplemented from TQIODevice. * * You should not call this function; instead, use @ref connect */ @@ -275,7 +275,7 @@ public: { return connect(); } /** - * Closes the socket. Reimplemented from QIODevice. + * Closes the socket. Reimplemented from TQIODevice. * * The closing of the socket causes the emission of the * signal @ref closed. @@ -283,7 +283,7 @@ public: virtual void close(); /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. */ virtual void flush() { } diff --git a/kdecore/network/kdatagramsocket.cpp b/kdecore/network/kdatagramsocket.cpp index a0d3bc05d..d598d2d14 100644 --- a/kdecore/network/kdatagramsocket.cpp +++ b/kdecore/network/kdatagramsocket.cpp @@ -41,7 +41,7 @@ using namespace KNetwork; * */ -KDatagramSocket::KDatagramSocket(QObject* parent, const char *name) +KDatagramSocket::KDatagramSocket(TQObject* parent, const char *name) : KClientSocketBase(parent, name), d(0L) { peerResolver().setFamily(KResolver::KnownFamily); @@ -52,11 +52,11 @@ KDatagramSocket::KDatagramSocket(QObject* parent, const char *name) localResolver().setFlags(KResolver::Passive); - // QObject::connect(localResolver(), SIGNAL(finished(KResolverResults)), - // this, SLOT(lookupFinishedLocal())); - QObject::connect(&peerResolver(), SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedPeer())); - QObject::connect(this, SIGNAL(hostFound()), this, SLOT(lookupFinishedLocal())); + // TQObject::connect(localResolver(), TQT_SIGNAL(finished(KResolverResults)), + // this, TQT_SLOT(lookupFinishedLocal())); + TQObject::connect(&peerResolver(), TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedPeer())); + TQObject::connect(this, TQT_SIGNAL(hostFound()), this, TQT_SLOT(lookupFinishedLocal())); } KDatagramSocket::~KDatagramSocket() @@ -66,7 +66,7 @@ KDatagramSocket::~KDatagramSocket() //delete d; } -bool KDatagramSocket::bind(const QString& node, const QString& service) +bool KDatagramSocket::bind(const TQString& node, const TQString& service) { if (state() >= Bound) return false; @@ -89,7 +89,7 @@ bool KDatagramSocket::bind(const QString& node, const QString& service) return true; } -bool KDatagramSocket::connect(const QString& node, const QString& service) +bool KDatagramSocket::connect(const TQString& node, const TQString& service) { if (state() >= Connected) return true; // already connected @@ -152,7 +152,7 @@ KDatagramPacket KDatagramSocket::receive() size = bytesAvailable(); } - QByteArray data(size); + TQByteArray data(size); KSocketAddress address; // now do the reading @@ -261,11 +261,11 @@ bool KDatagramSocket::doBind() void KDatagramSocket::setupSignals() { - QSocketNotifier *n = socketDevice()->readNotifier(); + TQSocketNotifier *n = socketDevice()->readNotifier(); if (n) { n->setEnabled(emitsReadyRead()); - QObject::connect(n, SIGNAL(activated(int)), this, SLOT(slotReadActivity())); + TQObject::connect(n, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotReadActivity())); } else return; @@ -274,7 +274,7 @@ void KDatagramSocket::setupSignals() if (n) { n->setEnabled(emitsReadyWrite()); - QObject::connect(n, SIGNAL(activated(int)), this, SLOT(slotWriteActivity())); + TQObject::connect(n, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotWriteActivity())); } else return; diff --git a/kdecore/network/kdatagramsocket.h b/kdecore/network/kdatagramsocket.h index 31ccf9af7..6b94c1d42 100644 --- a/kdecore/network/kdatagramsocket.h +++ b/kdecore/network/kdatagramsocket.h @@ -25,7 +25,7 @@ #ifndef KDATAGRAMSOCKET_H #define KDATAGRAMSOCKET_H -#include <qcstring.h> +#include <tqcstring.h> #include "ksocketaddress.h" #include "kclientsocketbase.h" @@ -43,14 +43,14 @@ class KResolverEntry; * consists of data as well as a network address associated (whither to send * the data or whence it came). * - * This is a lightweight class. Data is stored in a @ref QByteArray, which means + * This is a lightweight class. Data is stored in a @ref TQByteArray, which means * that it is explicitly shared. * * @author Thiago Macieira <thiago.macieira@kdemail.net> */ class KDECORE_EXPORT KDatagramPacket { - QByteArray m_data; + TQByteArray m_data; KSocketAddress m_address; public: @@ -63,7 +63,7 @@ public: /** * Constructs the datagram with the specified content. */ - KDatagramPacket(const QByteArray& content) + KDatagramPacket(const TQByteArray& content) : m_data(content) { } @@ -78,7 +78,7 @@ public: /** * Constructs the datagram with the specified content and address. */ - KDatagramPacket(const QByteArray& content, const KSocketAddress& addr) + KDatagramPacket(const TQByteArray& content, const KSocketAddress& addr) : m_data(content), m_address(addr) { } @@ -104,7 +104,7 @@ public: /** * Returns the data. */ - const QByteArray& data() const + const TQByteArray& data() const { return m_data; } /** @@ -145,7 +145,7 @@ public: /** * Detaches our data from a shared pool. - * @see QByteArray::detach + * @see TQByteArray::detach */ void detach() { m_data.detach(); } @@ -153,7 +153,7 @@ public: /** * Sets the data to the given value. Data is explicitly shared. */ - void setData(const QByteArray& data) + void setData(const TQByteArray& data) { m_data = data; } /** @@ -185,7 +185,7 @@ public: /** * Default constructor. */ - KDatagramSocket(QObject* parent = 0L, const char *name = 0L); + KDatagramSocket(TQObject* parent = 0L, const char *name = 0L); /** * Destructor. This closes the socket. @@ -205,8 +205,8 @@ public: * Some protocol families will use anonymous source addresses, while others * will allocate an address automatically. */ - virtual bool bind(const QString& node = QString::null, - const QString& service = QString::null); + virtual bool bind(const TQString& node = TQString::null, + const TQString& service = TQString::null); /** * @overload @@ -227,8 +227,8 @@ public: * @note Calling connect will not cause the socket to be bound. You have * to call @ref bind explicitly. */ - virtual bool connect(const QString& node = QString::null, - const QString& service = QString::null); + virtual bool connect(const TQString& node = TQString::null, + const TQString& service = TQString::null); /** * @overload diff --git a/kdecore/network/khttpproxysocketdevice.cpp b/kdecore/network/khttpproxysocketdevice.cpp index 73e433a2e..09d8dd7a5 100644 --- a/kdecore/network/khttpproxysocketdevice.cpp +++ b/kdecore/network/khttpproxysocketdevice.cpp @@ -27,8 +27,8 @@ #include <sys/types.h> #include <sys/socket.h> -#include <qsocketnotifier.h> -#include <qcstring.h> +#include <tqsocketnotifier.h> +#include <tqcstring.h> #include "kresolver.h" #include "ksocketaddress.h" @@ -43,8 +43,8 @@ class KNetwork::KHttpProxySocketDevicePrivate { public: KResolverEntry proxy; - QCString request; - QCString reply; + TQCString request; + TQCString reply; KSocketAddress peer; KHttpProxySocketDevicePrivate() @@ -89,7 +89,7 @@ void KHttpProxySocketDevice::setProxyServer(const KResolverEntry& proxy) void KHttpProxySocketDevice::close() { - d->reply = d->request = QCString(); + d->reply = d->request = TQCString(); d->peer = KSocketAddress(); KSocketDevice::close(); } @@ -128,7 +128,7 @@ bool KHttpProxySocketDevice::connect(const KResolverEntry& address) return parseServerReply(); } -bool KHttpProxySocketDevice::connect(const QString& node, const QString& service) +bool KHttpProxySocketDevice::connect(const TQString& node, const TQString& service) { // same safety checks as above if (m_sockfd == -1 && (d->proxy.family() == AF_UNSPEC || @@ -153,11 +153,11 @@ bool KHttpProxySocketDevice::connect(const QString& node, const QString& service setState(0); // unset open flag // prepare the request - QString request = QString::fromLatin1("CONNECT %1:%2 HTTP/1.1\r\n" + TQString request = TQString::fromLatin1("CONNECT %1:%2 HTTP/1.1\r\n" "Cache-Control: no-cache\r\n" "Host: \r\n" "\r\n"); - QString node2 = node; + TQString node2 = node; if (node.contains(':')) node2 = '[' + node + ']'; @@ -216,11 +216,11 @@ bool KHttpProxySocketDevice::parseServerReply() else if (avail < 0) return false; // error! - QByteArray buf(avail); + TQByteArray buf(avail); if (peekBlock(buf.data(), avail) < 0) return false; // error! - QCString fullHeaders = d->reply + buf.data(); + TQCString fullHeaders = d->reply + buf.data(); // search for the end of the headers index = fullHeaders.find("\r\n\r\n"); if (index == -1) diff --git a/kdecore/network/khttpproxysocketdevice.h b/kdecore/network/khttpproxysocketdevice.h index ed4f1d60c..7c9908ad5 100644 --- a/kdecore/network/khttpproxysocketdevice.h +++ b/kdecore/network/khttpproxysocketdevice.h @@ -87,7 +87,7 @@ public: * Name-based connection. * We can tell the HTTP proxy server the full name. */ - virtual bool connect(const QString& name, const QString& service); + virtual bool connect(const TQString& name, const TQString& service); /** * Return the peer address. diff --git a/kdecore/network/kiobuffer.h b/kdecore/network/kiobuffer.h index 4da5ecb43..2fc5b49e3 100644 --- a/kdecore/network/kiobuffer.h +++ b/kdecore/network/kiobuffer.h @@ -25,7 +25,7 @@ #ifndef KIOBUFFER_H #define KIOBUFFER_H -#include <qcstring.h> +#include <tqcstring.h> #include <kdelibs_export.h> @@ -77,7 +77,7 @@ public: /** * Reads a line from the buffer and discards it. */ - virtual QCString readLine() = 0; + virtual TQCString readLine() = 0; /** * Returns the number of bytes in the buffer. Note that this is not diff --git a/kdecore/network/kmulticastsocket.h b/kdecore/network/kmulticastsocket.h index 80c2f6990..7fbd6e0f2 100644 --- a/kdecore/network/kmulticastsocket.h +++ b/kdecore/network/kmulticastsocket.h @@ -52,7 +52,7 @@ public: /** * Constructor. */ - KMulticastSocket(QObject* parent = 0L, const char *name = 0L); + KMulticastSocket(TQObject* parent = 0L, const char *name = 0L); /** * Destructor. diff --git a/kdecore/network/kresolver.cpp b/kdecore/network/kresolver.cpp index 915288123..598b6de55 100644 --- a/kdecore/network/kresolver.cpp +++ b/kdecore/network/kresolver.cpp @@ -37,16 +37,16 @@ #include <unistd.h> // Qt includes -#include <qapplication.h> -#include <qstring.h> -#include <qcstring.h> -#include <qstrlist.h> -#include <qstringlist.h> -#include <qshared.h> -#include <qdatetime.h> -#include <qtimer.h> -#include <qmutex.h> -#include <qguardedptr.h> +#include <tqapplication.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqstrlist.h> +#include <tqstringlist.h> +#include <tqshared.h> +#include <tqdatetime.h> +#include <tqtimer.h> +#include <tqmutex.h> +#include <tqguardedptr.h> // IDN #ifdef HAVE_IDNA_H @@ -63,7 +63,7 @@ #ifdef NEED_MUTEX #warning "mutex" -QMutex getXXbyYYmutex; +TQMutex getXXbyYYmutex; #endif using namespace KNetwork; @@ -78,8 +78,8 @@ public: KSocketAddress addr; int socktype; int protocol; - QString canonName; - QCString encodedName; + TQString canonName; + TQCString encodedName; inline KResolverEntryPrivate() : socktype(0), protocol(0) @@ -94,7 +94,7 @@ KResolverEntry::KResolverEntry() : // constructor with stuff KResolverEntry::KResolverEntry(const KSocketAddress& addr, int socktype, int protocol, - const QString& canonName, const QCString& encodedName) : + const TQString& canonName, const TQCString& encodedName) : d(new KResolverEntryPrivate) { d->addr = addr; @@ -106,8 +106,8 @@ KResolverEntry::KResolverEntry(const KSocketAddress& addr, int socktype, int pro // constructor with even more stuff KResolverEntry::KResolverEntry(const struct sockaddr* sa, Q_UINT16 salen, int socktype, - int protocol, const QString& canonName, - const QCString& encodedName) : + int protocol, const TQString& canonName, + const TQCString& encodedName) : d(new KResolverEntryPrivate) { d->addr = KSocketAddress(sa, salen); @@ -153,15 +153,15 @@ int KResolverEntry::family() const } // returns the canonical name -QString KResolverEntry::canonicalName() const +TQString KResolverEntry::canonicalName() const { - return d ? d->canonName : QString::null; + return d ? d->canonName : TQString::null; } // returns the encoded name -QCString KResolverEntry::encodedName() const +TQCString KResolverEntry::encodedName() const { - return d ? d->encodedName : QCString(); + return d ? d->encodedName : TQCString(); } // returns the socket type @@ -196,7 +196,7 @@ KResolverEntry& KResolverEntry::operator= (const KResolverEntry& that) class KNetwork::KResolverResultsPrivate { public: - QString node, service; + TQString node, service; int errorcode, syserror; KResolverResultsPrivate() : @@ -212,7 +212,7 @@ KResolverResults::KResolverResults() // copy constructor KResolverResults::KResolverResults(const KResolverResults& other) - : QValueList<KResolverEntry>(other), d(new KResolverResultsPrivate) + : TQValueList<KResolverEntry>(other), d(new KResolverResultsPrivate) { *d = *other.d; } @@ -233,8 +233,8 @@ KResolverResults::operator= (const KResolverResults& other) // copy over the other data *d = *other.d; - // now let QValueList do the rest of the work - QValueList<KResolverEntry>::operator =(other); + // now let TQValueList do the rest of the work + TQValueList<KResolverEntry>::operator =(other); return *this; } @@ -259,20 +259,20 @@ void KResolverResults::setError(int errorcode, int systemerror) } // gets the hostname -QString KResolverResults::nodeName() const +TQString KResolverResults::nodeName() const { return d->node; } // gets the service name -QString KResolverResults::serviceName() const +TQString KResolverResults::serviceName() const { return d->service; } // sets the address -void KResolverResults::setAddress(const QString& node, - const QString& service) +void KResolverResults::setAddress(const TQString& node, + const TQString& service) { d->node = node; d->service = service; @@ -285,19 +285,19 @@ void KResolverResults::virtual_hook( int, void* ) /////////////////////// // class KResolver -QStringList *KResolver::idnDomains = 0; +TQStringList *KResolver::idnDomains = 0; // default constructor -KResolver::KResolver(QObject *parent, const char *name) - : QObject(parent, name), d(new KResolverPrivate(this)) +KResolver::KResolver(TQObject *parent, const char *name) + : TQObject(parent, name), d(new KResolverPrivate(this)) { } // constructor with host and service -KResolver::KResolver(const QString& nodename, const QString& servicename, - QObject *parent, const char *name) - : QObject(parent, name), d(new KResolverPrivate(this, nodename, servicename)) +KResolver::KResolver(const TQString& nodename, const TQString& servicename, + TQObject *parent, const char *name) + : TQObject(parent, name), d(new KResolverPrivate(this, nodename, servicename)) { } @@ -333,19 +333,19 @@ bool KResolver::isRunning() const } // get the hostname -QString KResolver::nodeName() const +TQString KResolver::nodeName() const { return d->input.node; } // get the service -QString KResolver::serviceName() const +TQString KResolver::serviceName() const { return d->input.service; } // sets the hostname -void KResolver::setNodeName(const QString& nodename) +void KResolver::setNodeName(const TQString& nodename) { // don't touch those values if we're working! if (!isRunning()) @@ -357,7 +357,7 @@ void KResolver::setNodeName(const QString& nodename) } // sets the service -void KResolver::setServiceName(const QString& service) +void KResolver::setServiceName(const TQString& service) { // don't change if running if (!isRunning()) @@ -369,7 +369,7 @@ void KResolver::setServiceName(const QString& service) } // sets the address -void KResolver::setAddress(const QString& nodename, const QString& service) +void KResolver::setAddress(const TQString& nodename, const TQString& service) { setNodeName(nodename); setServiceName(service); @@ -462,7 +462,7 @@ bool KResolver::wait(int msec) return true; } - QMutexLocker locker(&d->mutex); + TQMutexLocker locker(&d->mutex); if (!isRunning()) { @@ -476,7 +476,7 @@ bool KResolver::wait(int msec) } else { - QTime t; + TQTime t; t.start(); while (!msec || t.elapsed() < msec) @@ -525,7 +525,7 @@ KResolver::results() const return r; } -bool KResolver::event(QEvent* e) +bool KResolver::event(TQEvent* e) { if (static_cast<int>(e->type()) == KResolverManager::ResolutionCompleted) { @@ -541,7 +541,7 @@ void KResolver::emitFinished() if (isRunning()) d->status = KResolver::Success; - QGuardedPtr<QObject> p = this; // guard against deletion + TQGuardedPtr<TQObject> p = this; // guard against deletion emit finished(d->results); @@ -549,7 +549,7 @@ void KResolver::emitFinished() deleteLater(); // in QObject } -QString KResolver::errorString(int errorcode, int syserror) +TQString KResolver::errorString(int errorcode, int syserror) { // no i18n now... static const char * const messages[] = @@ -574,17 +574,17 @@ QString KResolver::errorString(int errorcode, int syserror) return i18n("request was canceled"); if (errorcode > 0 || errorcode < SystemError) - return QString::null; + return TQString::null; - QString msg = i18n(messages[-errorcode]); + TQString msg = i18n(messages[-errorcode]); if (errorcode == SystemError) - msg.arg(QString::fromLocal8Bit(strerror(syserror))); + msg.arg(TQString::fromLocal8Bit(strerror(syserror))); return msg; } KResolverResults -KResolver::resolve(const QString& host, const QString& service, int flags, +KResolver::resolve(const TQString& host, const TQString& service, int flags, int families) { KResolver qres(host, service, qApp, "synchronous KResolver"); @@ -595,23 +595,23 @@ KResolver::resolve(const QString& host, const QString& service, int flags, return qres.results(); } -bool KResolver::resolveAsync(QObject* userObj, const char *userSlot, - const QString& host, const QString& service, +bool KResolver::resolveAsync(TQObject* userObj, const char *userSlot, + const TQString& host, const TQString& service, int flags, int families) { KResolver* qres = new KResolver(host, service, qApp, "asynchronous KResolver"); - QObject::connect(qres, SIGNAL(finished(KResolverResults)), userObj, userSlot); + TQObject::connect(qres, TQT_SIGNAL(finished(KResolverResults)), userObj, userSlot); qres->setFlags(flags); qres->setFamily(families); qres->d->deleteWhenDone = true; // this is the only difference from the example code return qres->start(); } -QStrList KResolver::protocolName(int protonum) +TQStrList KResolver::protocolName(int protonum) { struct protoent *pe = 0L; #ifndef HAVE_GETPROTOBYNAME_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); pe = getprotobynumber(protonum); @@ -639,7 +639,7 @@ QStrList KResolver::protocolName(int protonum) #endif // Do common processing - QStrList lst(true); // use deep copies + TQStrList lst(true); // use deep copies if (pe != NULL) { lst.append(pe->p_name); @@ -654,11 +654,11 @@ QStrList KResolver::protocolName(int protonum) return lst; } -QStrList KResolver::protocolName(const char *protoname) +TQStrList KResolver::protocolName(const char *protoname) { struct protoent *pe = 0L; #ifndef HAVE_GETPROTOBYNAME_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); pe = getprotobyname(protoname); @@ -686,7 +686,7 @@ QStrList KResolver::protocolName(const char *protoname) #endif // Do common processing - QStrList lst(true); // use deep copies + TQStrList lst(true); // use deep copies if (pe != NULL) { lst.append(pe->p_name); @@ -705,7 +705,7 @@ int KResolver::protocolNumber(const char *protoname) { struct protoent *pe = 0L; #ifndef HAVE_GETPROTOBYNAME_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); pe = getprotobyname(protoname); @@ -748,7 +748,7 @@ int KResolver::servicePort(const char *servname, const char *protoname) { struct servent *se = 0L; #ifndef HAVE_GETSERVBYNAME_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); se = getservbyname(servname, protoname); @@ -787,11 +787,11 @@ int KResolver::servicePort(const char *servname, const char *protoname) return servport; } -QStrList KResolver::serviceName(const char* servname, const char *protoname) +TQStrList KResolver::serviceName(const char* servname, const char *protoname) { struct servent *se = 0L; #ifndef HAVE_GETSERVBYNAME_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); se = getservbyname(servname, protoname); @@ -819,7 +819,7 @@ QStrList KResolver::serviceName(const char* servname, const char *protoname) #endif // Do common processing - QStrList lst(true); // use deep copies + TQStrList lst(true); // use deep copies if (se != NULL) { lst.append(se->s_name); @@ -834,11 +834,11 @@ QStrList KResolver::serviceName(const char* servname, const char *protoname) return lst; } -QStrList KResolver::serviceName(int port, const char *protoname) +TQStrList KResolver::serviceName(int port, const char *protoname) { struct servent *se = 0L; #ifndef HAVE_GETSERVBYPORT_R - QMutexLocker locker(&getXXbyYYmutex); + TQMutexLocker locker(&getXXbyYYmutex); se = getservbyport(port, protoname); @@ -866,7 +866,7 @@ QStrList KResolver::serviceName(int port, const char *protoname) #endif // Do common processing - QStrList lst(true); // use deep copies + TQStrList lst(true); // use deep copies if (se != NULL) { lst.append(se->s_name); @@ -881,9 +881,9 @@ QStrList KResolver::serviceName(int port, const char *protoname) return lst; } -QString KResolver::localHostName() +TQString KResolver::localHostName() { - QCString name; + TQCString name; int len; #ifdef MAXHOSTNAMELEN @@ -910,12 +910,12 @@ QString KResolver::localHostName() else { // Oops! Unknown error! - name = QCString(); + name = TQCString(); } } if (name.isEmpty()) - return QString::fromLatin1("localhost"); + return TQString::fromLatin1("localhost"); if (name.find('.') == -1) { @@ -924,7 +924,7 @@ QString KResolver::localHostName() KResolverResults results = resolve(name, "0", CanonName); if (results.isEmpty()) // cannot find a valid hostname! - return QString::fromLatin1("localhost"); + return TQString::fromLatin1("localhost"); else return results.first().canonicalName(); } @@ -934,31 +934,31 @@ QString KResolver::localHostName() // forward declaration -static QStringList splitLabels(const QString& unicodeDomain); -static QCString ToASCII(const QString& label); -static QString ToUnicode(const QString& label); +static TQStringList splitLabels(const TQString& unicodeDomain); +static TQCString ToASCII(const TQString& label); +static TQString ToUnicode(const TQString& label); -static QStringList *KResolver_initIdnDomains() +static TQStringList *KResolver_initIdnDomains() { const char *kde_use_idn = getenv("KDE_USE_IDN"); if (!kde_use_idn) kde_use_idn = "ac:at:br:cat:ch:cl:cn:de:dk:fi:gr:hu:info:io:is:jp:kr:li:lt:museum:org:no:se:sh:th:tm:tw:vn"; - return new QStringList(QStringList::split(':', QString::fromLatin1(kde_use_idn).lower())); + return new TQStringList(TQStringList::split(':', TQString::fromLatin1(kde_use_idn).lower())); } // implement the ToAscii function, as described by IDN documents -QCString KResolver::domainToAscii(const QString& unicodeDomain) +TQCString KResolver::domainToAscii(const TQString& unicodeDomain) { if (!idnDomains) idnDomains = KResolver_initIdnDomains(); - QCString retval; + TQCString retval; // RFC 3490, section 4 describes the operation: // 1) this is a query, so don't allow unassigned // 2) split the domain into individual labels, without // separators. - QStringList input = splitLabels(unicodeDomain); + TQStringList input = splitLabels(unicodeDomain); // Do we allow IDN names for this TLD? if (input.count() && !idnDomains->contains(input[input.count()-1].lower())) @@ -968,13 +968,13 @@ QCString KResolver::domainToAscii(const QString& unicodeDomain) // we don't enforce // 4) for each label, apply ToASCII - QStringList::Iterator it = input.begin(); - const QStringList::Iterator end = input.end(); + TQStringList::Iterator it = input.begin(); + const TQStringList::Iterator end = input.end(); for ( ; it != end; ++it) { - QCString cs = ToASCII(*it); + TQCString cs = ToASCII(*it); if (cs.isNull()) - return QCString(); // error! + return TQCString(); // error! // no, all is Ok. if (!retval.isEmpty()) @@ -985,20 +985,20 @@ QCString KResolver::domainToAscii(const QString& unicodeDomain) return retval; } -QString KResolver::domainToUnicode(const QCString& asciiDomain) +TQString KResolver::domainToUnicode(const TQCString& asciiDomain) { - return domainToUnicode(QString::fromLatin1(asciiDomain)); + return domainToUnicode(TQString::fromLatin1(asciiDomain)); } // implement the ToUnicode function, as described by IDN documents -QString KResolver::domainToUnicode(const QString& asciiDomain) +TQString KResolver::domainToUnicode(const TQString& asciiDomain) { if (asciiDomain.isEmpty()) return asciiDomain; if (!idnDomains) idnDomains = KResolver_initIdnDomains(); - QString retval; + TQString retval; // draft-idn-idna-14.txt, section 4 describes the operation: // 1) this is a query, so don't allow unassigned @@ -1006,7 +1006,7 @@ QString KResolver::domainToUnicode(const QString& asciiDomain) // 2) split the domain into individual labels, without // separators. - QStringList input = splitLabels(asciiDomain); + TQStringList input = splitLabels(asciiDomain); // Do we allow IDN names for this TLD? if (input.count() && !idnDomains->contains(input[input.count()-1].lower())) @@ -1016,11 +1016,11 @@ QString KResolver::domainToUnicode(const QString& asciiDomain) // we don't enforce // 4) for each label, apply ToUnicode - QStringList::Iterator it; - const QStringList::Iterator end = input.end(); + TQStringList::Iterator it; + const TQStringList::Iterator end = input.end(); for (it = input.begin(); it != end; ++it) { - QString label = ToUnicode(*it).lower(); + TQString label = ToUnicode(*it).lower(); // ToUnicode can't fail if (!retval.isEmpty()) @@ -1031,7 +1031,7 @@ QString KResolver::domainToUnicode(const QString& asciiDomain) return retval; } -QString KResolver::normalizeDomain(const QString& domain) +TQString KResolver::normalizeDomain(const TQString& domain) { return domainToUnicode(domainToAscii(domain)); } @@ -1048,7 +1048,7 @@ void KResolver::virtual_hook( int, void* ) // RFC 3492 - Punycode: A Bootstring encoding of Unicode // for Internationalized Domain Names in Applications (IDNA) -static QStringList splitLabels(const QString& unicodeDomain) +static TQStringList splitLabels(const TQString& unicodeDomain) { // From RFC 3490 section 3.1: // "Whenever dots are used as label separators, the following characters @@ -1057,7 +1057,7 @@ static QStringList splitLabels(const QString& unicodeDomain) // stop)." static const unsigned int separators[] = { 0x002E, 0x3002, 0xFF0E, 0xFF61 }; - QStringList lst; + TQStringList lst; int start = 0; uint i; for (i = 0; i < unicodeDomain.length(); i++) @@ -1081,7 +1081,7 @@ static QStringList splitLabels(const QString& unicodeDomain) return lst; } -static QCString ToASCII(const QString& label) +static TQCString ToASCII(const TQString& label) { #ifdef HAVE_IDNA_H // We have idna.h, so we can use the idna_to_ascii @@ -1092,9 +1092,9 @@ static QCString ToASCII(const QString& label) if (label.length() == 0) // this is allowed - return QCString(""); // empty, not null + return TQCString(""); // empty, not null - QCString retval; + TQCString retval; char buf[65]; Q_UINT32* ucs4 = new Q_UINT32[label.length() + 1]; @@ -1115,7 +1115,7 @@ static QCString ToASCII(const QString& label) #endif } -static QString ToUnicode(const QString& label) +static TQString ToUnicode(const TQString& label) { #ifdef HAVE_IDNA_H // We have idna.h, so we can use the idna_to_unicode @@ -1147,7 +1147,7 @@ static QString ToUnicode(const QString& label) } // now set the answer - QString result; + TQString result; result.setLength(outlen); for (uint i = 0; i < outlen; i++) result[i] = (unsigned int)ucs4_output[i]; diff --git a/kdecore/network/kresolver.h b/kdecore/network/kresolver.h index b4e4334be..cfc1226a5 100644 --- a/kdecore/network/kresolver.h +++ b/kdecore/network/kresolver.h @@ -27,8 +27,8 @@ ////////////////// // Needed includes -#include <qvaluelist.h> -#include <qobject.h> +#include <tqvaluelist.h> +#include <tqobject.h> #include "ksocketaddress.h" @@ -85,8 +85,8 @@ public: * @param encodedName the ASCII-compatible encoding of the hostname */ KResolverEntry(const KSocketAddress& addr, int socktype, int protocol, - const QString& canonName = QString::null, - const QCString& encodedName = QCString()); + const TQString& canonName = TQString::null, + const TQCString& encodedName = TQCString()); /** * Constructs a new KResolverEntry from raw forms of @@ -102,8 +102,8 @@ public: * @param encodedName the ASCII-compatible encoding of the hostname */ KResolverEntry(const struct sockaddr *sa, Q_UINT16 salen, int socktype, - int protocol, const QString& canonName = QString::null, - const QCString& encodedName = QCString()); + int protocol, const TQString& canonName = TQString::null, + const TQCString& encodedName = TQCString()); /** * Copy constructor. @@ -137,21 +137,21 @@ public: /** * Retrieves the canonical name associated with this entry, if there is any. - * If the canonical name was not found, this function returns QString::null. + * If the canonical name was not found, this function returns TQString::null. */ - QString canonicalName() const; + TQString canonicalName() const; /** * Retrieves the encoded domain name associated with this entry, if there is * any. If this domain has been resolved through DNS, this will be the * the ACE-encoded hostname. * - * Returns a null QCString if such information is not available. + * Returns a null TQCString if such information is not available. * * Please note that this information is NOT to be presented to the user, * unless requested. */ - QCString encodedName() const; + TQCString encodedName() const; /** * Retrieves the socket type associated with this entry. @@ -181,7 +181,7 @@ class KResolverResultsPrivate; * @brief Name and service resolution results. * * This object contains the results of a name and service resolution, as - * those performed by @ref KResolver. It is also a descendant of QValueList, so + * those performed by @ref KResolver. It is also a descendant of TQValueList, so * you may use all its member functions here to access the elements. * * A KResolverResults object is associated with a resolution, so, in addition @@ -194,7 +194,7 @@ class KResolverResultsPrivate; * * @author Thiago Macieira <thiago.macieira@kdemail.net> */ -class KDECORE_EXPORT KResolverResults: public QValueList<KResolverEntry> +class KDECORE_EXPORT KResolverResults: public TQValueList<KResolverEntry> { public: /** @@ -250,17 +250,17 @@ public: /** * The nodename to which the resolution was performed. */ - QString nodeName() const; + TQString nodeName() const; /** * The service name to which the resolution was performed. */ - QString serviceName() const; + TQString serviceName() const; /** * Sets the new nodename and service name */ - void setAddress(const QString& host, const QString& service); + void setAddress(const TQString& host, const TQString& service); protected: virtual void virtual_hook( int id, void* data ); @@ -435,7 +435,7 @@ public: * names and flags using the member functions before starting * the name resolution. */ - KResolver(QObject * = 0L, const char * = 0L); + KResolver(TQObject * = 0L, const char * = 0L); /** * Constructor with host and service names. @@ -447,8 +447,8 @@ public: * @param nodename The host name we want resolved. * @param servicename The service name associated, like "http". */ - KResolver(const QString& nodename, const QString& servicename = QString::null, - QObject * = 0L, const char * = 0L); + KResolver(const TQString& nodename, const TQString& servicename = TQString::null, + TQObject * = 0L, const char * = 0L); /** * Destructor. @@ -490,7 +490,7 @@ public: /** * Returns the textual representation of the error in this object. */ - inline QString errorString() const + inline TQString errorString() const { return errorString(error(), systemError()); } /** @@ -501,37 +501,37 @@ public: /** * The nodename to which the resolution was/is to be performed. */ - QString nodeName() const; + TQString nodeName() const; /** * The service name to which the resolution was/is to be performed. */ - QString serviceName() const; + TQString serviceName() const; /** * Sets the nodename for the resolution. * - * Set the nodename to QString::null to unset it. + * Set the nodename to TQString::null to unset it. * @param nodename The nodename to be resolved. */ - void setNodeName(const QString& nodename); + void setNodeName(const TQString& nodename); /** * Sets the service name to be resolved. * - * Set it to QString::null to unset it. + * Set it to TQString::null to unset it. * @param service The service to be resolved. */ - void setServiceName(const QString& service); + void setServiceName(const TQString& service); /** * Sets both the host and the service names. * - * Setting either value to QString::null will unset them. + * Setting either value to TQString::null will unset them. * @param node The nodename * @param service The service name */ - void setAddress(const QString& node, const QString& service); + void setAddress(const TQString& node, const TQString& service); /** * Retrieves the flags set for the resolution. @@ -673,14 +673,14 @@ public: KResolverResults results() const; /** - * Handles events. Reimplemented from QObject. + * Handles events. Reimplemented from TQObject. * * This function handles the events generated by the manager indicating that * this object has finished processing. * * Do not post events to this object. */ - virtual bool event(QEvent*); + virtual bool event(TQEvent*); signals: // signals @@ -691,7 +691,7 @@ signals: * will contain the resolved data. * * Note: if you are doing multiple resolutions, you can use the - * QObject::sender() function to distinguish one Resolver object from + * TQObject::sender() function to distinguish one Resolver object from * another. * * @param results the resolved data; might be empty if the resolution @@ -717,7 +717,7 @@ public: * @return the string representation. This is already * i18n'ed. */ - static QString errorString(int errorcode, int syserror = 0); + static TQString errorString(int errorcode, int syserror = 0); /** * Resolve the nodename and service name synchronously @@ -742,7 +742,7 @@ public: * @return a KResolverResults object containing the results * @see KResolverResults for information on how to obtain the error code */ - static KResolverResults resolve(const QString& host, const QString& service, + static KResolverResults resolve(const TQString& host, const TQString& service, int flags = 0, int families = KResolver::InternetFamily); /** @@ -758,7 +758,7 @@ public: * * \code * KResolver* qres = new KResolver(host, service); - * QObject::connect(qres, SIGNAL(finished(KResolverResults)), + * TQObject::connect(qres, TQT_SIGNAL(finished(KResolverResults)), * userObj, userSlot); * qres->setFlags(flags); * qres->setFamily(families); @@ -767,7 +767,7 @@ public: * * You should use it like this in your code: * \code - * KResolver::resolveAsync(myObj, SLOT(mySlot(KResolverResults)), host, service); + * KResolver::resolveAsync(myObj, TQT_SLOT(mySlot(KResolverResults)), host, service); * \endcode * * @param userObj the object whose slot @p userSlot we will connect @@ -779,8 +779,8 @@ public: * @return true if the queueing was successful, false if not * @see KResolverResults for information on how to obtain the error code */ - static bool resolveAsync(QObject* userObj, const char *userSlot, - const QString& host, const QString& service, + static bool resolveAsync(TQObject* userObj, const char *userSlot, + const TQString& host, const TQString& service, int flags = 0, int families = KResolver::InternetFamily); /** @@ -789,7 +789,7 @@ public: * over the Internet. * * Note this function may fail, in which case it'll return a null - * QCString. Reasons for failure include use of unknown code + * TQCString. Reasons for failure include use of unknown code * points (Unicode characters). * * Note that the encoding is illegible and, thus, should not be presented @@ -797,9 +797,9 @@ public: * * @param unicodeDomain the domain name to be encoded * @return the ACE-encoded suitable for DNS queries if successful, a null - * QCString if failure. + * TQCString if failure. */ - static QCString domainToAscii(const QString& unicodeDomain); + static TQCString domainToAscii(const TQString& unicodeDomain); /** * Does the inverse of @ref domainToAscii and return an Unicode domain @@ -819,16 +819,16 @@ public: * if successful, the original string if not * @note ACE = ASCII-Compatible Encoding, i.e., 7-bit */ - static QString domainToUnicode(const QCString& asciiDomain); + static TQString domainToUnicode(const TQCString& asciiDomain); /** - * The same as above, but taking a QString argument. + * The same as above, but taking a TQString argument. * * @param asciiDomain the ACE-encoded domain name to be decoded * @return the Unicode representation of the given domain name - * if successful, QString::null if not. + * if successful, TQString::null if not. */ - static QString domainToUnicode(const QString& asciiDomain); + static TQString domainToUnicode(const TQString& asciiDomain); /** * Normalise a domain name. @@ -850,21 +850,21 @@ public: * hostname. * * @param domain a domain to be normalised - * @return the normalised domain, or QString::null if the domain is + * @return the normalised domain, or TQString::null if the domain is * invalid. */ - static QString normalizeDomain(const QString& domain); + static TQString normalizeDomain(const TQString& domain); /** * Resolves a protocol number to its names * - * Note: the returned QStrList operates on deep-copies. + * Note: the returned TQStrList operates on deep-copies. * * @param protonum the protocol number to be looked for * @return all the protocol names in a list. The first is the "proper" * name. */ - static QStrList protocolName(int protonum); + static TQStrList protocolName(int protonum); /** * Finds all aliases for a given protocol name @@ -873,7 +873,7 @@ public: * @return all the protocol names in a list. The first is the "proper" * name. */ - static QStrList protocolName(const char *protoname); + static TQStrList protocolName(const char *protoname); /** * Resolves a protocol name to its number @@ -895,26 +895,26 @@ public: /** * Finds all the aliases for a given service name * - * Note: the returned QStrList operates on deep-copies. + * Note: the returned TQStrList operates on deep-copies. * * @param servname the service alias to be looked for * @param protoname the protocol it is associated with * @return all the service names in a list. The first is the "proper" * name. */ - static QStrList serviceName(const char *servname, const char *protoname); + static TQStrList serviceName(const char *servname, const char *protoname); /** * Resolves a port number to its names * - * Note: the returned QStrList operates on deep copies. + * Note: the returned TQStrList operates on deep copies. * * @param port the port number, in host byte-order * @param protoname the protocol it is associated with * @return all the service names in a list. The first is the "proper" * name. */ - static QStrList serviceName(int port, const char *protoname); + static TQStrList serviceName(int port, const char *protoname); /** * Returns this machine's local hostname. @@ -922,7 +922,7 @@ public: * @return this machine's local hostname * @since 3.5 */ - static QString localHostName(); + static TQString localHostName(); protected: @@ -937,7 +937,7 @@ private: friend class KResolverResults; friend class ::KNetwork::Internal::KResolverManager; - static QStringList *idnDomains; + static TQStringList *idnDomains; }; } // namespace KNetwork diff --git a/kdecore/network/kresolver_p.h b/kdecore/network/kresolver_p.h index 2fac7eb45..e29304383 100644 --- a/kdecore/network/kresolver_p.h +++ b/kdecore/network/kresolver_p.h @@ -28,23 +28,23 @@ #include <config.h> #include <sys/types.h> -#include <qstring.h> -#include <qcstring.h> -#include <qvaluelist.h> -#include <qptrlist.h> -#include <qptrqueue.h> -#include <qthread.h> -#include <qmutex.h> -#include <qwaitcondition.h> -#include <qsemaphore.h> -#include <qevent.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> +#include <tqptrqueue.h> +#include <tqthread.h> +#include <tqmutex.h> +#include <tqwaitcondition.h> +#include <tqsemaphore.h> +#include <tqevent.h> #include "kresolver.h" /* decide whether we need a mutex */ #if !defined(HAVE_GETPROTOBYNAME_R) || !defined(HAVE_GETSERVBYNAME_R) || !defined(HAVE_GETHOSTBYNAME_R) || !defined(HAVE_GETSERVBYPORT_R) # define NEED_MUTEX -extern QMutex getXXbyYYmutex; +extern TQMutex getXXbyYYmutex; #endif /* some systems have the functions, but don't declare them */ @@ -90,8 +90,8 @@ namespace KNetwork struct InputData { - QString node, service; - QCString protocolName; + TQString node, service; + TQCString protocolName; int flags; int familyMask; int socktype; @@ -115,14 +115,14 @@ namespace KNetwork Internal::InputData input; // mutex - QMutex mutex; + TQMutex mutex; // output data KResolverResults results; KResolverPrivate(KResolver* _parent, - const QString& _node = QString::null, - const QString& _service = QString::null) + const TQString& _node = TQString::null, + const TQString& _service = TQString::null) : parent(_parent), deleteWhenDone(false), waiting(false), status(0), errorcode(0), syserror(0) { @@ -166,7 +166,7 @@ namespace KNetwork * objects in wait state will be woken up and will check if they are done. * If they aren't, they will go back to sleeping. */ - QWaitCondition notifyWaiters; + TQWaitCondition notifyWaiters; private: /* @@ -185,22 +185,22 @@ namespace KNetwork * data available that has to be processed. All worker threads wait on this * waitcond for a limited amount of time. */ - QWaitCondition feedWorkers; + TQWaitCondition feedWorkers; // this mutex protects the data in this object - QMutex mutex; + TQMutex mutex; // hold a list of all the current threads we have - QPtrList<KResolverThread> workers; + TQPtrList<KResolverThread> workers; // hold a list of all the new requests we have - QPtrList<RequestData> newRequests; + TQPtrList<RequestData> newRequests; // hold a list of all the requests in progress we have - QPtrList<RequestData> currentRequests; + TQPtrList<RequestData> currentRequests; // hold a list of all the workers we have - QPtrList<KNetwork::KResolverWorkerFactoryBase> workerFactories; + TQPtrList<KNetwork::KResolverWorkerFactoryBase> workerFactories; // private constructor KResolverManager(); diff --git a/kdecore/network/kresolvermanager.cpp b/kdecore/network/kresolvermanager.cpp index 204031915..b3c7172ae 100644 --- a/kdecore/network/kresolvermanager.cpp +++ b/kdecore/network/kresolvermanager.cpp @@ -38,15 +38,15 @@ extern "C" { # include <resolv.h> #endif -#include <qapplication.h> -#include <qstring.h> -#include <qcstring.h> -#include <qptrlist.h> -#include <qtimer.h> -#include <qmutex.h> -#include <qthread.h> -#include <qwaitcondition.h> -#include <qsemaphore.h> +#include <tqapplication.h> +#include <tqstring.h> +#include <tqcstring.h> +#include <tqptrlist.h> +#include <tqtimer.h> +#include <tqmutex.h> +#include <tqthread.h> +#include <tqwaitcondition.h> +#include <tqsemaphore.h> #include <kde_file.h> #include <kdebug.h> @@ -134,8 +134,8 @@ public: int useCount; # ifndef RES_INIT_THREADSAFE - QWaitCondition cond; - QMutex mutex; + TQWaitCondition cond; + TQMutex mutex; # endif bool shouldResInit() @@ -178,7 +178,7 @@ public: void release() { # ifndef RES_INIT_THREADSAFE - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); if (--useCount == 0) { if (shouldResInit()) @@ -264,13 +264,13 @@ void KResolverThread::run() // initialisation // enter the loop already - //qDebug("KResolverThread(thread %u/%p): started", pid, (void*)QThread::currentThread()); + //qDebug("KResolverThread(thread %u/%p): started", pid, (void*)TQThread::currentThread()); KResolverManager::manager()->registerThread(this); while (true) { data = KResolverManager::manager()->requestData(this, ::maxThreadWaitTime); //qDebug("KResolverThread(thread %u/%p) got data %p", KResolverManager::pid, - // (void*)QThread::currentThread(), (void*)data); + // (void*)TQThread::currentThread(), (void*)data); if (data) { // yes, we got data @@ -292,7 +292,7 @@ void KResolverThread::run() } KResolverManager::manager()->unregisterThread(this); - //qDebug("KResolverThread(thread %u/%p): exiting", pid, (void*)QThread::currentThread()); + //qDebug("KResolverThread(thread %u/%p): exiting", pid, (void*)TQThread::currentThread()); } bool KResolverThread::checkResolver() @@ -366,7 +366,7 @@ RequestData* KResolverManager::requestData(KResolverThread *th, int maxWaitTime) // lock the mutex, so that the manager thread or other threads won't // interfere. - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); RequestData *data = findData(th); if (data) @@ -416,7 +416,7 @@ void KResolverManager::releaseData(KResolverThread *, RequestData* data) ///// //qDebug("KResolverManager::releaseData(%u/%p): %p has been released", pid, -// (void*)QThread::currentThread(), (void*)data); +// (void*)TQThread::currentThread(), (void*)data); if (data->obj) { @@ -434,7 +434,7 @@ void KResolverManager::releaseData(KResolverThread *, RequestData* data) void KResolverManager::handleFinished() { bool redo = false; - QPtrQueue<RequestData> doneRequests; + TQPtrQueue<RequestData> doneRequests; mutex.lock(); @@ -601,7 +601,7 @@ void KResolverManager::doNotifying(RequestData *p) r.setAddress(p->input->node, p->input->service); //qDebug("KResolverManager::doNotifying(%u/%p): for %p whose status is %d and has %d results", - //pid, (void*)QThread::currentThread(), (void*)p, p->obj->status, r.count()); + //pid, (void*)TQThread::currentThread(), (void*)p, p->obj->status, r.count()); p->obj->errorcode = r.error(); p->obj->syserror = r.systemError(); @@ -619,7 +619,7 @@ void KResolverManager::doNotifying(RequestData *p) // no, so we must post an event requesting that the signal be emitted // sorry for the C-style cast, but neither static nor reintepret cast work // here; I'd have to do two casts - QApplication::postEvent(parent, new QEvent((QEvent::Type)(ResolutionCompleted))); + TQApplication::postEvent(parent, new TQEvent((TQEvent::Type)(ResolutionCompleted))); // release the mutex p->obj->mutex.unlock(); @@ -693,7 +693,7 @@ void KResolverManager::dispatch(RequestData *data) // is supposed to verify the availability of threads, start // any if necessary - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); // add to the queue newRequests.append(data); @@ -817,6 +817,6 @@ bool KResolverManager::dequeueNew(KResolver* obj) // it's expected to be thread-safe void KResolverManager::dequeue(KResolver *obj) { - QMutexLocker locker(&mutex); + TQMutexLocker locker(&mutex); dequeueNew(obj); } diff --git a/kdecore/network/kresolverstandardworkers.cpp b/kdecore/network/kresolverstandardworkers.cpp index 93c706306..f64803ced 100644 --- a/kdecore/network/kresolverstandardworkers.cpp +++ b/kdecore/network/kresolverstandardworkers.cpp @@ -38,10 +38,10 @@ #include <net/if.h> #endif -#include <qthread.h> -#include <qmutex.h> -#include <qstrlist.h> -#include <qfile.h> +#include <tqthread.h> +#include <tqmutex.h> +#include <tqstrlist.h> +#include <tqfile.h> #include "kdebug.h" #include "kglobal.h" @@ -76,8 +76,8 @@ static bool hasIPv6() } // blacklist management -static QMutex blacklistMutex; // KDE4: change to a QReadWriteLock -QStringList KBlacklistWorker::blacklist; +static TQMutex blacklistMutex; // KDE4: change to a QReadWriteLock +TQStringList KBlacklistWorker::blacklist; void KBlacklistWorker::init() { @@ -98,21 +98,21 @@ void KBlacklistWorker::init() void KBlacklistWorker::loadBlacklist() { - QMutexLocker locker(&blacklistMutex); - QStringList filelist = KGlobal::dirs()->findAllResources("config", "ipv6blacklist"); + TQMutexLocker locker(&blacklistMutex); + TQStringList filelist = KGlobal::dirs()->findAllResources("config", "ipv6blacklist"); - QStringList::ConstIterator it = filelist.constBegin(), + TQStringList::ConstIterator it = filelist.constBegin(), end = filelist.constEnd(); for ( ; it != end; ++it) { // for each file, each line is a domainname to be blacklisted - QFile f(*it); + TQFile f(*it); if (!f.open(IO_ReadOnly)) continue; - QTextStream stream(&f); - stream.setEncoding(QTextStream::Latin1); - for (QString line = stream.readLine(); !line.isNull(); + TQTextStream stream(&f); + stream.setEncoding(TQTextStream::Latin1); + for (TQString line = stream.readLine(); !line.isNull(); line = stream.readLine()) { if (line.isEmpty()) @@ -131,7 +131,7 @@ void KBlacklistWorker::loadBlacklist() // checks the blacklist to see if the domain is listed // it matches the domain ending part -bool KBlacklistWorker::isBlacklisted(const QString& host) +bool KBlacklistWorker::isBlacklisted(const TQString& host) { KBlacklistWorker::init(); @@ -140,12 +140,12 @@ bool KBlacklistWorker::isBlacklisted(const QString& host) return false; // KDE4: QLatin1String - QString ascii = QString::fromLatin1(KResolver::domainToAscii(host)); + TQString ascii = TQString::fromLatin1(KResolver::domainToAscii(host)); - QMutexLocker locker(&blacklistMutex); + TQMutexLocker locker(&blacklistMutex); // now find out if this hostname is present - QStringList::ConstIterator it = blacklist.constBegin(), + TQStringList::ConstIterator it = blacklist.constBegin(), end = blacklist.constEnd(); for ( ; it != end; ++it) if (ascii.endsWith(*it)) @@ -207,7 +207,7 @@ namespace class GetHostByNameThread: public KResolverWorkerBase { public: - QCString m_hostname; // might be different! + TQCString m_hostname; // might be different! Q_UINT16 m_port; int m_scopeid; int m_af; @@ -251,7 +251,7 @@ namespace // check blacklist if (m_af != AF_INET && - KBlacklistWorker::isBlacklisted(QString::fromLatin1(m_hostname))) + KBlacklistWorker::isBlacklisted(TQString::fromLatin1(m_hostname))) break; # ifdef USE_GETHOSTBYNAME2_R @@ -358,7 +358,7 @@ namespace if (socktype == 0) socktype = SOCK_STREAM; // default - QString canon = KResolver::domainToUnicode(QString::fromLatin1(he->h_name)); + TQString canon = KResolver::domainToUnicode(TQString::fromLatin1(he->h_name)); KInetSocketAddress sa; sa.setPort(m_port); if (he->h_addrtype != AF_INET) @@ -378,8 +378,8 @@ namespace class GetAddrInfoThread: public KResolverWorkerBase { public: - QCString m_node; - QCString m_serv; + TQCString m_node; + TQCString m_serv; int m_af; int m_flags; KResolverResults& results; @@ -404,7 +404,7 @@ namespace { // check blacklist if ((m_af != AF_INET && m_af != AF_UNSPEC) && - KBlacklistWorker::isBlacklisted(QString::fromLatin1(m_node))) + KBlacklistWorker::isBlacklisted(TQString::fromLatin1(m_node))) { results.setError(KResolver::NoName); finished(); @@ -510,7 +510,7 @@ namespace } // if we are here, lookup succeeded - QString canon; + TQString canon; const char *previous_canon = 0L; for (addrinfo* p = result; p; p = p->ai_next) @@ -521,7 +521,7 @@ namespace (p->ai_canonname != previous_canon && strcmp(p->ai_canonname, previous_canon) != 0)) { - canon = KResolver::domainToUnicode(QString::fromAscii(p->ai_canonname)); + canon = KResolver::domainToUnicode(TQString::fromAscii(p->ai_canonname)); previous_canon = p->ai_canonname; } @@ -546,12 +546,12 @@ bool KStandardWorker::sanityCheck() if (!nodeName().isEmpty()) { - QString node = nodeName(); + TQString node = nodeName(); if (node.find('%') != -1) node.truncate(node.find('%')); - if (node.isEmpty() || node == QString::fromLatin1("*") || - node == QString::fromLatin1("localhost")) + if (node.isEmpty() || node == TQString::fromLatin1("*") || + node == TQString::fromLatin1("localhost")) m_encodedName.truncate(0); else { @@ -588,7 +588,7 @@ bool KStandardWorker::resolveScopeId() if (pos == -1) return true; - QString scopename = nodeName().mid(pos + 1); + TQString scopename = nodeName().mid(pos + 1); bool ok; scopeid = scopename.toInt(&ok); @@ -616,12 +616,12 @@ bool KStandardWorker::resolveService() // service name does not contain a port number // must be a name - if (serviceName().isEmpty() || serviceName().compare(QString::fromLatin1("*")) == 0) + if (serviceName().isEmpty() || serviceName().compare(TQString::fromLatin1("*")) == 0) port = 0; else { // it's a name. We need the protocol name in order to lookup. - QCString protoname = protocolName(); + TQCString protoname = protocolName(); if (protoname.isEmpty() && protocol()) { @@ -670,7 +670,7 @@ KResolver::ErrorCodes KStandardWorker::addUnix() if (protocol() || protocolName()) return KResolver::BadFlags; // cannot have Unix sockets with protocols - QString pathname = serviceName(); + TQString pathname = serviceName(); if (pathname.isEmpty()) return KResolver::NoName;; // no path? @@ -712,7 +712,7 @@ bool KStandardWorker::resolveNumerically() // now try to resolve the hostname numerically KInetSocketAddress sa; setError(KResolver::NoError); - sa.setHost(KIpAddress(QString::fromLatin1(m_encodedName))); + sa.setHost(KIpAddress(TQString::fromLatin1(m_encodedName))); // if it failed, the length was reset to 0 bool ok = sa.length() != 0; diff --git a/kdecore/network/kresolverstandardworkers_p.h b/kdecore/network/kresolverstandardworkers_p.h index 30c8f3c1e..310849bf3 100644 --- a/kdecore/network/kresolverstandardworkers_p.h +++ b/kdecore/network/kresolverstandardworkers_p.h @@ -28,9 +28,9 @@ #include <sys/types.h> #include <netdb.h> -#include <qptrlist.h> -#include <qcstring.h> -#include <qstringlist.h> +#include <tqptrlist.h> +#include <tqcstring.h> +#include <tqstringlist.h> #include "kresolver.h" #include "kresolverworkerbase.h" @@ -48,11 +48,11 @@ namespace KNetwork { namespace Internal class KBlacklistWorker: public KNetwork::KResolverWorkerBase { public: - static QStringList blacklist; + static TQStringList blacklist; static void loadBlacklist(); static void init(); - static bool isBlacklisted(const QString&); + static bool isBlacklisted(const TQString&); virtual bool preprocess(); virtual bool run(); @@ -65,10 +65,10 @@ namespace KNetwork { namespace Internal class KStandardWorker: public KNetwork::KResolverWorkerBase { protected: - mutable QCString m_encodedName; + mutable TQCString m_encodedName; Q_UINT16 port; int scopeid; - QPtrList<KNetwork::KResolverResults> resultList; + TQPtrList<KNetwork::KResolverResults> resultList; public: bool sanityCheck(); diff --git a/kdecore/network/kresolverworkerbase.cpp b/kdecore/network/kresolverworkerbase.cpp index 5d8cdaa9b..ee6ee1011 100644 --- a/kdecore/network/kresolverworkerbase.cpp +++ b/kdecore/network/kresolverworkerbase.cpp @@ -26,8 +26,8 @@ #include <assert.h> -#include <qcstring.h> -#include <qstring.h> +#include <tqcstring.h> +#include <tqstring.h> #include "kresolver.h" #include "kresolver_p.h" @@ -45,18 +45,18 @@ KResolverWorkerBase::~KResolverWorkerBase() { } -QString KResolverWorkerBase::nodeName() const +TQString KResolverWorkerBase::nodeName() const { if (input) return input->node; - return QString::null; + return TQString::null; } -QString KResolverWorkerBase::serviceName() const +TQString KResolverWorkerBase::serviceName() const { if (input) return input->service; - return QString::null; + return TQString::null; } int KResolverWorkerBase::flags() const @@ -87,9 +87,9 @@ int KResolverWorkerBase::protocol() const return 0; } -QCString KResolverWorkerBase::protocolName() const +TQCString KResolverWorkerBase::protocolName() const { - QCString res; + TQCString res; if (input) res = input->protocolName; return res; diff --git a/kdecore/network/kresolverworkerbase.h b/kdecore/network/kresolverworkerbase.h index 8776e9142..9c2728cdf 100644 --- a/kdecore/network/kresolverworkerbase.h +++ b/kdecore/network/kresolverworkerbase.h @@ -63,7 +63,7 @@ public: /** * Helper class for locking the resolver subsystem. - * Similar to QMutexLocker. + * Similar to TQMutexLocker. * * @author LuÃs Pedro Coelho * @since 3.4 @@ -134,12 +134,12 @@ public: /** * This is the hostname to be looked for */ - QString nodeName() const; + TQString nodeName() const; /** * And this is the service name */ - QString serviceName() const; + TQString serviceName() const; /** * gets the flags @@ -164,7 +164,7 @@ public: /** * gets the protocol name, if applicable */ - QCString protocolName() const; + TQCString protocolName() const; /** * Call this function to indicate that processing diff --git a/kdecore/network/kreverseresolver.cpp b/kdecore/network/kreverseresolver.cpp index dbcc23d79..639f6dbe4 100644 --- a/kdecore/network/kreverseresolver.cpp +++ b/kdecore/network/kreverseresolver.cpp @@ -31,9 +31,9 @@ #include <signal.h> // Qt -#include <qevent.h> -#include <qmutex.h> -#include <qapplication.h> +#include <tqevent.h> +#include <tqmutex.h> +#include <tqapplication.h> // Us #include "kreverseresolver.h" @@ -73,22 +73,22 @@ namespace KReverseResolver *m_parent; // output: - QString node; - QString service; + TQString node; + TQString service; bool success; }; class KReverseResolverEvent: public QEvent { public: - static const int myType = QEvent::User + 63; // arbitrary value - QString node; - QString service; + static const int myType = TQEvent::User + 63; // arbitrary value + TQString node; + TQString service; bool success; - KReverseResolverEvent(const QString& _node, const QString& _service, + KReverseResolverEvent(const TQString& _node, const TQString& _service, bool _success) - : QEvent((Type)myType), node(_node), + : TQEvent((Type)myType), node(_node), service(_service), success(_success) { } }; @@ -97,8 +97,8 @@ namespace class KNetwork::KReverseResolverPrivate { public: - QString node; - QString service; + TQString node; + TQString service; KSocketAddress addr; int flags; @@ -111,8 +111,8 @@ public: }; KReverseResolver::KReverseResolver(const KSocketAddress& addr, int flags, - QObject *parent, const char* name) - : QObject(parent, name), d(new KReverseResolverPrivate(addr)) + TQObject *parent, const char* name) + : TQObject(parent, name), d(new KReverseResolverPrivate(addr)) { d->flags = flags; } @@ -138,12 +138,12 @@ bool KReverseResolver::failure() const return !isRunning() && !d->success; } -QString KReverseResolver::node() const +TQString KReverseResolver::node() const { return d->node; } -QString KReverseResolver::service() const +TQString KReverseResolver::service() const { return d->service; } @@ -170,10 +170,10 @@ bool KReverseResolver::start() return true; } -bool KReverseResolver::event(QEvent *e) +bool KReverseResolver::event(TQEvent *e) { if (e->type() != KReverseResolverEvent::myType) - return QObject::event(e); // call parent + return TQObject::event(e); // call parent KReverseResolverEvent *re = static_cast<KReverseResolverEvent*>(e); d->node = re->node; @@ -190,8 +190,8 @@ bool KReverseResolver::event(QEvent *e) return true; } -bool KReverseResolver::resolve(const KSocketAddress& addr, QString& node, - QString& serv, int flags) +bool KReverseResolver::resolve(const KSocketAddress& addr, TQString& node, + TQString& serv, int flags) { ReverseThread th(addr, flags); if (th.run()) @@ -204,7 +204,7 @@ bool KReverseResolver::resolve(const KSocketAddress& addr, QString& node, } bool KReverseResolver::resolve(const struct sockaddr* sa, Q_UINT16 salen, - QString& node, QString& serv, int flags) + TQString& node, TQString& serv, int flags) { return resolve(KSocketAddress(sa, salen), node, serv, flags); } @@ -230,7 +230,7 @@ bool ReverseThread::run() { #ifdef NEED_MUTEX - QMutexLocker locker(&::getXXbyYYmutex); + TQMutexLocker locker(&::getXXbyYYmutex); #endif err = ::getnameinfo(m_addr, m_addr.length(), h, sizeof(h) - 1, s, sizeof(s) - 1, niflags); @@ -238,13 +238,13 @@ bool ReverseThread::run() if (err == 0) { - node = KResolver::domainToUnicode(QString::fromLatin1(h)); - service = QString::fromLatin1(s); + node = KResolver::domainToUnicode(TQString::fromLatin1(h)); + service = TQString::fromLatin1(s); success = true; } else { - node = service = QString::null; + node = service = TQString::null; success = false; } @@ -255,7 +255,7 @@ bool ReverseThread::postprocess() { // post an event if (m_parent) - QApplication::postEvent(m_parent, + TQApplication::postEvent(m_parent, new KReverseResolverEvent(node, service, success)); return true; } diff --git a/kdecore/network/kreverseresolver.h b/kdecore/network/kreverseresolver.h index 325d97d82..26274e586 100644 --- a/kdecore/network/kreverseresolver.h +++ b/kdecore/network/kreverseresolver.h @@ -27,8 +27,8 @@ ////////////////// // Needed includes -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include "ksocketaddress.h" @@ -88,7 +88,7 @@ public: * @param flags the flags to use, see @ref Flags */ KReverseResolver(const KSocketAddress& addr, int flags = 0, - QObject * = 0L, const char * = 0L); + TQObject * = 0L, const char * = 0L); /** * Destructor. @@ -114,15 +114,15 @@ public: /** * Returns the resolved node name, if the resolution has finished - * successfully, or QString::null otherwise. + * successfully, or TQString::null otherwise. */ - QString node() const; + TQString node() const; /** * Returns the resolved service name, if the resolution has finished - * successfully, or QString::null otherwise. + * successfully, or TQString::null otherwise. */ - QString service() const; + TQString service() const; /** * Returns the socket address which was subject to resolution. @@ -138,7 +138,7 @@ public: /** * Overrides event handling */ - virtual bool event(QEvent* ); + virtual bool event(TQEvent* ); signals: /** @@ -158,14 +158,14 @@ public: * binary representation to a textual form, even if numeric only. * * @param addr the socket address to be resolved - * @param node the QString where we will store the resolved node - * @param serv the QString where we will store the resolved service + * @param node the TQString where we will store the resolved node + * @param serv the TQString where we will store the resolved service * @param flags flags to be used for this resolution. * @return true if the resolution succeeded, false if not * @see ReverseFlags for the possible values for @p flags */ - static bool resolve(const KSocketAddress& addr, QString& node, - QString& serv, int flags = 0); + static bool resolve(const KSocketAddress& addr, TQString& node, + TQString& serv, int flags = 0); /** * Resolves a socket address to its textual representation @@ -177,14 +177,14 @@ public: * * @param sa the sockaddr structure containing the address to be resolved * @param salen the length of the sockaddr structure - * @param node the QString where we will store the resolved node - * @param serv the QString where we will store the resolved service + * @param node the TQString where we will store the resolved node + * @param serv the TQString where we will store the resolved service * @param flags flags to be used for this resolution. * @return true if the resolution succeeded, false if not * @see ReverseFlags for the possible values for @p flags */ static bool resolve(const struct sockaddr* sa, Q_UINT16 salen, - QString& node, QString& serv, int flags = 0); + TQString& node, TQString& serv, int flags = 0); private: KReverseResolverPrivate* d; diff --git a/kdecore/network/kserversocket.cpp b/kdecore/network/kserversocket.cpp index 9f32b4119..49facb12c 100644 --- a/kdecore/network/kserversocket.cpp +++ b/kdecore/network/kserversocket.cpp @@ -24,8 +24,8 @@ #include <config.h> -#include <qsocketnotifier.h> -#include <qmutex.h> +#include <tqsocketnotifier.h> +#include <tqmutex.h> #include "ksocketaddress.h" #include "kresolver.h" @@ -58,27 +58,27 @@ public: } }; -KServerSocket::KServerSocket(QObject* parent, const char *name) - : QObject(parent, name), d(new KServerSocketPrivate) +KServerSocket::KServerSocket(TQObject* parent, const char *name) + : TQObject(parent, name), d(new KServerSocketPrivate) { - QObject::connect(&d->resolver, SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedSlot())); + TQObject::connect(&d->resolver, TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedSlot())); } -KServerSocket::KServerSocket(const QString& service, QObject* parent, const char *name) - : QObject(parent, name), d(new KServerSocketPrivate) +KServerSocket::KServerSocket(const TQString& service, TQObject* parent, const char *name) + : TQObject(parent, name), d(new KServerSocketPrivate) { - QObject::connect(&d->resolver, SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedSlot())); + TQObject::connect(&d->resolver, TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedSlot())); d->resolver.setServiceName(service); } -KServerSocket::KServerSocket(const QString& node, const QString& service, - QObject* parent, const char* name) - : QObject(parent, name), d(new KServerSocketPrivate) +KServerSocket::KServerSocket(const TQString& node, const TQString& service, + TQObject* parent, const char* name) + : TQObject(parent, name), d(new KServerSocketPrivate) { - QObject::connect(&d->resolver, SIGNAL(finished(KResolverResults)), - this, SLOT(lookupFinishedSlot())); + TQObject::connect(&d->resolver, TQT_SIGNAL(finished(KResolverResults)), + this, TQT_SLOT(lookupFinishedSlot())); setAddress(node, service); } @@ -90,7 +90,7 @@ KServerSocket::~KServerSocket() bool KServerSocket::setSocketOptions(int opts) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); KSocketBase::setSocketOptions(opts); // call parent bool result = socketDevice()->setSocketOptions(opts); // and set the implementation copyError(); @@ -120,16 +120,16 @@ void KServerSocket::setFamily(int families) d->resolver.setFamily(families); } -void KServerSocket::setAddress(const QString& service) +void KServerSocket::setAddress(const TQString& service) { - d->resolver.setNodeName(QString::null); + d->resolver.setNodeName(TQString::null); d->resolver.setServiceName(service); d->resolverResults.empty(); if (d->state <= KServerSocketPrivate::LookupDone) d->state = KServerSocketPrivate::None; } -void KServerSocket::setAddress(const QString& node, const QString& service) +void KServerSocket::setAddress(const TQString& node, const TQString& service) { d->resolver.setNodeName(node); d->resolver.setServiceName(service); @@ -155,7 +155,7 @@ bool KServerSocket::lookup() // make sure we have at least one parameter for lookup if (d->resolver.serviceName().isNull() && !d->resolver.nodeName().isNull()) - d->resolver.setServiceName(QString::fromLatin1("")); + d->resolver.setServiceName(TQString::fromLatin1("")); // don't restart the lookups if they had succeeded and // the input values weren't changed @@ -193,13 +193,13 @@ bool KServerSocket::bind(const KResolverEntry& address) return false; } -bool KServerSocket::bind(const QString& node, const QString& service) +bool KServerSocket::bind(const TQString& node, const TQString& service) { setAddress(node, service); return bind(); } -bool KServerSocket::bind(const QString& service) +bool KServerSocket::bind(const TQString& service) { setAddress(service); return bind(); @@ -403,8 +403,8 @@ bool KServerSocket::doListen() } // set up ready accept signal - QObject::connect(socketDevice()->readNotifier(), SIGNAL(activated(int)), - this, SIGNAL(readyAccept())); + TQObject::connect(socketDevice()->readNotifier(), TQT_SIGNAL(activated(int)), + this, TQT_SIGNAL(readyAccept())); d->state = KServerSocketPrivate::Listening; return true; } diff --git a/kdecore/network/kserversocket.h b/kdecore/network/kserversocket.h index 27b3df1cc..30d8b40b0 100644 --- a/kdecore/network/kserversocket.h +++ b/kdecore/network/kserversocket.h @@ -25,7 +25,7 @@ #ifndef KSERVERSOCKET_H #define KSERVERSOCKET_H -#include <qobject.h> +#include <tqobject.h> #include "ksocketbase.h" namespace KNetwork { @@ -48,10 +48,10 @@ class KServerSocketPrivate; * * A typical example would look like: * \code - * QString service = "http"; + * TQString service = "http"; * KServerSocket *ss = new KServerSocket(service); - * connect(ss, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept())); - * connect(ss, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int))); + * connect(ss, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotReadyAccept())); + * connect(ss, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int))); * ss->listen(); * \endcode * @@ -74,7 +74,7 @@ class KServerSocketPrivate; * ss->setFamily(KResolver::InetFamily); * bool found = false; * for( unsigned int port = firstport; port <= lastport; ++port) { - * ss->setAddress( QString::number( port ) ); + * ss->setAddress( TQString::number( port ) ); * bool success = ss->listen(); * if( found = ( success && ss->error() == * KSocketBase::NoError ) ) @@ -84,8 +84,8 @@ class KServerSocketPrivate; * if( !found ) { * // Couldn't connect to any port. * } else { - * connect(ss, SIGNAL(readyAccept()), this, SLOT(slotReadyAccept())); - * connect(ss, SIGNAL(gotError(int)), this, SLOT(slotSocketError(int))); + * connect(ss, TQT_SIGNAL(readyAccept()), this, TQT_SLOT(slotReadyAccept())); + * connect(ss, TQT_SIGNAL(gotError(int)), this, TQT_SLOT(slotSocketError(int))); * ss->listen(); * } * \endcode @@ -104,7 +104,7 @@ class KServerSocketPrivate; * @see KNetwork::KStreamSocket, KNetwork::KBufferedSocket * @author Thiago Macieira <thiago@kde.org> */ -class KDECORE_EXPORT KServerSocket: public QObject, public KPassiveSocketBase +class KDECORE_EXPORT KServerSocket: public TQObject, public KPassiveSocketBase { Q_OBJECT public: @@ -115,10 +115,10 @@ public: * bind to all interfaces on this node and the port will be selected by the * operating system. * - * @param parent the parent QObject object + * @param parent the parent TQObject object * @param name the name of this object */ - KServerSocket(QObject* parent = 0L, const char *name = 0L); + KServerSocket(TQObject* parent = 0L, const char *name = 0L); /** * Construct this object specifying the service to listen on. @@ -134,10 +134,10 @@ public: * See RFC 1700 for more information on services. * * @param service the service name to listen on - * @param parent the parent QObject object + * @param parent the parent TQObject object * @param name the name of this object */ - KServerSocket(const QString& service, QObject* parent = 0L, const char *name = 0L); + KServerSocket(const TQString& service, TQObject* parent = 0L, const char *name = 0L); /** * Construct this object specifying the node and service names to listen on. @@ -154,11 +154,11 @@ public: * * @param node the node to bind to * @param service the service port to listen on - * @param parent the parent QObject object + * @param parent the parent TQObject object * @param name the name of this object */ - KServerSocket(const QString& node, const QString& service, - QObject* parent = 0L, const char *name = 0L); + KServerSocket(const TQString& node, const TQString& service, + TQObject* parent = 0L, const char *name = 0L); /** * Destructor. This will close the socket, if open. @@ -227,7 +227,7 @@ public: * * @param service the service name to listen on */ - void setAddress(const QString& service); + void setAddress(const TQString& service); /** * @overload @@ -244,7 +244,7 @@ public: * @param node the node to bind to * @param service the service port to listen on */ - void setAddress(const QString& node, const QString& service); + void setAddress(const TQString& node, const TQString& service); /** * Sets the timeout for accepting. When you call @ref accept, @@ -287,7 +287,7 @@ public: * @param node the nodename * @param service the service */ - virtual bool bind(const QString& node, const QString& service); + virtual bool bind(const TQString& node, const TQString& service); /** * Binds the socket to the given service name. @@ -295,7 +295,7 @@ public: * * @param service the service */ - virtual bool bind(const QString& service); + virtual bool bind(const TQString& service); /** * Binds the socket to the addresses previously set with @ref setAddress. @@ -307,7 +307,7 @@ public: /** * Connect this socket to this specific address. Reimplemented from KSocketBase. * - * Unlike @ref bind(const QString&, const QString&) above, this function + * Unlike @ref bind(const TQString&, const TQString&) above, this function * really does bind the socket. No lookup is performed. The @ref bound signal * will be emitted. */ diff --git a/kdecore/network/ksocketaddress.cpp b/kdecore/network/ksocketaddress.cpp index 6c1316e94..adfc76b06 100644 --- a/kdecore/network/ksocketaddress.cpp +++ b/kdecore/network/ksocketaddress.cpp @@ -33,8 +33,8 @@ #include <stdlib.h> #include <unistd.h> -#include <qfile.h> -#include <qobject.h> +#include <tqfile.h> +#include <tqobject.h> #include "klocale.h" #include "ksocketaddress.h" @@ -126,7 +126,7 @@ bool KIpAddress::compare(const KIpAddress& other, bool checkMapped) const } // sets the address to the given address -bool KIpAddress::setAddress(const QString& address) +bool KIpAddress::setAddress(const TQString& address) { m_version = 0; @@ -165,7 +165,7 @@ bool KIpAddress::setAddress(const QString& address) bool KIpAddress::setAddress(const char* address) { - return setAddress(QString::fromLatin1(address)); + return setAddress(TQString::fromLatin1(address)); } // set from binary data @@ -186,7 +186,7 @@ bool KIpAddress::setAddress(const void* raw, int version) } // presentation form -QString KIpAddress::toString() const +TQString KIpAddress::toString() const { char buf[sizeof "1111:2222:3333:4444:5555:6666:255.255.255.255" + 2]; buf[0] = '\0'; @@ -194,16 +194,16 @@ QString KIpAddress::toString() const { case 4: inet_ntop(AF_INET, m_data, buf, sizeof(buf) - 1); - return QString::fromLatin1(buf); + return TQString::fromLatin1(buf); case 6: #ifdef AF_INET6 inet_ntop(AF_INET6, m_data, buf, sizeof(buf) - 1); #endif - return QString::fromLatin1(buf); + return TQString::fromLatin1(buf); } - return QString::null; + return TQString::null; } Q_UINT32 KIpAddress::hostIPv4Addr(bool convertMapped) const @@ -559,10 +559,10 @@ bool KSocketAddress::operator ==(const KSocketAddress& other) const return false; // not equal in any other case } -QString KSocketAddress::nodeName() const +TQString KSocketAddress::nodeName() const { if (d->invalid()) - return QString::null; + return TQString::null; switch (d->addr.generic->sa_family) { @@ -570,9 +570,9 @@ QString KSocketAddress::nodeName() const #ifdef AF_INET6 case AF_INET6: - QString scopeid("%"); + TQString scopeid("%"); if (d->addr.generic->sa_family == AF_INET6 && d->addr.in6->sin6_scope_id) - scopeid += QString::number(d->addr.in6->sin6_scope_id); + scopeid += TQString::number(d->addr.in6->sin6_scope_id); else scopeid.truncate(0); return d->ref.ipAddress().toString() + scopeid; @@ -582,13 +582,13 @@ QString KSocketAddress::nodeName() const } // any other case, including AF_UNIX - return QString::null; + return TQString::null; } -QString KSocketAddress::serviceName() const +TQString KSocketAddress::serviceName() const { if (d->invalid()) - return QString::null; + return TQString::null; switch (d->addr.generic->sa_family) { @@ -596,21 +596,21 @@ QString KSocketAddress::serviceName() const #ifdef AF_INET6 case AF_INET6: #endif - return QString::number(d->ref.port()); + return TQString::number(d->ref.port()); case AF_UNIX: return d->ref.pathname(); } - return QString::null; + return TQString::null; } -QString KSocketAddress::toString() const +TQString KSocketAddress::toString() const { if (d->invalid()) - return QString::null; + return TQString::null; - QString fmt; + TQString fmt; if (d->addr.generic->sa_family == AF_INET) fmt = "%1:%2"; @@ -619,7 +619,7 @@ QString KSocketAddress::toString() const fmt = "[%1]:%2"; #endif else if (d->addr.generic->sa_family == AF_UNIX) - return QString::fromLatin1("unix:%1").arg(serviceName()); + return TQString::fromLatin1("unix:%1").arg(serviceName()); else return i18n("1: the unknown socket address family number", "Unknown family %1").arg(d->addr.generic->sa_family); @@ -916,7 +916,7 @@ KUnixSocketAddress::KUnixSocketAddress(const KUnixSocketAddress& other) { } -KUnixSocketAddress::KUnixSocketAddress(const QString& pathname) +KUnixSocketAddress::KUnixSocketAddress(const TQString& pathname) { setPathname(pathname); } @@ -936,18 +936,18 @@ KUnixSocketAddress& KUnixSocketAddress::operator =(const KUnixSocketAddress& oth return *this; } -QString KUnixSocketAddress::pathname() const +TQString KUnixSocketAddress::pathname() const { if (!d->invalid() && d->addr.un->sun_family == AF_UNIX) - return QFile::decodeName(d->addr.un->sun_path); - return QString::null; + return TQFile::decodeName(d->addr.un->sun_path); + return TQString::null; } -KUnixSocketAddress& KUnixSocketAddress::setPathname(const QString& path) +KUnixSocketAddress& KUnixSocketAddress::setPathname(const TQString& path) { d->dup(0L, MIN_SOCKADDR_UN_LEN + path.length()); d->addr.un->sun_family = AF_UNIX; - strcpy(d->addr.un->sun_path, QFile::encodeName(path)); + strcpy(d->addr.un->sun_path, TQFile::encodeName(path)); #ifdef HAVE_STRUCT_SOCKADDR_SA_LEN d->addr.un->sun_len = d->reallen; diff --git a/kdecore/network/ksocketaddress.h b/kdecore/network/ksocketaddress.h index 456422f9f..6889527e3 100644 --- a/kdecore/network/ksocketaddress.h +++ b/kdecore/network/ksocketaddress.h @@ -25,8 +25,8 @@ #ifndef KSOCKETADDRESS_H #define KSOCKETADDRESS_H -#include <qstring.h> -#include <qcstring.h> +#include <tqstring.h> +#include <tqcstring.h> #include <kdelibs_export.h> @@ -87,7 +87,7 @@ public: * * @param addr the address */ - inline KIpAddress(const QString& addr) + inline KIpAddress(const TQString& addr) { setAddress(addr); } /** @@ -189,7 +189,7 @@ public: * @return true if the address was successfully parsed; otherwise returns * false and leaves the object unchanged. */ - bool setAddress(const QString& address); + bool setAddress(const TQString& address); /** * Sets the address to the given string representation. @@ -212,7 +212,7 @@ public: /** * Returns the address as a string. */ - QString toString() const; + TQString toString() const; /** * Returns a pointer to binary raw data representing the address. @@ -564,23 +564,23 @@ public: * Returns the node name of this socket. * * In the case of Internet sockets, this is string representation of the IP address. - * The default implementation returns QString::null. + * The default implementation returns TQString::null. * - * @return the node name, can be QString::null + * @return the node name, can be TQString::null * @bug use KResolver to resolve unknown families */ - virtual QString nodeName() const; + virtual TQString nodeName() const; /** * Returns the service name for this socket. * * In the case of Internet sockets, this is the port number. - * The default implementation returns QString::null. + * The default implementation returns TQString::null. * - * @return the service name, can be QString::null + * @return the service name, can be TQString::null * @bug use KResolver to resolve unknown families */ - virtual QString serviceName() const; + virtual TQString serviceName() const; /** * Returns this socket address as a string suitable for @@ -588,7 +588,7 @@ public: * * @bug use KResolver to resolve unknown families */ - virtual QString toString() const; + virtual TQString toString() const; /** * Returns an object reference that can be used to manipulate this socket @@ -867,7 +867,7 @@ public: /** * Constructs an object from the given pathname. */ - KUnixSocketAddress(const QString& pathname); + KUnixSocketAddress(const TQString& pathname); /** * Destructor. @@ -890,16 +890,16 @@ public: /** * Returns the pathname associated with this object. Will return - * QString::null if this object is empty. + * TQString::null if this object is empty. */ - QString pathname() const; + TQString pathname() const; /** * Sets the pathname for the object. * * @return a reference to itself */ - KUnixSocketAddress& setPathname(const QString& path); + KUnixSocketAddress& setPathname(const TQString& path); protected: /// @internal diff --git a/kdecore/network/ksocketbase.cpp b/kdecore/network/ksocketbase.cpp index f3bfa766c..9071eea0e 100644 --- a/kdecore/network/ksocketbase.cpp +++ b/kdecore/network/ksocketbase.cpp @@ -23,7 +23,7 @@ */ #include <config.h> -#include <qmutex.h> +#include <tqmutex.h> #include "klocale.h" #include "ksocketbase.h" @@ -40,7 +40,7 @@ public: mutable KSocketDevice* device; - QMutex mutex; + TQMutex mutex; KSocketBasePrivate() : mutex(true) // create recursive @@ -119,7 +119,7 @@ KSocketDevice* KSocketBase::socketDevice() const return d->device; // it doesn't exist, so create it - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (d->device) return d->device; @@ -135,7 +135,7 @@ KSocketDevice* KSocketBase::socketDevice() const void KSocketBase::setSocketDevice(KSocketDevice* device) { - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (d->device == 0L) d->device = device; } @@ -163,9 +163,9 @@ KSocketBase::SocketError KSocketBase::error() const } // static -QString KSocketBase::errorString(KSocketBase::SocketError code) +TQString KSocketBase::errorString(KSocketBase::SocketError code) { - QString reason; + TQString reason; switch (code) { case NoError: @@ -248,7 +248,7 @@ QString KSocketBase::errorString(KSocketBase::SocketError code) break; default: - reason = QString::null; + reason = TQString::null; break; } @@ -275,7 +275,7 @@ void KSocketBase::unsetSocketDevice() d->device = 0L; } -QMutex* KSocketBase::mutex() const +TQMutex* KSocketBase::mutex() const { return &d->mutex; } diff --git a/kdecore/network/ksocketbase.h b/kdecore/network/ksocketbase.h index acbbdf9b9..e416c8e93 100644 --- a/kdecore/network/ksocketbase.h +++ b/kdecore/network/ksocketbase.h @@ -56,8 +56,8 @@ #ifndef KSOCKETBASE_H #define KSOCKETBASE_H -#include <qiodevice.h> -#include <qstring.h> +#include <tqiodevice.h> +#include <tqstring.h> #include "ksocketaddress.h" #include <kdelibs_export.h> @@ -65,7 +65,7 @@ /* * This is extending QIODevice's error codes * - * According to qiodevice.h, the last error is IO_UnspecifiedError + * According to tqiodevice.h, the last error is IO_UnspecifiedError * These errors will never occur in functions declared in QIODevice * (except open, but you shouldn't call open) */ @@ -380,7 +380,7 @@ public: /** * Returns the error string corresponding to this error condition. */ - inline QString errorString() const + inline TQString errorString() const { return errorString(error()); } /** @@ -398,7 +398,7 @@ public: * while destroying it. You must ensure there are no further references to this * object when deleting it. */ - QMutex* mutex() const; + TQMutex* mutex() const; public: /** @@ -406,7 +406,7 @@ public: * * @param code the error code */ - static QString errorString(SocketError code); + static TQString errorString(SocketError code); /** * Returns true if the given error code is a fatal one, false @@ -440,7 +440,7 @@ private: * * @author Thiago Macieira <thiago.macieira@kdemail.net> */ -class KDECORE_EXPORT KActiveSocketBase: public QIODevice, virtual public KSocketBase +class KDECORE_EXPORT KActiveSocketBase: public TQIODevice, virtual public KSocketBase { public: /** @@ -501,28 +501,28 @@ public: virtual bool disconnect() = 0; /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. * This will always return 0. */ virtual Offset size() const { return 0; } /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. * This will always return 0. */ virtual Offset at() const { return 0; } /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. * This will always return false. */ virtual bool at(Offset) { return false; } /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. * This will always return true. */ virtual bool atEnd() const @@ -550,7 +550,7 @@ public: /** * Reads data from the socket. * - * Reimplemented from QIODevice. See QIODevice::readBlock for + * Reimplemented from TQIODevice. See TQIODevice::readBlock for * more information. */ virtual Q_LONG readBlock(char *data, Q_ULONG len) = 0; @@ -598,7 +598,7 @@ public: /** * Writes the given data to the socket. * - * Reimplemented from QIODevice. See QIODevice::writeBlock for + * Reimplemented from TQIODevice. See TQIODevice::writeBlock for * more information. */ virtual Q_LONG writeBlock(const char *data, Q_ULONG len) = 0; @@ -618,18 +618,18 @@ public: /** * Reads one character from the socket. - * Reimplementation from QIODevice. See QIODevice::getch for more information. + * Reimplementation from TQIODevice. See TQIODevice::getch for more information. */ virtual int getch(); /** * Writes one character to the socket. - * Reimplementation from QIODevice. See QIODevice::putch for more information. + * Reimplementation from TQIODevice. See TQIODevice::putch for more information. */ virtual int putch(int ch); /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. * This will always return -1; */ virtual int ungetch(int) diff --git a/kdecore/network/ksocketbuffer.cpp b/kdecore/network/ksocketbuffer.cpp index d458a4f15..18c926c83 100644 --- a/kdecore/network/ksocketbuffer.cpp +++ b/kdecore/network/ksocketbuffer.cpp @@ -46,13 +46,13 @@ KSocketBuffer::KSocketBuffer(const KSocketBuffer& other) KSocketBuffer::~KSocketBuffer() { - // QValueList takes care of deallocating memory + // TQValueList takes care of deallocating memory } KSocketBuffer& KSocketBuffer::operator=(const KSocketBuffer& other) { - QMutexLocker locker1(&m_mutex); - QMutexLocker locker2(&other.m_mutex); + TQMutexLocker locker1(&m_mutex); + TQMutexLocker locker2(&other.m_mutex); KIOBufferBase::operator=(other); @@ -66,11 +66,11 @@ KSocketBuffer& KSocketBuffer::operator=(const KSocketBuffer& other) bool KSocketBuffer::canReadLine() const { - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); - QValueListConstIterator<QByteArray> it = m_list.constBegin(), + TQValueListConstIterator<TQByteArray> it = m_list.constBegin(), end = m_list.constEnd(); - QIODevice::Offset offset = m_offset; + TQIODevice::Offset offset = m_offset; // walk the buffer for ( ; it != end; ++it) @@ -85,18 +85,18 @@ bool KSocketBuffer::canReadLine() const return false; // not found } -QCString KSocketBuffer::readLine() +TQCString KSocketBuffer::readLine() { if (!canReadLine()) - return QCString(); // empty + return TQCString(); // empty - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); // find the offset of the newline in the buffer int newline = 0; - QValueListConstIterator<QByteArray> it = m_list.constBegin(), + TQValueListConstIterator<TQByteArray> it = m_list.constBegin(), end = m_list.constEnd(); - QIODevice::Offset offset = m_offset; + TQIODevice::Offset offset = m_offset; // walk the buffer for ( ; it != end; ++it) @@ -115,7 +115,7 @@ QCString KSocketBuffer::readLine() break; } - QCString result(newline + 2 - m_offset); + TQCString result(newline + 2 - m_offset); consumeBuffer(result.data(), newline + 1 - m_offset); return result; } @@ -137,7 +137,7 @@ bool KSocketBuffer::setSize(Q_LONG size) return true; // size is now smaller than length - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); // repeat the test if (m_length < m_size) @@ -154,13 +154,13 @@ Q_LONG KSocketBuffer::feedBuffer(const char *data, Q_LONG len) if (isFull()) return -1; // can't write - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); // verify if we can add len bytes if (m_size != -1 && (m_size - m_length) < len) len = m_size - m_length; - QByteArray a(len); + TQByteArray a(len); a.duplicate(data, len); m_list.append(a); @@ -173,9 +173,9 @@ Q_LONG KSocketBuffer::consumeBuffer(char *destbuffer, Q_LONG maxlen, bool discar if (maxlen == 0 || isEmpty()) return 0; - QValueListIterator<QByteArray> it = m_list.begin(), + TQValueListIterator<TQByteArray> it = m_list.begin(), end = m_list.end(); - QIODevice::Offset offset = m_offset; + TQIODevice::Offset offset = m_offset; Q_LONG copied = 0; // walk the buffer @@ -222,7 +222,7 @@ Q_LONG KSocketBuffer::consumeBuffer(char *destbuffer, Q_LONG maxlen, bool discar void KSocketBuffer::clear() { - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); m_list.clear(); m_offset = 0; m_length = 0; @@ -233,11 +233,11 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) if (len == 0 || isEmpty()) return 0; - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); - QValueListIterator<QByteArray> it = m_list.begin(), + TQValueListIterator<TQByteArray> it = m_list.begin(), end = m_list.end(); - QIODevice::Offset offset = m_offset; + TQIODevice::Offset offset = m_offset; Q_LONG written = 0; // walk the buffer @@ -251,7 +251,7 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) Q_ULONG bufsize = 1460; if (len != -1 && len < bufsize) bufsize = len; - QByteArray buf(bufsize); + TQByteArray buf(bufsize); Q_LONG count = 0; while (it != end && count + ((*it).size() - offset) <= bufsize) @@ -298,7 +298,7 @@ Q_LONG KSocketBuffer::receiveFrom(KActiveSocketBase* dev, Q_LONG len) if (len == 0 || isFull()) return 0; - QMutexLocker locker(&m_mutex); + TQMutexLocker locker(&m_mutex); if (len == -1) len = dev->bytesAvailable(); @@ -313,7 +313,7 @@ Q_LONG KSocketBuffer::receiveFrom(KActiveSocketBase* dev, Q_LONG len) // here, len contains just as many bytes as we're supposed to read // now do the reading - QByteArray a(len); + TQByteArray a(len); len = dev->readBlock(a.data(), len); if (len == -1) diff --git a/kdecore/network/ksocketbuffer_p.h b/kdecore/network/ksocketbuffer_p.h index ddcc692bd..a4a0d6a9e 100644 --- a/kdecore/network/ksocketbuffer_p.h +++ b/kdecore/network/ksocketbuffer_p.h @@ -25,9 +25,9 @@ #ifndef KSOCKETBUFFER_P_H #define KSOCKETBUFFER_P_H -#include <qmutex.h> -#include <qcstring.h> -#include <qvaluelist.h> +#include <tqmutex.h> +#include <tqcstring.h> +#include <tqvaluelist.h> #include "kiobuffer.h" namespace KNetwork { @@ -78,7 +78,7 @@ public: /** * Reads a line from the buffer and discard it from the buffer. */ - virtual QCString readLine(); + virtual TQCString readLine(); /** * Returns the number of bytes in the buffer. Note that this is not @@ -151,9 +151,9 @@ public: virtual Q_LONG receiveFrom(KActiveSocketBase* device, Q_LONG len = -1); protected: - mutable QMutex m_mutex; - QValueList<QByteArray> m_list; - QIODevice::Offset m_offset; ///< offset of the start of data in the first element + mutable TQMutex m_mutex; + TQValueList<TQByteArray> m_list; + TQIODevice::Offset m_offset; ///< offset of the start of data in the first element Q_LONG m_size; ///< the maximum length of the buffer mutable Q_LONG m_length; diff --git a/kdecore/network/ksocketdevice.cpp b/kdecore/network/ksocketdevice.cpp index b3004ccc2..2885efdb3 100644 --- a/kdecore/network/ksocketdevice.cpp +++ b/kdecore/network/ksocketdevice.cpp @@ -24,7 +24,7 @@ #include <config.h> -#include <qmap.h> +#include <tqmap.h> #ifdef USE_SOLARIS # include <sys/filio.h> @@ -49,8 +49,8 @@ // Include syssocket before our local includes #include "syssocket.h" -#include <qmutex.h> -#include <qsocketnotifier.h> +#include <tqmutex.h> +#include <tqsocketnotifier.h> #include "kresolver.h" #include "ksocketaddress.h" @@ -63,7 +63,7 @@ using namespace KNetwork; class KNetwork::KSocketDevicePrivate { public: - mutable QSocketNotifier *input, *output, *exception; + mutable TQSocketNotifier *input, *output, *exception; KSocketAddress local, peer; int af; @@ -110,7 +110,7 @@ KSocketDevice::~KSocketDevice() bool KSocketDevice::setSocketOptions(int opts) { // must call parent - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); KSocketBase::setSocketOptions(opts); if (m_sockfd == -1) @@ -606,12 +606,12 @@ KSocketAddress KSocketDevice::externalAddress() const return localAddress(); } -QSocketNotifier* KSocketDevice::readNotifier() const +TQSocketNotifier* KSocketDevice::readNotifier() const { if (d->input) return d->input; - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (d->input) return d->input; @@ -621,15 +621,15 @@ QSocketNotifier* KSocketDevice::readNotifier() const return 0L; } - return d->input = createNotifier(QSocketNotifier::Read); + return d->input = createNotifier(TQSocketNotifier::Read); } -QSocketNotifier* KSocketDevice::writeNotifier() const +TQSocketNotifier* KSocketDevice::writeNotifier() const { if (d->output) return d->output; - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (d->output) return d->output; @@ -639,15 +639,15 @@ QSocketNotifier* KSocketDevice::writeNotifier() const return 0L; } - return d->output = createNotifier(QSocketNotifier::Write); + return d->output = createNotifier(TQSocketNotifier::Write); } -QSocketNotifier* KSocketDevice::exceptionNotifier() const +TQSocketNotifier* KSocketDevice::exceptionNotifier() const { if (d->exception) return d->exception; - QMutexLocker locker(mutex()); + TQMutexLocker locker(mutex()); if (d->exception) return d->exception; @@ -657,7 +657,7 @@ QSocketNotifier* KSocketDevice::exceptionNotifier() const return 0L; } - return d->exception = createNotifier(QSocketNotifier::Exception); + return d->exception = createNotifier(TQSocketNotifier::Exception); } bool KSocketDevice::poll(bool *input, bool *output, bool *exception, @@ -788,12 +788,12 @@ bool KSocketDevice::poll(int timeout, bool *timedout) return poll(&input, &output, &exception, timeout, timedout); } -QSocketNotifier* KSocketDevice::createNotifier(QSocketNotifier::Type type) const +TQSocketNotifier* KSocketDevice::createNotifier(TQSocketNotifier::Type type) const { if (m_sockfd == -1) return 0L; - return new QSocketNotifier(m_sockfd, type); + return new TQSocketNotifier(m_sockfd, type); } namespace @@ -832,8 +832,8 @@ namespace } static KSocketDeviceFactoryBase* defaultImplFactory; -static QMutex defaultImplFactoryMutex; -typedef QMap<int, KSocketDeviceFactoryBase* > factoryMap; +static TQMutex defaultImplFactoryMutex; +typedef TQMap<int, KSocketDeviceFactoryBase* > factoryMap; static factoryMap factories; KSocketDevice* KSocketDevice::createDefault(KSocketBase* parent) @@ -857,7 +857,7 @@ KSocketDevice* KSocketDevice::createDefault(KSocketBase* parent, int capabilitie if (device != 0L) return device; - QMutexLocker locker(&defaultImplFactoryMutex); + TQMutexLocker locker(&defaultImplFactoryMutex); factoryMap::ConstIterator it = factories.constBegin(); for ( ; it != factories.constEnd(); ++it) if ((it.key() & capabilities) == capabilities) @@ -870,7 +870,7 @@ KSocketDevice* KSocketDevice::createDefault(KSocketBase* parent, int capabilitie KSocketDeviceFactoryBase* KSocketDevice::setDefaultImpl(KSocketDeviceFactoryBase* factory) { - QMutexLocker locker(&defaultImplFactoryMutex); + TQMutexLocker locker(&defaultImplFactoryMutex); KSocketDeviceFactoryBase* old = defaultImplFactory; defaultImplFactory = factory; return old; @@ -878,7 +878,7 @@ KSocketDevice::setDefaultImpl(KSocketDeviceFactoryBase* factory) void KSocketDevice::addNewImpl(KSocketDeviceFactoryBase* factory, int capabilities) { - QMutexLocker locker(&defaultImplFactoryMutex); + TQMutexLocker locker(&defaultImplFactoryMutex); if (factories.contains(capabilities)) delete factories[capabilities]; factories.insert(capabilities, factory); diff --git a/kdecore/network/ksocketdevice.h b/kdecore/network/ksocketdevice.h index 301bc2b07..1bf4771c2 100644 --- a/kdecore/network/ksocketdevice.h +++ b/kdecore/network/ksocketdevice.h @@ -25,7 +25,7 @@ #ifndef KSOCKETDEVICE_H #define KSOCKETDEVICE_H -#include <qsocketnotifier.h> +#include <tqsocketnotifier.h> #include "ksocketbase.h" namespace KNetwork { @@ -140,19 +140,19 @@ public: virtual bool setSocketOptions(int opts); /** - * Reimplementation from QIODevice. You should not call this function in sockets. + * Reimplementation from TQIODevice. You should not call this function in sockets. */ virtual bool open(int mode); /** - * Closes the socket. Reimplemented from QIODevice. + * Closes the socket. Reimplemented from TQIODevice. * * Use this function to close the socket this object is holding open. */ virtual void close(); /** - * This call is not supported on sockets. Reimplemented from QIODevice. + * This call is not supported on sockets. Reimplemented from TQIODevice. */ virtual void flush() { } @@ -272,7 +272,7 @@ public: * * This function might return NULL. */ - QSocketNotifier* readNotifier() const; + TQSocketNotifier* readNotifier() const; /** * Returns a socket notifier for output on this socket. @@ -280,7 +280,7 @@ public: * * This function might return NULL. */ - QSocketNotifier* writeNotifier() const; + TQSocketNotifier* writeNotifier() const; /** * Returns a socket notifier for exceptional events on this socket. @@ -288,7 +288,7 @@ public: * * This function might return NULL. */ - QSocketNotifier* exceptionNotifier() const; + TQSocketNotifier* exceptionNotifier() const; /** * Executes a poll in the socket, via select(2) or poll(2). @@ -344,12 +344,12 @@ protected: * not need to call this function again. * * Reimplement this function in your derived class if your socket type - * requires a different kind of QSocketNotifier. The return value should + * requires a different kind of TQSocketNotifier. The return value should * be deleteable with delete. (@ref close deletes them). * * @param type the socket notifier type */ - virtual QSocketNotifier* createNotifier(QSocketNotifier::Type type) const; + virtual TQSocketNotifier* createNotifier(TQSocketNotifier::Type type) const; public: /** diff --git a/kdecore/network/ksrvresolverworker.cpp b/kdecore/network/ksrvresolverworker.cpp index bcfee405c..07e3555fa 100644 --- a/kdecore/network/ksrvresolverworker.cpp +++ b/kdecore/network/ksrvresolverworker.cpp @@ -25,8 +25,8 @@ #include <sys/socket.h> #include <stdlib.h> -#include <qapplication.h> -#include <qevent.h> +#include <tqapplication.h> +#include <tqevent.h> using namespace KNetwork; using namespace KNetwork::Internal; @@ -35,7 +35,7 @@ namespace { struct KSrvStartEvent: public QCustomEvent { - inline KSrvStartEvent() : QCustomEvent(QEvent::User) { } + inline KSrvStartEvent() : TQCustomEvent(TQEvent::User) { } }; } @@ -50,12 +50,12 @@ bool KSrvResolverWorker::preprocess() if ((flags() & (KResolver::NoSrv | KResolver::UseSrv)) != KResolver::UseSrv) return false; - QString node = nodeName(); + TQString node = nodeName(); if (node.find('%') != -1) node.truncate(node.find('%')); - if (node.isEmpty() || node == QString::fromLatin1("*") || - node == QString::fromLatin1("localhost")) + if (node.isEmpty() || node == TQString::fromLatin1("*") || + node == TQString::fromLatin1("localhost")) return false; // empty == localhost encodedName = KResolver::domainToAscii(node); @@ -73,13 +73,13 @@ bool KSrvResolverWorker::preprocess() return false; // it is numeric // check the protocol for something we know - QCString protoname; + TQCString protoname; int sockettype = socketType(); if (!protocolName().isEmpty()) protoname = protocolName(); else if (protocol() != 0) { - QStrList names = KResolver::protocolName(protocol()); + TQStrList names = KResolver::protocolName(protocol()); names.setAutoDelete(true); if (names.isEmpty()) return false; @@ -106,11 +106,11 @@ bool KSrvResolverWorker::preprocess() bool KSrvResolverWorker::run() { - sem = new QSemaphore(1); + sem = new TQSemaphore(1); // zero out sem->tryAccess(sem->available()); - QApplication::postEvent(this, new KSrvStartEvent); + TQApplication::postEvent(this, new KSrvStartEvent); // block (*sem)++; @@ -146,10 +146,10 @@ bool KSrvResolverWorker::run() else { // now process the results - QValueList<QDns::Server>::ConstIterator it = rawResults.begin(); + TQValueList<TQDns::Server>::ConstIterator it = rawResults.begin(); while (it != rawResults.end()) { - const QDns::Server& srv = *it; + const TQDns::Server& srv = *it; PriorityClass& r = myResults[srv.priority]; r.totalWeight += srv.weight; @@ -170,15 +170,15 @@ bool KSrvResolverWorker::run() // sort the priority sortPriorityClass(*mapit); - QValueList<Entry>& entries = (*mapit).entries; + TQValueList<Entry>& entries = (*mapit).entries; // start the resolvers - for (QValueList<Entry>::Iterator it = entries.begin(); + for (TQValueList<Entry>::Iterator it = entries.begin(); it != entries.end(); ++it) { Entry &e = *it; - KResolver* r = new KResolver(e.name, QString::number(e.port)); + KResolver* r = new KResolver(e.name, TQString::number(e.port)); r->setFlags(flags() | KResolver::NoSrv); r->setFamily(familyMask()); r->setSocketType(socketType()); @@ -203,7 +203,7 @@ bool KSrvResolverWorker::postprocess() for (mapit = myResults.begin(), mapend = myResults.end(); mapit != mapend; ++mapit) { - QValueList<Entry>::Iterator it = (*mapit).entries.begin(), + TQValueList<Entry>::Iterator it = (*mapit).entries.begin(), end = (*mapit).entries.end(); for ( ; it != end; ++it) { @@ -223,10 +223,10 @@ bool KSrvResolverWorker::postprocess() return true; } -void KSrvResolverWorker::customEvent(QCustomEvent*) +void KSrvResolverWorker::customEvent(TQCustomEvent*) { - dns = new QDns(QString::fromLatin1(encodedName), QDns::Srv); - QObject::connect(dns, SIGNAL(resultsReady()), this, SLOT(dnsResultsReady())); + dns = new TQDns(TQString::fromLatin1(encodedName), TQDns::Srv); + TQObject::connect(dns, TQT_SIGNAL(resultsReady()), this, TQT_SLOT(dnsResultsReady())); } void KSrvResolverWorker::dnsResultsReady() diff --git a/kdecore/network/ksrvresolverworker_p.h b/kdecore/network/ksrvresolverworker_p.h index 143fb0d4b..7022df826 100644 --- a/kdecore/network/ksrvresolverworker_p.h +++ b/kdecore/network/ksrvresolverworker_p.h @@ -20,11 +20,11 @@ #ifndef KSRVRESOLVERWORKER_P_H #define KSRVRESOLVERWORKER_P_H -#include <qobject.h> -#include <qdns.h> -#include <qsemaphore.h> -#include <qvaluelist.h> -#include <qdict.h> +#include <tqobject.h> +#include <tqdns.h> +#include <tqsemaphore.h> +#include <tqvaluelist.h> +#include <tqdict.h> #include "kresolver.h" #include "kresolverworkerbase.h" @@ -38,7 +38,7 @@ namespace KNetwork * @internal * This class implements SRV-based resolution */ - class KSrvResolverWorker: public QObject, + class KSrvResolverWorker: public TQObject, public KNetwork::KResolverWorkerBase { Q_OBJECT @@ -46,7 +46,7 @@ namespace KNetwork public: struct Entry { - QString name; + TQString name; Q_UINT16 port; Q_UINT16 weight; KNetwork::KResolver* resolver; @@ -56,17 +56,17 @@ namespace KNetwork { PriorityClass() : totalWeight(0) { } - QValueList<Entry> entries; + TQValueList<Entry> entries; Q_UINT16 totalWeight; }; private: - QDns *dns; - QValueList<QDns::Server> rawResults; - QCString encodedName; - QSemaphore *sem; + TQDns *dns; + TQValueList<TQDns::Server> rawResults; + TQCString encodedName; + TQSemaphore *sem; - typedef QMap<Q_UINT16, PriorityClass> Results; + typedef TQMap<Q_UINT16, PriorityClass> Results; Results myResults; public: @@ -74,7 +74,7 @@ namespace KNetwork virtual bool run(); virtual bool postprocess(); - virtual void customEvent(QCustomEvent*); + virtual void customEvent(TQCustomEvent*); public slots: void dnsResultsReady(); diff --git a/kdecore/network/kstreamsocket.cpp b/kdecore/network/kstreamsocket.cpp index 93c423804..8ca4f91f6 100644 --- a/kdecore/network/kstreamsocket.cpp +++ b/kdecore/network/kstreamsocket.cpp @@ -24,10 +24,10 @@ #include <config.h> -#include <qsocketnotifier.h> -#include <qdatetime.h> -#include <qtimer.h> -#include <qguardedptr.h> +#include <tqsocketnotifier.h> +#include <tqdatetime.h> +#include <tqtimer.h> +#include <tqguardedptr.h> #include "ksocketaddress.h" #include "kresolver.h" @@ -40,8 +40,8 @@ class KNetwork::KStreamSocketPrivate { public: KResolverResults::ConstIterator local, peer; - QTime startTime; - QTimer timer; + TQTime startTime; + TQTimer timer; int timeout; @@ -50,8 +50,8 @@ public: { } }; -KStreamSocket::KStreamSocket(const QString& node, const QString& service, - QObject* parent, const char *name) +KStreamSocket::KStreamSocket(const TQString& node, const TQString& service, + TQObject* parent, const char *name) : KClientSocketBase(parent, name), d(new KStreamSocketPrivate) { peerResolver().setNodeName(node); @@ -61,7 +61,7 @@ KStreamSocket::KStreamSocket(const QString& node, const QString& service, setSocketOptions(socketOptions() & ~Blocking); - QObject::connect(&d->timer, SIGNAL(timeout()), this, SLOT(timeoutSlot())); + TQObject::connect(&d->timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(timeoutSlot())); } KStreamSocket::~KStreamSocket() @@ -93,7 +93,7 @@ void KStreamSocket::setTimeout(int msecs) d->timer.changeInterval(msecs); } -bool KStreamSocket::bind(const QString& node, const QString& service) +bool KStreamSocket::bind(const TQString& node, const TQString& service) { if (state() != Idle) return false; @@ -105,7 +105,7 @@ bool KStreamSocket::bind(const QString& node, const QString& service) return true; } -bool KStreamSocket::connect(const QString& node, const QString& service) +bool KStreamSocket::connect(const TQString& node, const TQString& service) { if (state() == Connected) return true; // already connected @@ -130,7 +130,7 @@ bool KStreamSocket::connect(const QString& node, const QString& service) // connection hasn't started yet if (!blocking()) { - QObject::connect(this, SIGNAL(hostFound()), SLOT(hostFoundSlot())); + TQObject::connect(this, TQT_SIGNAL(hostFound()), TQT_SLOT(hostFoundSlot())); return lookup(); } @@ -196,10 +196,10 @@ bool KStreamSocket::connect(const KResolverEntry& entry) void KStreamSocket::hostFoundSlot() { - QObject::disconnect(this, SLOT(hostFoundSlot())); + TQObject::disconnect(this, TQT_SLOT(hostFoundSlot())); if (timeout() > 0) d->timer.start(timeout(), true); - QTimer::singleShot(0, this, SLOT(connectionEvent())); + TQTimer::singleShot(0, this, TQT_SLOT(connectionEvent())); } void KStreamSocket::connectionEvent() @@ -266,14 +266,14 @@ void KStreamSocket::connectionEvent() // socket is attempting to connect if (socketDevice()->error() == InProgress) { - QSocketNotifier *n = socketDevice()->readNotifier(); - QObject::connect(n, SIGNAL(activated(int)), - this, SLOT(connectionEvent())); + TQSocketNotifier *n = socketDevice()->readNotifier(); + TQObject::connect(n, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(connectionEvent())); n->setEnabled(true); n = socketDevice()->writeNotifier(); - QObject::connect(n, SIGNAL(activated(int)), - this, SLOT(connectionEvent())); + TQObject::connect(n, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(connectionEvent())); n->setEnabled(true); return; // wait for activity @@ -311,7 +311,7 @@ void KStreamSocket::timeoutSlot() setState(HostFound); emit stateChanged(HostFound); - QGuardedPtr<KStreamSocket> that = this; + TQGuardedPtr<KStreamSocket> that = this; emit gotError(Timeout); if (!that.isNull()) emit timedOut(); @@ -350,8 +350,8 @@ bool KStreamSocket::bindLocallyFor(const KResolverEntry& peer) void KStreamSocket::connectionSucceeded(const KResolverEntry& peer) { - QObject::disconnect(socketDevice()->readNotifier(), 0, this, SLOT(connectionEvent())); - QObject::disconnect(socketDevice()->writeNotifier(), 0, this, SLOT(connectionEvent())); + TQObject::disconnect(socketDevice()->readNotifier(), 0, this, TQT_SLOT(connectionEvent())); + TQObject::disconnect(socketDevice()->writeNotifier(), 0, this, TQT_SLOT(connectionEvent())); resetError(); setFlags(IO_Sequential | IO_Raw | IO_ReadWrite | IO_Open | IO_Async); diff --git a/kdecore/network/kstreamsocket.h b/kdecore/network/kstreamsocket.h index d9be79657..099826cb8 100644 --- a/kdecore/network/kstreamsocket.h +++ b/kdecore/network/kstreamsocket.h @@ -25,7 +25,7 @@ #ifndef KSTREAMSOCKET_H #define KSTREAMSOCKET_H -#include <qstring.h> +#include <tqstring.h> #include "kclientsocketbase.h" @@ -54,30 +54,30 @@ class KStreamSocketPrivate; * * Sample usage: * \code - * QByteArray httpGet(const QString& hostname) + * TQByteArray httpGet(const TQString& hostname) * { * KStreamSocket socket(hostname, "http"); * if (!socket.connect()) - * return QByteArray(); - * QByteArray data = socket.readAll(); + * return TQByteArray(); + * TQByteArray data = socket.readAll(); * return data; * } * \endcode * * Here's another sample, showing asynchronous operation: * \code - * DataRetriever::DataRetriever(const QString& hostname, const QString& port) + * DataRetriever::DataRetriever(const TQString& hostname, const TQString& port) * : socket(hostname, port) * { * // connect signals to our slots - * QObject::connect(&socket, SIGNAL(connected(const KResolverEntry&)), - * this, SLOT(slotSocketConnected())); - * QObject::connect(&socket, SIGNAL(gotError(int)), - * this, SLOT(slotSocketError(int))); - * QObject::connect(&socket, SIGNAL(readyRead()), - * this, SLOT(slotSocketReadyToRead())); - * QObject::connect(&socket, SIGNAL(readyWrite()), - * this, SLOT(slotSocketReadyToWrite())); + * TQObject::connect(&socket, TQT_SIGNAL(connected(const KResolverEntry&)), + * this, TQT_SLOT(slotSocketConnected())); + * TQObject::connect(&socket, TQT_SIGNAL(gotError(int)), + * this, TQT_SLOT(slotSocketError(int))); + * TQObject::connect(&socket, TQT_SIGNAL(readyRead()), + * this, TQT_SLOT(slotSocketReadyToRead())); + * TQObject::connect(&socket, TQT_SIGNAL(readyWrite()), + * this, TQT_SLOT(slotSocketReadyToWrite())); * * // set non-blocking mode in order to work asynchronously * socket.setBlocking(false); @@ -104,11 +104,11 @@ public: * * @param node destination host * @param service destination service to connect to - * @param parent the parent QObject object + * @param parent the parent TQObject object * @param name name for this object */ - KStreamSocket(const QString& node = QString::null, const QString& service = QString::null, - QObject* parent = 0L, const char *name = 0L); + KStreamSocket(const TQString& node = TQString::null, const TQString& service = TQString::null, + TQObject* parent = 0L, const char *name = 0L); /** * Destructor. This closes the socket. @@ -142,7 +142,7 @@ public: * Binds this socket to the given nodename and service, * or use the default ones if none are given. In order to bind to a service * and allow the operating system to choose the interface, set @p node to - * QString::null. + * TQString::null. * * Reimplemented from KClientSocketBase. * @@ -161,14 +161,14 @@ public: * @param node the nodename * @param service the service */ - virtual bool bind(const QString& node = QString::null, - const QString& service = QString::null); + virtual bool bind(const TQString& node = TQString::null, + const TQString& service = TQString::null); /** * Reimplemented from KClientSocketBase. Connect this socket to this * specific address. * - * Unlike @ref bind(const QString&, const QString&) above, this function + * Unlike @ref bind(const TQString&, const TQString&) above, this function * really does bind the socket. No lookup is performed. The @ref bound * signal will be emitted. */ @@ -196,8 +196,8 @@ public: * @param node the remote node to connect to * @param service the service on the remote node to connect to */ - virtual bool connect(const QString& node = QString::null, - const QString& service = QString::null); + virtual bool connect(const TQString& node = TQString::null, + const TQString& service = TQString::null); /** * Unshadowing from KClientSocketBase. |