From 4a7a9f41a5d5084aa98379422facc449888552c0 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 18 Aug 2018 15:36:09 +0900 Subject: A few code clean up and improvements Signed-off-by: Michele Calgaro --- ark/tar.cpp | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'ark/tar.cpp') diff --git a/ark/tar.cpp b/ark/tar.cpp index 33f27a6..0c6f3d2 100644 --- a/ark/tar.cpp +++ b/ark/tar.cpp @@ -184,7 +184,6 @@ void TarArch::updateProgress( TDEProcess * _proc, char *_buffer, int _bufflen ) _proc->kill(); KMessageBox::error(0, i18n("Trouble writing to the archive...")); kdWarning( 1601 ) << "trouble updating tar archive" << endl; - //kdFatal( 1601 ) << "trouble updating tar archive" << endl; } } @@ -198,17 +197,16 @@ TQString TarArch::getCompressor() if ( m_fileMimeType == "application/x-tgz" ) return TQString( "gzip" ); - if ( m_fileMimeType == "application/x-tbz" ) + if ( m_fileMimeType == "application/x-tbz" ) return TQString( "bzip2" ); - if (m_fileMimeType == "application/x-tlz") { - return TQString("lzip"); - } + if ( m_fileMimeType == "application/x-tlz" ) + return TQString( "lzip" ); - if ( m_fileMimeType == "application/x-txz" ) - return TQString( "xz" ); + if ( m_fileMimeType == "application/x-txz" ) + return TQString( "xz" ); - if( m_fileMimeType == "application/x-tzo" ) + if ( m_fileMimeType == "application/x-tzo" ) return TQString( "lzop" ); return TQString(); @@ -223,24 +221,22 @@ TQString TarArch::getUnCompressor() if ( m_fileMimeType == "application/x-tgz" ) return TQString( "gunzip" ); - if ( m_fileMimeType == "application/x-tbz" ) + if ( m_fileMimeType == "application/x-tbz" ) return TQString( "bunzip2" ); - if (m_fileMimeType == "application/x-tlz") { - return TQString("lzip"); - } + if ( m_fileMimeType == "application/x-tlz" ) + return TQString( "lzip" ); - if ( m_fileMimeType == "application/x-txz" ) + if ( m_fileMimeType == "application/x-txz" ) return TQString( "unxz" ); - if( m_fileMimeType == "application/x-tzo" ) + if ( m_fileMimeType == "application/x-tzo" ) return TQString( "lzop" ); return TQString(); } -void -TarArch::open() +void TarArch::open() { if ( compressed ) TQFile::remove(tmpfile); // just to make sure @@ -396,7 +392,7 @@ void TarArch::createTmp() if (strUncompressor == "lzip") { *kp << "-d"; } - if (strUncompressor == "lzop") + else if (strUncompressor == "lzop") { // setting up a pty for lzop, since it doesn't like stdin to // be /dev/null ( "no filename allowed when reading from stdin" ) -- cgit v1.2.1