mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
fix: epwing rebuild issue (#1094)
* fix: epwing rebuild issue * [autofix.ci] apply automated fixes * fix: pro project file --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
78ef410b3b
commit
98af55557e
|
@ -601,8 +601,7 @@ win32{
|
|||
RESOURCES += resources.qrc \
|
||||
src/scripts/scripts.qrc \
|
||||
icons/flags.qrc \
|
||||
src/stylesheets/css.qrc \
|
||||
src/ui/resources.qrc
|
||||
src/stylesheets/css.qrc
|
||||
#EXTRA_TRANSLATIONS += thirdparty/qwebengine_ts/qtwebengine_zh_CN.ts
|
||||
TRANSLATIONS += $$files(locale/*.ts)
|
||||
|
||||
|
|
|
@ -1175,6 +1175,10 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
|
|||
dict.setSubBook( sb );
|
||||
|
||||
dir = QString::fromStdString( mainDirectory ) + Utils::Fs::separator() + dict.getCurrentSubBookDirectory();
|
||||
QDir _dir( dir );
|
||||
if ( !_dir.exists() ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Epwing::Book::EpwingBook::collectFilenames( dir, dictFiles );
|
||||
|
||||
|
@ -1185,7 +1189,8 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
|
|||
dictFiles.push_back( fontSubName.toStdString() );
|
||||
else {
|
||||
//to make the subbook in different index.
|
||||
dictFiles.push_back( QString::number( sb ).toStdString() );
|
||||
auto virtual_file = QString::fromStdString( mainDirectory ) + QDir::separator() + QString::number( sb );
|
||||
dictFiles.push_back( virtual_file.toStdString() );
|
||||
}
|
||||
|
||||
// Check if we need to rebuid the index
|
||||
|
@ -1275,4 +1280,4 @@ vector< sptr< Dictionary::Class > > makeDictionaries( vector< string > const & f
|
|||
|
||||
} // namespace Epwing
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -294,24 +294,6 @@ void loadDictionaries( QWidget * parent,
|
|||
}
|
||||
}
|
||||
|
||||
QDir indexDir( Config::getIndexDir() );
|
||||
|
||||
QStringList allIdxFiles = indexDir.entryList( QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks );
|
||||
|
||||
for ( const auto & file : allIdxFiles ) {
|
||||
if ( file.size() >= 32 && ids.find( file.left( 32 ).toStdString() ) == ids.end() ) {
|
||||
if ( QFile::exists( file ) ) {
|
||||
indexDir.remove( file );
|
||||
}
|
||||
else {
|
||||
// must be folder .
|
||||
auto dirPath = Utils::Path::combine( Config::getIndexDir(), file );
|
||||
QDir t( dirPath );
|
||||
t.removeRecursively();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run deferred inits
|
||||
|
||||
if ( doDeferredInit_ )
|
||||
|
|
Loading…
Reference in a new issue