Preliminary xzip/LZMA support

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeutils@1164816 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 14 years ago
parent b678e7f967
commit a4043f1fc0

@ -53,6 +53,9 @@ void ArchiveFormatInfo::buildFormatInfos()
addFormatInfo( TAR_FORMAT, "application/x-tarz", ".tar.z" ); addFormatInfo( TAR_FORMAT, "application/x-tarz", ".tar.z" );
addFormatInfo( TAR_FORMAT, "application/x-tbz", ".tar.bz2" ); addFormatInfo( TAR_FORMAT, "application/x-tbz", ".tar.bz2" );
addFormatInfo( TAR_FORMAT, "application/x-tbz2", ".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 // x-tar as the last one to get its comment for all the others, too
addFormatInfo( TAR_FORMAT, "application/x-tar", ".tar" ); 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-gzip", ".gz" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip", ".bz" ); addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip", ".bz" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-bzip2", ".bz2" ); 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-lzop", ".lzo" );
addFormatInfo( COMPRESSED_FORMAT, "application/x-compress", ".Z" ); addFormatInfo( COMPRESSED_FORMAT, "application/x-compress", ".Z" );
find( COMPRESSED_FORMAT ).description = i18n( "Compressed File" ); find( COMPRESSED_FORMAT ).description = i18n( "Compressed File" );

@ -1,5 +1,5 @@
[Desktop Entry] [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=Archiving Tool
GenericName[af]=Argiveer Program GenericName[af]=Argiveer Program
GenericName[ar]=أداة أرشفة GenericName[ar]=أداة أرشفة

@ -124,6 +124,18 @@ void CompressedFile::initData()
m_archiver_program = "bzip2"; m_archiver_program = "bzip2";
m_defaultExtensions << ".bz2" << ".bz"; 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" ) if ( mimeType == "application/x-lzop" )
{ m_unarchiver_program = "lzop"; { m_unarchiver_program = "lzop";
m_archiver_program = "lzop"; m_archiver_program = "lzop";

@ -208,6 +208,12 @@ TQString TarArch::getCompressor()
if ( m_fileMimeType == "application/x-tbz" ) if ( m_fileMimeType == "application/x-tbz" )
return TQString( "bzip2" ); 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" ) if( m_fileMimeType == "application/x-tzo" )
return TQString( "lzop" ); return TQString( "lzop" );
@ -226,6 +232,12 @@ TQString TarArch::getUnCompressor()
if ( m_fileMimeType == "application/x-tbz" ) if ( m_fileMimeType == "application/x-tbz" )
return TQString( "bunzip2" ); 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" ) if( m_fileMimeType == "application/x-tzo" )
return TQString( "lzop" ); return TQString( "lzop" );

Loading…
Cancel
Save