diff options
Diffstat (limited to 'src/svnqt/svnstream.cpp')
-rw-r--r-- | src/svnqt/svnstream.cpp | 47 |
1 files changed, 13 insertions, 34 deletions
diff --git a/src/svnqt/svnstream.cpp b/src/svnqt/svnstream.cpp index e3b6014..009dbe3 100644 --- a/src/svnqt/svnstream.cpp +++ b/src/svnqt/svnstream.cpp @@ -24,16 +24,16 @@ // Subversion api #include "svn_client.h" -#include <qbuffer.h> -#include <qdatetime.h> -#include <qfile.h> +#include <tqbuffer.h> +#include <tqdatetime.h> +#include <tqfile.h> #define MAX_TIME 300 namespace svn { namespace stream { -class SVNQT_NOEXPORT SvnStream_private +class SVNTQT_NOEXPORT SvnStream_private { public: SvnStream_private(){m_Stream=0;m_LastError="";_context=0;cancel_timeout.start();} @@ -44,10 +44,10 @@ public: Pool m_Pool; svn_stream_t * m_Stream; - QString m_LastError; + TQString m_LastError; svn_client_ctx_t* _context; - QTime cancel_timeout; + TQTime cancel_timeout; }; svn_error_t * SvnStream_private::stream_read(void*baton,char*data,apr_size_t*len) @@ -143,17 +143,16 @@ long SvnStream::read(char*,const unsigned long ) return -1; } -const QString&SvnStream::lastError()const +const TQString&SvnStream::lastError()const { return m_Data->m_LastError; } -void SvnStream::setError(const QString&aError)const +void SvnStream::setError(const TQString&aError)const { m_Data->m_LastError = aError; } -#if QT_VERSION < 0x040000 void SvnStream::setError(int ioError)const { switch (ioError) { @@ -186,30 +185,21 @@ void SvnStream::setError(int ioError)const break; } } -#endif class SvnByteStream_private { public: SvnByteStream_private(); virtual ~SvnByteStream_private(){} - QByteArray m_Content; - QBuffer mBuf; + TQByteArray m_Content; + TQBuffer mBuf; }; -#if QT_VERSION < 0x040000 SvnByteStream_private::SvnByteStream_private() :mBuf(m_Content) { mBuf.open(IO_WriteOnly); } -#else -SvnByteStream_private::SvnByteStream_private() - :mBuf(&m_Content, 0) -{ - mBuf.open(QFile::WriteOnly); -} -#endif /* ByteStream implementation start */ SvnByteStream::SvnByteStream(svn_client_ctx_t * ctx) @@ -217,11 +207,7 @@ SvnByteStream::SvnByteStream(svn_client_ctx_t * ctx) { m_ByteData = new SvnByteStream_private; if (!m_ByteData->mBuf.isOpen()) { -#if QT_VERSION < 0x040000 - setError(m_ByteData->mBuf.status()); -#else - setError(m_ByteData->mBuf.errorString()); -#endif + setError(TQT_TQIODEVICE_OBJECT(m_ByteData->mBuf).status()); } } @@ -232,21 +218,14 @@ SvnByteStream::~SvnByteStream() long SvnByteStream::write(const char*aData,const unsigned long max) { -#if QT_VERSION < 0x040000 long i = m_ByteData->mBuf.writeBlock(aData,max); if (i<0) { - setError(m_ByteData->mBuf.status()); - } -#else - long i = m_ByteData->mBuf.write(aData,max); - if (i<0) { - setError(m_ByteData->mBuf.errorString()); + setError(TQT_TQIODEVICE_OBJECT(m_ByteData->mBuf).status()); } -#endif return i; } -QByteArray SvnByteStream::content()const +TQByteArray SvnByteStream::content()const { return m_ByteData->mBuf.buffer(); } |