Code improvements

This commit is contained in:
Valentino Orlandi 2022-10-23 18:15:41 +02:00
parent 3ed82a8ba9
commit 24b0e8b599
Signed by: elB4RTO
GPG key ID: 1719E976DB2D4E71
3 changed files with 7 additions and 7 deletions

View file

@ -603,7 +603,7 @@ void MainWindow::readConfigs()
}*/ }*/
} }
} catch ( const std::ios_base::failure&/* err*/ ) { } catch ( const std::ios_base::failure& ) {
// failed reading // failed reading
proceed = false; proceed = false;
err_msg = DialogSec::tr("An error occured while reading the configuration file"); err_msg = DialogSec::tr("An error occured while reading the configuration file");
@ -1752,7 +1752,7 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked()
item = this->craplog.getLogFileItem( item = this->craplog.getLogFileItem(
this->ui->listLogFiles->selectedItems().takeFirst()->text(0) ); this->ui->listLogFiles->selectedItems().takeFirst()->text(0) );
} catch (const GenericException& e) { } catch ( const GenericException& ) {
// failed to find file // failed to find file
proceed = false; proceed = false;
DialogSec::errFileNotFound( QString::fromStdString( item.path ), true ); DialogSec::errFileNotFound( QString::fromStdString( item.path ), true );
@ -1807,7 +1807,7 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked()
// try reading as gzip compressed file // try reading as gzip compressed file
GZutils::readFile( item.path, content ); GZutils::readFile( item.path, content );
} catch (const GenericException) { } catch ( const GenericException& ) {
// failed closing file pointer // failed closing file pointer
throw; throw;
@ -1819,7 +1819,7 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked()
IOutils::readFile( item.path, content ); IOutils::readFile( item.path, content );
} }
} catch (const GenericException/*& e*/) { } catch ( const GenericException& ) {
// failed closing gzip file pointer // failed closing gzip file pointer
proceed = false; proceed = false;
// >> e.what() << // // >> e.what() << //
@ -1827,7 +1827,7 @@ void MainWindow::on_button_LogFiles_ViewFile_clicked()
DialogSec::tr("Failed to read gzipped file"), DialogSec::tr("Failed to read gzipped file"),
item.name) ); item.name) );
/*} catch (const std::ios_base::failure& err) { /*} catch ( const std::ios_base::failure& err ) {
// failed reading as text // failed reading as text
proceed = false; proceed = false;
// >> err.what() << // // >> err.what() << //

View file

@ -936,7 +936,7 @@ void Craplog::joinLogLines()
QString::fromStdString( file.path ) QString::fromStdString( file.path )
).toStdString() ); ).toStdString() );
} catch (const std::ios_base::failure& err) { } catch ( const std::ios_base::failure& ) {
// failed reading as text // failed reading as text
throw GenericException( QString("%1:\n%2").arg( throw GenericException( QString("%1:\n%2").arg(
DialogSec::tr("An error accured while reading the file"), DialogSec::tr("An error accured while reading the file"),

View file

@ -100,7 +100,7 @@ std::string HashOps::digestFile( const std::string& file_path )
QString::fromStdString( file_path ) QString::fromStdString( file_path )
).toStdString() ); ).toStdString() );
} catch (const std::ios_base::failure& err) { } catch ( const std::ios_base::failure& ) {
// failed reading as text // failed reading as text
throw GenericException( QString("%1:\n%2").arg( throw GenericException( QString("%1:\n%2").arg(
DialogSec::tr("An error accured while reading the file"), DialogSec::tr("An error accured while reading the file"),