Review Request 124503: Rewrite unrar parsing code

Ragnar Thomsen rthomsen6 at gmail.com
Sun Sep 13 16:45:37 UTC 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124503/
-----------------------------------------------------------

(Updated Sept. 13, 2015, 4:45 p.m.)


Status
------

This change has been marked as submitted.


Review request for KDE Utils, Elvis Angelaccio and Raphael Kubo da Costa.


Changes
-------

Submitted with commit b738a0041a44ad9c36644aa903c6621ac9e265e9 by Ragnar Thomsen to branch master.


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. Also, alot of comments have been inserted to ease maintenance of the code.

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 e079e1e 

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/20150913/1bf45f76/attachment.html>


More information about the Kde-utils-devel mailing list