This code never gets call IMHO, or only once, if _busPos is initialized with something other than zero which is greater than _busSize when it gets initialized:
if (_bufPos >= _bufSize) {
fillBuffer();
if (_bufSize == 0) return 0;
}
if (_bufPos >= _bufSize) {
fillBuffer();
if (_bufSize == 0) return 0;
}
To copy to clipboard, switch view to plain text mode
Since in here, _bufPos is always set to 0:
void CompressedFile::fillBuffer()
{
_bufOffset += _bufSize;
_bufSize = gzread(_file, _buffer, BUFSIZE);
_bufPos = 0; //<--- always 0.
}
void CompressedFile::fillBuffer()
{
_bufOffset += _bufSize;
_bufSize = gzread(_file, _buffer, BUFSIZE);
_bufPos = 0; //<--- always 0.
}
To copy to clipboard, switch view to plain text mode
Is there a reason you are reading char after char and not a whole line using QIDevice::readLine()?
Because this is what takes so long...
Bookmarks