Review Request 117467: Archive type detection

Ondřej Záruba ozaruba at seznam.cz
Wed Apr 23 09:41:15 UTC 2014



> On April 21, 2014, 9:32 p.m., Raphael Kubo da Costa wrote:
> > Thank you for the patch, but I don't understand how it is supposed to solve bug 245705 (it still happens if I apply the patch here). Even if it's unrelated to that bug, it's still unclear to me what problem it is trying to fix.

When you open invalid archive (like test.txt renamed to test.zip) the Ark tries to detect the archive type by using function KMimeType::findByNameAndContent(filename, buffer), but this function first detects file type name and if it detects *.zip it doesn't try to verify if the content rely matches archive type. So I have replaced the function with this  KMimeType::findByContent(buffer), which wouldn't load invalid archive with invalid content. The problem with applying this patch is that it fixes an Ark library and not Ark itself, so I had to copy Ark's libraries to my system paths to make it run. It solves bug by forcing you to choose archive type (in popup window). If it does not work, another popup shows message about not being able to open an archive file and the main Ark window is left blank.


- Ondřej


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


On April 10, 2014, 7:59 a.m., Ondřej Záruba wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/117467/
> -----------------------------------------------------------
> 
> (Updated April 10, 2014, 7:59 a.m.)
> 
> 
> Review request for KDE Utils.
> 
> 
> Bugs: 245705
>     http://bugs.kde.org/show_bug.cgi?id=245705
> 
> 
> Repository: ark
> 
> 
> Description
> -------
> 
> Ark tests the archive type just by file name, which is not enough. This patch forces Ark to detect file type by its content.
> 
> 
> Diffs
> -----
> 
>   kerfuffle/archive.cpp c2c5b18 
> 
> Diff: https://git.reviewboard.kde.org/r/117467/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Ondřej Záruba
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-utils-devel/attachments/20140423/060d4ea4/attachment.html>


More information about the Kde-utils-devel mailing list