Commit fd34df61 authored by Willyanto Willyanto's avatar Willyanto Willyanto Committed by Nate Graham
Browse files

Perform initialization in initialization list

Fixes variable is assigned in constructor body. Consider performing
initialization in initialization list. (CWE-398)
parent ca83953d
Pipeline #254874 passed with stage
in 2 minutes and 14 seconds
......@@ -86,9 +86,9 @@ void SearchJob::slotJobData( KIO::Job *job, const QByteArray &data )
SearchHandler::SearchHandler( const KConfigGroup &cg )
: mLang( QLocale().bcp47Name().left( 2 ) )
, mDocumentTypes( cg.readEntry( "DocumentTypes" , QStringList() ) )
{
mLang = QLocale().bcp47Name().left( 2 );
mDocumentTypes = cg.readEntry( "DocumentTypes" , QStringList() );
}
SearchHandler::~SearchHandler()
......@@ -115,12 +115,12 @@ QStringList SearchHandler::documentTypes() const
ExternalProcessSearchHandler::ExternalProcessSearchHandler( const KConfigGroup &cg )
: SearchHandler( cg )
, mSearchCommand( cg.readEntry( "SearchCommand" ) )
, mSearchUrl( cg.readEntry( "SearchUrl" ) )
, mSearchBinary( cg.readEntry( "SearchBinary" ) )
, mIndexCommand( cg.readEntry( "IndexCommand" ) )
, mTryExec( cg.readEntry( "TryExec" ) )
{
mSearchCommand = cg.readEntry( "SearchCommand" );
mSearchUrl = cg.readEntry( "SearchUrl" );
mIndexCommand = cg.readEntry( "IndexCommand" );
mTryExec = cg.readEntry( "TryExec" );
mSearchBinary = cg.readEntry( "SearchBinary" );
const QStringList searchBinaryPaths = cg.readEntry( "SearchBinaryPaths", QStringList() );
mSearchBinary = QStandardPaths::findExecutable(mSearchBinary, searchBinaryPaths);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment