diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-13 08:32:36 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-01-13 08:32:36 +0000 |
commit | f7e71d47719ab6094cf4a9fafffa5ea351973522 (patch) | |
tree | 30834aa632d442019e14f88685001d94657d060b /kdecore/network/ksocketbuffer.cpp | |
parent | b31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff) | |
download | tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip |
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems
with dependent modules such as kdebase. If it does then it needs to be fixed!
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/network/ksocketbuffer.cpp')
-rw-r--r-- | kdecore/network/ksocketbuffer.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/kdecore/network/ksocketbuffer.cpp b/kdecore/network/ksocketbuffer.cpp index 18c926c83..4ea12ed14 100644 --- a/kdecore/network/ksocketbuffer.cpp +++ b/kdecore/network/ksocketbuffer.cpp @@ -33,7 +33,7 @@ using namespace KNetwork; using namespace KNetwork::Internal; -KSocketBuffer::KSocketBuffer(Q_LONG size) +KSocketBuffer::KSocketBuffer(TQ_LONG size) : m_mutex(true), m_offset(0), m_size(size), m_length(0) { } @@ -75,9 +75,9 @@ bool KSocketBuffer::canReadLine() const // walk the buffer for ( ; it != end; ++it) { - if ((*it).find('\n', offset) != -1) + if ((*it).tqfind('\n', offset) != -1) return true; - if ((*it).find('\r', offset) != -1) + if ((*it).tqfind('\r', offset) != -1) return true; offset = 0; } @@ -101,7 +101,7 @@ TQCString KSocketBuffer::readLine() // walk the buffer for ( ; it != end; ++it) { - int posnl = (*it).find('\n', offset); + int posnl = (*it).tqfind('\n', offset); if (posnl == -1) { // not found in this one @@ -120,17 +120,17 @@ TQCString KSocketBuffer::readLine() return result; } -Q_LONG KSocketBuffer::length() const +TQ_LONG KSocketBuffer::length() const { return m_length; } -Q_LONG KSocketBuffer::size() const +TQ_LONG KSocketBuffer::size() const { return m_size; } -bool KSocketBuffer::setSize(Q_LONG size) +bool KSocketBuffer::setSize(TQ_LONG size) { m_size = size; if (size == -1 || m_length < m_size) @@ -147,7 +147,7 @@ bool KSocketBuffer::setSize(Q_LONG size) return (m_length - m_size) == consumeBuffer(0L, m_length - m_size, true); } -Q_LONG KSocketBuffer::feedBuffer(const char *data, Q_LONG len) +TQ_LONG KSocketBuffer::feedBuffer(const char *data, TQ_LONG len) { if (data == 0L || len == 0) return 0; // nothing to write @@ -168,7 +168,7 @@ Q_LONG KSocketBuffer::feedBuffer(const char *data, Q_LONG len) return len; } -Q_LONG KSocketBuffer::consumeBuffer(char *destbuffer, Q_LONG maxlen, bool discard) +TQ_LONG KSocketBuffer::consumeBuffer(char *destbuffer, TQ_LONG maxlen, bool discard) { if (maxlen == 0 || isEmpty()) return 0; @@ -176,7 +176,7 @@ Q_LONG KSocketBuffer::consumeBuffer(char *destbuffer, Q_LONG maxlen, bool discar TQValueListIterator<TQByteArray> it = m_list.begin(), end = m_list.end(); TQIODevice::Offset offset = m_offset; - Q_LONG copied = 0; + TQ_LONG copied = 0; // walk the buffer while (it != end && maxlen) @@ -228,7 +228,7 @@ void KSocketBuffer::clear() m_length = 0; } -Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) +TQ_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, TQ_LONG len) { if (len == 0 || isEmpty()) return 0; @@ -238,7 +238,7 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) TQValueListIterator<TQByteArray> it = m_list.begin(), end = m_list.end(); TQIODevice::Offset offset = m_offset; - Q_LONG written = 0; + TQ_LONG written = 0; // walk the buffer while (it != end && (len || len == -1)) @@ -248,11 +248,11 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) // better by concatenating a few of them into a big buffer // question is: how big should that buffer be? 2 kB should be enough - Q_ULONG bufsize = 1460; + TQ_ULONG bufsize = 1460; if (len != -1 && len < bufsize) bufsize = len; TQByteArray buf(bufsize); - Q_LONG count = 0; + TQ_LONG count = 0; while (it != end && count + ((*it).size() - offset) <= bufsize) { @@ -273,7 +273,7 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) } // now try to write those bytes - Q_LONG wrote = dev->writeBlock(buf, count); + TQ_LONG wrote = dev->writeBlock(buf, count); if (wrote == -1) // error? @@ -293,7 +293,7 @@ Q_LONG KSocketBuffer::sendTo(KActiveSocketBase* dev, Q_LONG len) return written; } -Q_LONG KSocketBuffer::receiveFrom(KActiveSocketBase* dev, Q_LONG len) +TQ_LONG KSocketBuffer::receiveFrom(KActiveSocketBase* dev, TQ_LONG len) { if (len == 0 || isFull()) return 0; |