diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:28:12 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:28:12 +0000 |
commit | fe9f6c6bbc9e682af709fe08757c31ba17a298d1 (patch) | |
tree | e10ff71b5ed6b48a65419a1896f9b92b75fa4e07 /c++-qt/src | |
parent | fba73219e3c7bf65b459a3303f579fd83c8fd0af (diff) | |
download | libgats-fe9f6c6bbc9e682af709fe08757c31ba17a298d1.tar.gz libgats-fe9f6c6bbc9e682af709fe08757c31ba17a298d1.tar.bz2 libgats-fe9f6c6bbc9e682af709fe08757c31ba17a298d1.tar.xz libgats-fe9f6c6bbc9e682af709fe08757c31ba17a298d1.zip |
I think I fixed a seeking bug in the qt gatsstream, but...I haven't tested it
yet.
Diffstat (limited to '')
-rw-r--r-- | c++-qt/src/gatsstream.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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 ) | |||
86 | pTmp->write( (const char *)&iSize, 4 ); | 86 | pTmp->write( (const char *)&iSize, 4 ); |
87 | pObject->write( *pTmp ); | 87 | pObject->write( *pTmp ); |
88 | iSize = htonl( pTmp->pos() ); | 88 | iSize = htonl( pTmp->pos() ); |
89 | uint64_t iEndPos = pTmp->pos(); | ||
89 | pTmp->seek( iSizePos ); | 90 | pTmp->seek( iSizePos ); |
90 | pTmp->write( (const char *)&iSize, 4 ); | 91 | pTmp->write( (const char *)&iSize, 4 ); |
91 | pTmp->close(); | ||
92 | 92 | ||
93 | if( rStream.isSequential() ) | 93 | if( rStream.isSequential() ) |
94 | { | 94 | { |
95 | pTmp->close(); | ||
95 | rStream.write( ((QBuffer *)pTmp)->data() ); | 96 | rStream.write( ((QBuffer *)pTmp)->data() ); |
96 | delete pTmp; | 97 | delete pTmp; |
97 | } | 98 | } |
99 | else | ||
100 | { | ||
101 | pTmp->seek( iSizePos ); | ||
102 | } | ||
98 | } | 103 | } |
99 | 104 | ||
100 | bool Gats::GatsStream::skipReadNulls() | 105 | bool Gats::GatsStream::skipReadNulls() |