diff options
Diffstat (limited to 'tdecore/kextsock.cpp')
| -rw-r--r-- | tdecore/kextsock.cpp | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/tdecore/kextsock.cpp b/tdecore/kextsock.cpp index b9a6efb10..f78464287 100644 --- a/tdecore/kextsock.cpp +++ b/tdecore/kextsock.cpp @@ -222,12 +222,7 @@ KExtendedSocket::~KExtendedSocket() delete d; } -#ifdef USE_QT3 void KExtendedSocket::reset() -#endif // USE_QT3 -#ifdef USE_QT4 -bool KExtendedSocket::reset() -#endif // USE_QT4 { closeNow(); release(); @@ -644,7 +639,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize) if (d->qsnIn == NULL) { d->qsnIn = new TQSocketNotifier(sockfd, TQSocketNotifier::Read); - TQObject::connect(d->qsnIn, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityRead())); + TQObject::connect(d->qsnIn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityRead())); d->qsnIn->setEnabled(true); } @@ -692,7 +687,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize) if (d->qsnOut == NULL) { d->qsnOut = new TQSocketNotifier(sockfd, TQSocketNotifier::Write); - TQObject::connect(d->qsnOut, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityWrite())); + TQObject::connect(d->qsnOut, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityWrite())); // if the class is being created now, there's nothing to write yet // so socketActivityWrite() will get called once and disable // the notifier @@ -707,7 +702,7 @@ bool KExtendedSocket::setBufferSize(int rsize, int wsize) if (d->emitWrite && d->qsnOut == NULL) { d->qsnOut = new TQSocketNotifier(sockfd, TQSocketNotifier::Write); - TQObject::connect(d->qsnOut, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityWrite())); + TQObject::connect(d->qsnOut, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityWrite())); } return true; @@ -788,8 +783,8 @@ int KExtendedSocket::startAsyncLookup() d->resRemote.setFlags(flags); d->resRemote.setFamily(familyMask); d->resRemote.setSocketType(socktype); - TQObject::connect(&d->resRemote, TQT_SIGNAL(finished(KResolverResults)), - this, TQT_SLOT(dnsResultsReady())); + TQObject::connect(&d->resRemote, TQ_SIGNAL(finished(KResolverResults)), + this, TQ_SLOT(dnsResultsReady())); if (!d->resRemote.start()) { @@ -805,8 +800,8 @@ int KExtendedSocket::startAsyncLookup() d->resLocal.setFlags(flags); d->resLocal.setFamily(familyMask); d->resLocal.setSocketType(socktype); - TQObject::connect(&d->resLocal, TQT_SIGNAL(finished(KResolverResults)), - this, TQT_SLOT(dnsResultsReady())); + TQObject::connect(&d->resLocal, TQ_SIGNAL(finished(KResolverResults)), + this, TQ_SLOT(dnsResultsReady())); if (!d->resLocal.start()) { @@ -901,7 +896,7 @@ int KExtendedSocket::listen(int N) { d->status = listening; d->qsnIn = new TQSocketNotifier(sockfd, TQSocketNotifier::Read); - TQObject::connect(d->qsnIn, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityRead())); + TQObject::connect(d->qsnIn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityRead())); } return retval == -1 ? -1 : 0; } @@ -1223,7 +1218,7 @@ int KExtendedSocket::startAsyncConnect() // signal lookupFinished to do connection if (d->status < lookupDone) { - TQObject::connect(this, TQT_SIGNAL(lookupFinished(int)), this, TQT_SLOT(startAsyncConnectSlot())); + TQObject::connect(this, TQ_SIGNAL(lookupFinished(int)), this, TQ_SLOT(startAsyncConnectSlot())); if (d->status < lookupInProgress) return startAsyncLookup(); else @@ -1233,7 +1228,7 @@ int KExtendedSocket::startAsyncConnect() // here we have d->status >= lookupDone and <= connecting // we can do our connection d->status = connecting; - TQGuardedPtr<TQObject> p = TQT_TQOBJECT(this); + TQGuardedPtr<TQObject> p = this; connectionEvent(); if (!p) return -1; // We have been deleted. @@ -1262,7 +1257,7 @@ void KExtendedSocket::cancelAsyncConnect() d->status = lookupDone; } -bool KExtendedSocket::open(TQ_OpenMode mode) +bool KExtendedSocket::open(int mode) { if (mode != IO_Raw | IO_ReadWrite) return false; // invalid open mode @@ -1436,7 +1431,7 @@ void KExtendedSocket::flush() } -TQT_TQIO_LONG KExtendedSocket::tqreadBlock(char *data, TQT_TQIO_ULONG maxlen) +TQ_LONG KExtendedSocket::readBlock(char *data, TQ_ULONG maxlen) { cleanError(); if (d->status < connected || d->flags & passiveSocket) @@ -1481,7 +1476,7 @@ TQT_TQIO_LONG KExtendedSocket::tqreadBlock(char *data, TQT_TQIO_ULONG maxlen) return retval; } -TQT_TQIO_LONG KExtendedSocket::tqwriteBlock(const char *data, TQT_TQIO_ULONG len) +TQ_LONG KExtendedSocket::writeBlock(const char *data, TQ_ULONG len) { cleanError(); if (d->status < connected || d->status >= closing || d->flags & passiveSocket) @@ -1557,12 +1552,7 @@ int KExtendedSocket::unreadBlock(const char *, uint) return -1; } -#ifdef USE_QT3 int KExtendedSocket::bytesAvailable() const -#endif // USE_QT3 -#ifdef USE_QT4 -qint64 KExtendedSocket::bytesAvailable() const -#endif // USE_QT4 { if (d->status < connected || d->flags & passiveSocket) return -2; @@ -1606,7 +1596,7 @@ int KExtendedSocket::getch() { unsigned char c; int retval; - retval = tqreadBlock((char*)&c, sizeof(c)); + retval = readBlock((char*)&c, sizeof(c)); if (retval < 0) return retval; @@ -1616,7 +1606,7 @@ int KExtendedSocket::getch() int KExtendedSocket::putch(int ch) { unsigned char c = (char)ch; - return tqwriteBlock((char*)&c, sizeof(c)); + return writeBlock((char*)&c, sizeof(c)); } // sets the emission of the readyRead signal @@ -1919,9 +1909,9 @@ void KExtendedSocket::connectionEvent() // error here is either EWOULDBLOCK or EINPROGRESS // so, it is a good condition d->qsnIn = new TQSocketNotifier(sockfd, TQSocketNotifier::Read); - TQObject::connect(d->qsnIn, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityRead())); + TQObject::connect(d->qsnIn, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityRead())); d->qsnOut = new TQSocketNotifier(sockfd, TQSocketNotifier::Write); - TQObject::connect(d->qsnOut, TQT_SIGNAL(activated(int)), this, TQT_SLOT(socketActivityWrite())); + TQObject::connect(d->qsnOut, TQ_SIGNAL(activated(int)), this, TQ_SLOT(socketActivityWrite())); // ok, let the Qt event loop do the selecting for us return; @@ -1979,7 +1969,7 @@ void KExtendedSocket::dnsResultsReady() void KExtendedSocket::startAsyncConnectSlot() { - TQObject::disconnect(this, TQT_SIGNAL(lookupFinished(int)), this, TQT_SLOT(startAsyncConnectSlot())); + TQObject::disconnect(this, TQ_SIGNAL(lookupFinished(int)), this, TQ_SLOT(startAsyncConnectSlot())); if (d->status == lookupDone) startAsyncConnect(); |
