Review Request: [KTar] Determine archive mimetype from filename as a fallback when unable to detect from contents, cleanup

Maciej Mrozowski reavertm at gmail.com
Tue Aug 10 16:43:25 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/4966/
-----------------------------------------------------------

Review request for kdelibs and David Faure.


Summary
-------

This actually serves as a workaround for application/x-lzma-compressed-tar archives, as for .tar.lzma files KMimeType::findByFileContent returns application/octet-stream with current shared-mime-info. Patch provides fallback - when findByFileContents returns defaultMImeType(), then mimetype is detected from file name instead.
Also David Faure suggested porting mime validation using KMimeType::is (aliases supported) which is done now + a little cleanup.

After patch is done, .tar.xz and .tar.lzma related mimetypes can be added to corresponding kioslaves in runtime/ to finally benefit from xz filter commited in kdelibs-4.4 I think.

--- kioslave/archive/tar.protocol	(revision 1161623)
+++ kioslave/archive/tar.protocol	(working copy)
@@ -1,7 +1,7 @@
 [Protocol]
 exec=kio_archive
 protocol=tar
-archiveMimetype=application/x-tar,application/x-compressed-tar,application/x-bzip-compressed-tar,application/x-webarchive
+archiveMimetype=application/x-tar,application/x-compressed-tar,application/x-bzip-compressed-tar,application/x-webarchive,application/x-lzma-compressed-tar,application/x-xz-compressed-tar
 input=filesystem
 output=filesystem
 listing=Name,Type,Size,Date,Access,Owner,Group,Link


Diffs
-----

  branches/KDE/4.5/kdelibs/kdecore/io/ktar.cpp 1161667 

Diff: http://reviewboard.kde.org/r/4966/diff


Testing
-------

Opening .tar.xz, (and now also .tar.lzma is possible) archives using kioslave.


Thanks,

Maciej

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20100810/400fa87d/attachment.htm>


More information about the kde-core-devel mailing list