From fe9f6c6bbc9e682af709fe08757c31ba17a298d1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 6 Apr 2012 06:28:12 +0000 Subject: I think I fixed a seeking bug in the qt gatsstream, but...I haven't tested it yet. --- c++-qt/src/gatsstream.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'c++-qt/src') diff --git a/c++-qt/src/gatsstream.cpp b/c++-qt/src/gatsstream.cpp index d32b2b2..ae53d0d 100644 --- a/c++-qt/src/gatsstream.cpp +++ b/c++-qt/src/gatsstream.cpp @@ -86,15 +86,20 @@ void Gats::GatsStream::writeObject( Gats::Object *pObject ) pTmp->write( (const char *)&iSize, 4 ); pObject->write( *pTmp ); iSize = htonl( pTmp->pos() ); + uint64_t iEndPos = pTmp->pos(); pTmp->seek( iSizePos ); pTmp->write( (const char *)&iSize, 4 ); - pTmp->close(); if( rStream.isSequential() ) { + pTmp->close(); rStream.write( ((QBuffer *)pTmp)->data() ); delete pTmp; } + else + { + pTmp->seek( iSizePos ); + } } bool Gats::GatsStream::skipReadNulls() -- cgit v1.2.3