diff options
author | Antonio Diaz Diaz <antonio@gnu.org> | 2018-08-23 00:28:09 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-08-23 00:33:00 +0200 |
commit | 88e74ce7ce3bd064303bc6b5199c44b5f772a2e5 (patch) | |
tree | 716196313fdb11bcc360b90731dbefd979f55f8b /iso | |
parent | fc5a2ea7ab7dedb52cc7fbe561d16b81bbc17a59 (diff) | |
download | krusader-feat/lzip-support.tar.gz krusader-feat/lzip-support.zip |
Add support for Lzipfeat/lzip-support
Signed-off-by: Antonio Diaz Diaz <antonio@gnu.org>
Diffstat (limited to 'iso')
-rw-r--r-- | iso/kiso.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/iso/kiso.cpp b/iso/kiso.cpp index 1e8f192..7e5ec32 100644 --- a/iso/kiso.cpp +++ b/iso/kiso.cpp @@ -125,6 +125,8 @@ KIso::KIso( const TQString& filename, const TQString & _mimetype ) mimetype = "application/x-gzip"; else if ( mimetype == "application/x-tbz" ) // that's a bzipped2 tar file, so ask for bz2 filter mimetype = "application/x-bzip2"; + else if ( mimetype == "application/x-tlz" ) // that's a lzipped tar file, so ask for lzip filter + mimetype = "application/x-lzip"; else if ( mimetype == "application/x-txz" ) // that's a xzipped tar file, so ask for xz filter mimetype = "application/x-xz"; else @@ -136,22 +138,23 @@ KIso::KIso( const TQString& filename, const TQString & _mimetype ) unsigned char firstByte = file.getch(); unsigned char secondByte = file.getch(); unsigned char thirdByte = file.getch(); + unsigned char fourthByte = file.getch(); if ( firstByte == 0037 && secondByte == 0213 ) mimetype = "application/x-gzip"; else if ( firstByte == 'B' && secondByte == 'Z' && thirdByte == 'h' ) mimetype = "application/x-bzip2"; - else if ( firstByte == 'P' && secondByte == 'K' && thirdByte == 3 ) - { - unsigned char fourthByte = file.getch(); - if ( fourthByte == 4 ) + else if ( firstByte == 'L' && secondByte == 'Z' && + thirdByte == 'I' && fourthByte == 'P' ) + mimetype = "application/x-lzip"; + else if ( firstByte == 'P' && secondByte == 'K' && + thirdByte == 3 && fourthByte == 4 ) mimetype = "application/x-zip"; - } - else if ( firstByte == 0xfd && secondByte == '7' && thirdByte == 'z' ) + else if ( firstByte == 0xfd && secondByte == '7' && + thirdByte == 'z' && fourthByte == 'X' ) { - unsigned char fourthByte = file.getch(); unsigned char fifthByte = file.getch(); unsigned char sixthByte = file.getch(); - if ( fourthByte == 'X' && fifthByte == 'Z' && sixthByte == 0) + if ( fifthByte == 'Z' && sixthByte == 0) mimetype = "application/x-xz"; } } @@ -171,7 +174,7 @@ void KIso::prepareDevice( const TQString & filename, else { if("application/x-gzip" == mimetype || "application/x-bzip2" == mimetype || - "application/x-xz" == mimetype) + "application/x-lzip" == mimetype || "application/x-xz" == mimetype) forced = true; TQIODevice *dev = KFilterDev::deviceForFile( filename, mimetype, forced ); |