diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-08-18 15:36:09 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-08-18 15:36:09 +0900 |
commit | 4a7a9f41a5d5084aa98379422facc449888552c0 (patch) | |
tree | cd147247e34c101a85d94276d46a7eb12af19a07 /ark/compressedfile.cpp | |
parent | 4a66f15d28b50197e79974c6ff81e67f908b4eb1 (diff) | |
download | tdeutils-4a7a9f41a5d5084aa98379422facc449888552c0.tar.gz tdeutils-4a7a9f41a5d5084aa98379422facc449888552c0.zip |
A few code clean up and improvements
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'ark/compressedfile.cpp')
-rw-r--r-- | ark/compressedfile.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/ark/compressedfile.cpp b/ark/compressedfile.cpp index 86e5fbd..a00bc16 100644 --- a/ark/compressedfile.cpp +++ b/ark/compressedfile.cpp @@ -112,47 +112,46 @@ void CompressedFile::initData() m_archiver_program = "gzip"; m_defaultExtensions << ".gz" << "-gz" << ".z" << "-z" << "_z" << ".Z"; } - if ( mimeType == "application/x-bzip" ) + else if ( mimeType == "application/x-bzip" ) { m_unarchiver_program = "bunzip"; m_archiver_program = "bzip"; m_defaultExtensions << ".bz"; } - if ( mimeType == "application/x-bzip2" ) + else if ( mimeType == "application/x-bzip2" ) { m_unarchiver_program = "bunzip2"; m_archiver_program = "bzip2"; m_defaultExtensions << ".bz2" << ".bz"; } - if (mimeType == "application/x-lzip") { + else if ( mimeType == "application/x-lzip" ) { m_unarchiver_program = "lzip"; m_archiver_program = "lzip"; m_defaultExtensions << ".lz"; } - if ( mimeType == "application/x-lzma" ) + else if ( mimeType == "application/x-lzma" ) { m_unarchiver_program = "unlzma"; m_archiver_program = "lzma"; m_defaultExtensions << ".lzma"; } - if ( mimeType == "application/x-xz" ) + else if ( mimeType == "application/x-xz" ) { m_unarchiver_program = "unxz"; m_archiver_program = "xz"; m_defaultExtensions << ".xz"; } - if ( mimeType == "application/x-lzop" ) + else if ( mimeType == "application/x-lzop" ) { m_unarchiver_program = "lzop"; m_archiver_program = "lzop"; m_defaultExtensions << ".lzo"; } - if ( mimeType == "application/x-compress" ) + else if ( mimeType == "application/x-compress" ) { m_unarchiver_program = TDEGlobal::dirs()->findExe( "uncompress" ).isNull()? "gunzip" : "uncompress"; m_archiver_program = "compress"; m_defaultExtensions = ".Z"; } - } TQString CompressedFile::extension() @@ -192,10 +191,10 @@ void CompressedFile::open() TDEProcess *kp = m_currentProcess = new TDEProcess; kp->clearArguments(); *kp << m_unarchiver_program << "-f" ; - if (m_unarchiver_program == "lzip") { + if ( m_unarchiver_program == "lzip" ) { *kp << "-d"; } - if ( m_unarchiver_program == "lzop") + else if ( m_unarchiver_program == "lzop" ) { *kp << "-d"; // lzop hack, see comment in tar.cpp createTmp() |