Review Request 125974: Make KTar KCompressionDevice-friendly

Romário Rios luizromario at gmail.com
Fri Nov 6 12:23:19 UTC 2015



> 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.

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.


- 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
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151106/228b939e/attachment.html>


More information about the Kde-frameworks-devel mailing list