summaryrefslogtreecommitdiffstats
path: root/ark
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-17 17:54:24 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-17 17:54:24 +0000
commita4043f1fc05f0710a025d0f02d13d641cec6309f (patch)
tree0855c060c046d0240b768fdea60e99d3a7edf24c /ark
parentb678e7f967f438e123324c7a34b02388e68d70dc (diff)
downloadtdeutils-a4043f1fc05f0710a025d0f02d13d641cec6309f.tar.gz
tdeutils-a4043f1fc05f0710a025d0f02d13d641cec6309f.zip
Preliminary xzip/LZMA support
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1164816 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ark')
-rw-r--r--ark/archiveformatinfo.cpp5
-rw-r--r--ark/ark.desktop2
-rw-r--r--ark/compressedfile.cpp12
-rw-r--r--ark/tar.cpp12
4 files changed, 30 insertions, 1 deletions
diff --git a/ark/archiveformatinfo.cpp b/ark/archiveformatinfo.cpp
index 4d7eda6..01b84fc 100644
--- a/ark/archiveformatinfo.cpp
+++ b/ark/archiveformatinfo.cpp
@@ -53,6 +53,9 @@ void ArchiveFormatInfo::buildFormatInfos()
addFormatInfo( TAR_FORMAT, "application/x-tarz", ".tar.z" );
addFormatInfo( TAR_FORMAT, "application/x-tbz", ".tar.bz2" );
addFormatInfo( TAR_FORMAT, "application/x-tbz2", ".tar.bz2" );
+ addFormatInfo( TAR_FORMAT, "application/x-tlz", ".tar.lzma" );
+ addFormatInfo( TAR_FORMAT, "application/x-txz", ".tar.xz" );
+
// x-tar as the last one to get its comment for all the others, too
addFormatInfo( TAR_FORMAT, "application/x-tar", ".tar" );
@@ -65,6 +68,8 @@ void ArchiveFormatInfo::buildFormatInfos()
addFormatInfo( COMPRESSED_FORMAT, "application/x-gzip", ".gz" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip", ".bz" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip2", ".bz2" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-lzma", ".lzma" );
+ addFormatInfo( COMPRESSED_FORMAT, "application/x-xz", ".xz" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-lzop", ".lzo" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-compress", ".Z" );
find( COMPRESSED_FORMAT ).description = i18n( "Compressed File" );
diff --git a/ark/ark.desktop b/ark/ark.desktop
index d3615fe..1e6b4db 100644
--- a/ark/ark.desktop
+++ b/ark/ark.desktop
@@ -1,5 +1,5 @@
[Desktop Entry]
-MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak;application/x-zip-compressed
+MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak;application/x-zip-compressed;application/x-lzma;application/x-xz
GenericName=Archiving Tool
GenericName[af]=Argiveer Program
GenericName[ar]=أداة أرشفة
diff --git a/ark/compressedfile.cpp b/ark/compressedfile.cpp
index 29d29a9..65e21de 100644
--- a/ark/compressedfile.cpp
+++ b/ark/compressedfile.cpp
@@ -124,6 +124,18 @@ void CompressedFile::initData()
m_archiver_program = "bzip2";
m_defaultExtensions << ".bz2" << ".bz";
}
+ if ( mimeType == "application/x-lzma" )
+ {
+ m_unarchiver_program = "unlzma";
+ m_archiver_program = "lzma";
+ m_defaultExtensions << ".lzma";
+ }
+ if ( mimeType == "application/x-xz" )
+ {
+ m_unarchiver_program = "unxz";
+ m_archiver_program = "xz";
+ m_defaultExtensions << ".xz";
+ }
if ( mimeType == "application/x-lzop" )
{ m_unarchiver_program = "lzop";
m_archiver_program = "lzop";
diff --git a/ark/tar.cpp b/ark/tar.cpp
index 6e599c9..e3be8b0 100644
--- a/ark/tar.cpp
+++ b/ark/tar.cpp
@@ -208,6 +208,12 @@ TQString TarArch::getCompressor()
if ( m_fileMimeType == "application/x-tbz" )
return TQString( "bzip2" );
+ if ( m_fileMimeType == "application/x-lzma" )
+ return TQString( "lzma" );
+
+ if ( m_fileMimeType == "application/x-xz" )
+ return TQString( "xz" );
+
if( m_fileMimeType == "application/x-tzo" )
return TQString( "lzop" );
@@ -226,6 +232,12 @@ TQString TarArch::getUnCompressor()
if ( m_fileMimeType == "application/x-tbz" )
return TQString( "bunzip2" );
+ if ( m_fileMimeType == "application/x-lzma" )
+ return TQString( "unlzma" );
+
+ if ( m_fileMimeType == "application/x-xz" )
+ return TQString( "unxz" );
+
if( m_fileMimeType == "application/x-tzo" )
return TQString( "lzop" );