mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: [mdx] use file name as dictionary name when title has not been set
This commit is contained in:
parent
15207cf400
commit
2ca5568b84
|
@ -317,6 +317,12 @@ MdxDictionary::MdxDictionary( string const & id, string const & indexFile, vecto
|
|||
dictionaryName = string( &buf.front(), len );
|
||||
}
|
||||
|
||||
//fallback, use filename as dictionary name
|
||||
if ( dictionaryName.empty() ) {
|
||||
QFileInfo f( QString::fromUtf8( dictionaryFiles[ 0 ].c_str() ) );
|
||||
dictionaryName = f.baseName().toStdString();
|
||||
}
|
||||
|
||||
// then read the dictionary's encoding
|
||||
len = idx.read< uint32_t >();
|
||||
if ( len > 0 ) {
|
||||
|
|
Loading…
Reference in a new issue