diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-21 23:42:39 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-21 23:42:39 +0000 |
commit | 30ac1dcf377cd8937aa3f8b1fc845a6297f0b643 (patch) | |
tree | 32237877a16648b7fb207d93ef9079db547c148b | |
parent | 2b5e80f73636f80085572ae51cb04d67ea59b3b9 (diff) | |
download | tdelibs-30ac1dcf377cd8937aa3f8b1fc845a6297f0b643.tar.gz tdelibs-30ac1dcf377cd8937aa3f8b1fc845a6297f0b643.zip |
Fixed the majority of the xz and lzma handling code
There may still be an issue with the compress as menu and tar.lzma support, however it is relatively minor
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1166484 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r-- | kio/kio/ktar.cpp | 8 | ||||
-rw-r--r-- | mimetypes/application/x-txz.desktop | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/kio/kio/ktar.cpp b/kio/kio/ktar.cpp index 0d508329a..0b77fff52 100644 --- a/kio/kio/ktar.cpp +++ b/kio/kio/ktar.cpp @@ -101,7 +101,7 @@ KTar::KTar( const TQString& filename, const TQString & _mimetype ) if ( fourthByte == 4 ) mimetype = "application/x-zip"; } - else if ( firstByte == '\xFD' && secondByte == '7' && thirdByte == 'z' ) + else if ( firstByte == 0xfd && secondByte == '7' && thirdByte == 'z' ) { unsigned char fourthByte = file.getch(); unsigned char fifthByte = file.getch(); @@ -109,6 +109,12 @@ KTar::KTar( const TQString& filename, const TQString & _mimetype ) if ( fourthByte == 'X' && fifthByte == 'Z' && sixthByte == 0x00 ) mimetype = "application/x-xz"; } + else if ( firstByte == 0x5d && secondByte == 0x00 && thirdByte == 0x00 ) + { + unsigned char fourthByte = file.getch(); + if ( fourthByte == 0x80 ) + mimetype = "application/x-lzma"; + } } file.close(); } diff --git a/mimetypes/application/x-txz.desktop b/mimetypes/application/x-txz.desktop index 52b489b83..81c4330ff 100644 --- a/mimetypes/application/x-txz.desktop +++ b/mimetypes/application/x-txz.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Type=MimeType MimeType=application/x-txz -Icon=txz +Icon=tgz Patterns=*.tar.xz;*.txz; Comment=Xzipped Tar Archive Comment[af]=Xzip gekompakteerde Tar Argief |