Fix sound files search in .zips

This commit is contained in:
Abs62 2012-10-04 18:33:26 +04:00
parent 8e4b38400a
commit 4358b43182

View file

@ -250,7 +250,13 @@ sptr< Dictionary::DataRequest > ZipSoundsDictionary::getArticle( wstring const &
sptr< Dictionary::DataRequest > ZipSoundsDictionary::getResource( string const & name ) sptr< Dictionary::DataRequest > ZipSoundsDictionary::getResource( string const & name )
throw( std::exception ) throw( std::exception )
{ {
vector< WordArticleLink > chain = findArticles( Utf8::decode( name ) ); // See if the name ends in .wav. Remove that extension then
string strippedName =
( name.size() > 3 && ( name.compare( name.size() - 4, 4, ".wav" ) == 0 ) ) ?
string( name, 0, name.size() - 4 ) : name;
vector< WordArticleLink > chain = findArticles( Utf8::decode( strippedName ) );
if ( chain.empty() ) if ( chain.empty() )
return new Dictionary::DataRequestInstant( false ); // No such resource return new Dictionary::DataRequestInstant( false ); // No such resource