> On Nov. 6, 2015, 7:52 a.m., David Faure wrote: > > src/karchive.cpp, line 652 > > <https://git.reviewboard.kde.org/r/125974/diff/1/?file=415544#file415544line652> > > > > This is not equivalent to seek(d->pos). > > seek(d->pos) goes to the absolute position d->pos, counting from the > > beginning of the device. > > > > read(d->pos) goes to the absolute position (current position + d->pos). > > > > If this is seeking forward, you could emulate it with a dummy read, but > > what if this is seeking backward? That's not possible on a sequential > > device, so my advice is, forget using a sequential device here, download to > > a temp file. > > Romário Rios wrote: > Actually, this is irrelevant to the issue. I reverted this code back to > the original and the fix still works. > > You're right about the situation in this case, but, inside > KTar::openArchive, it works because it originally only seeks the device > forward. > > David Faure wrote: > Maybe but if you call KArchiveFile::data() on the last file in the > archive, and then on the first file in the archive, seeking back is obviously > needed.
When would that happen? KArchiveFile::data() isn't ever called from inside KTar::openArchive(). - Romário ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/125974/#review88078 ----------------------------------------------------------- On Nov. 6, 2015, 2:52 a.m., Romário Rios wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://git.reviewboard.kde.org/r/125974/ > ----------------------------------------------------------- > > (Updated Nov. 6, 2015, 2:52 a.m.) > > > Review request for KDE Frameworks and Aleix Pol Gonzalez. > > > Repository: karchive > > > Description > ------- > > Up until now, since at least 5.12, decompressing some data coming directly > from a QIODevice by using KCompressionDevice because this is a sequential > device, and KTar and KArchive used to use QIODevice::seek and pos and some > places, which made the decompression fail. This patch makes KTar > sequential-friendly by replacing the calls to seek and pos with read and a > simple counter, respectively. > > > Diffs > ----- > > src/karchive.cpp 0ece37c > src/ktar.cpp 824395e > > Diff: https://git.reviewboard.kde.org/r/125974/diff/ > > > Testing > ------- > > Makes the tests from review #125941 pass > > > Thanks, > > Romário Rios > >
_______________________________________________ Kde-frameworks-devel mailing list Kde-frameworks-devel@kde.org https://mail.kde.org/mailman/listinfo/kde-frameworks-devel