diff --git a/loaddictionaries.cc b/loaddictionaries.cc index 60a8adb5..24bdd1aa 100644 --- a/loaddictionaries.cc +++ b/loaddictionaries.cc @@ -131,14 +131,6 @@ void LoadDictionaries::handlePath( Config::Path const & path ) allFiles.push_back( FsEncoding::encode( QDir::toNativeSeparators( fullName ) ) ); } - { - vector< sptr< Dictionary::Class > > mdxDictionaries = - Mdx::makeDictionaries( allFiles, FsEncoding::encode( Config::getIndexDir() ), *this ); - - dictionaries.insert( dictionaries.end(), mdxDictionaries.begin(), - mdxDictionaries.end() ); - } - { vector< sptr< Dictionary::Class > > bglDictionaries = Bgl::makeDictionaries( allFiles, FsEncoding::encode( Config::getIndexDir() ), *this ); @@ -207,6 +199,13 @@ void LoadDictionaries::handlePath( Config::Path const & path ) dictionaries.insert( dictionaries.end(), zipSoundsDictionaries.begin(), zipSoundsDictionaries.end() ); } + { + vector< sptr< Dictionary::Class > > mdxDictionaries = + Mdx::makeDictionaries( allFiles, FsEncoding::encode( Config::getIndexDir() ), *this ); + + dictionaries.insert( dictionaries.end(), mdxDictionaries.begin(), + mdxDictionaries.end() ); + } { vector< sptr< Dictionary::Class > > glsDictionaries = Gls::makeDictionaries( allFiles, FsEncoding::encode( Config::getIndexDir() ), *this ); diff --git a/mdx.cc b/mdx.cc index dc838b01..4f76da56 100644 --- a/mdx.cc +++ b/mdx.cc @@ -1455,21 +1455,18 @@ static void findResourceFiles( string const & mdx, vector< string > & dictFiles } } -vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > & fileNames, +vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & initializing ) { vector< sptr< Dictionary::Class > > dictionaries; - for ( vector< string >::iterator i = fileNames.begin(); i != fileNames.end(); ) + for ( vector< string >::const_iterator i = fileNames.begin(); i != fileNames.end(); ++i ) { // Skip files with the extensions different to .mdx to speed up the // scanning if ( i->size() < 4 || strcasecmp( i->c_str() + ( i->size() - 4 ), ".mdx" ) != 0 ) - { - i++; continue; - } vector< string > dictFiles( 1, *i ); findResourceFiles( *i, dictFiles ); @@ -1656,8 +1653,6 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > & fileNam } dictionaries.push_back( new MdxDictionary( dictId, indexFile, dictFiles ) ); - - i=fileNames.erase(i); } return dictionaries; diff --git a/mdx.hh b/mdx.hh index 4b2895cf..e8f56ce2 100644 --- a/mdx.hh +++ b/mdx.hh @@ -12,7 +12,7 @@ namespace Mdx using std::vector; using std::string; -vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > & fileNames, +vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & fileNames, string const & indicesDir, Dictionary::Initializing & ) ;