Review Request 124503: Rewrite unrar parsing code
Ragnar Thomsen
rthomsen6 at gmail.com
Tue Jul 28 12:07:19 UTC 2015
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124503/
-----------------------------------------------------------
Review request for KDE Utils, Elvis Angelaccio and Raphael Kubo da Costa.
Bugs: 331065
http://bugs.kde.org/show_bug.cgi?id=331065
Repository: ark
Description
-------
The parsing code of unrar was rewritten to hopefully improve readability. The output from unrar3 and 4 is identical and these will be referred to as unrar4. Unfortunately, it was not possible to reduce the length of the code. This is due to the output of unrar not being very parser-friendly and we want to support both unrar4 and 5, which have very different output. However, the new code should be easier to follow and hopefully more robust.
Specific changes:
* readListLine() is now very short. It simply checks the version of unrar and calls unrar4 or 5 specific line-handling functions termed handleUnrar4Line() and handleUnrar5Line().
* When the line-handling functions have completed parsing all the details of an archive entry, they call an entry-handling function, either handleUnrar4Entry() or handleUnrar5Entry().
* The groundwork for handling comments in rar archives has also been laid, for now the comment is stored in a member QString variable (m_comment). The UI work for showing comments in archives is being done in [RR124468](https://git.reviewboard.kde.org/r/124468/)).
In the process, two bugs were identified and fixed:
1. The parsing of modification time for entries in unrar5 was broken.
2. The target of symlinks was not being parsed in both unrar4 and 5, and hence not presented in Ark.
Diffs
-----
plugins/clirarplugin/cliplugin.h 862ec71
plugins/clirarplugin/cliplugin.cpp 9ec12e4
Diff: https://git.reviewboard.kde.org/r/124503/diff/
Testing
-------
Tested different types of rar archives using both unrar 4 and 5:
* With encryption (both header/files and only files).
* With comment.
* With recovery record.
* With NTFS file streams stored (winrar feature).
* Multi-volume archives.
* Archive created using WinRAR on Windows 7.
Thanks,
Ragnar Thomsen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20150728/de224f59/attachment.html>
More information about the Kde-utils-devel
mailing list