mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
Merge pull request #1210 from xiaoyifang/opt/code-smell
refactor: use static class method instead of instance method
This commit is contained in:
commit
8798f04312
|
@ -534,7 +534,7 @@ int main( int argc, char ** argv )
|
||||||
auto font = QApplication::font();
|
auto font = QApplication::font();
|
||||||
if ( !cfg.preferences.interfaceFont.isEmpty() && font.family() != cfg.preferences.interfaceFont ) {
|
if ( !cfg.preferences.interfaceFont.isEmpty() && font.family() != cfg.preferences.interfaceFont ) {
|
||||||
font.setFamily( cfg.preferences.interfaceFont );
|
font.setFamily( cfg.preferences.interfaceFont );
|
||||||
app.setFont( font );
|
QApplication::setFont( font );
|
||||||
}
|
}
|
||||||
|
|
||||||
QLocale locale( localeName );
|
QLocale locale( localeName );
|
||||||
|
|
|
@ -1224,16 +1224,16 @@ void MainWindow::commitData()
|
||||||
for ( auto & file : entries ) {
|
for ( auto & file : entries ) {
|
||||||
QString const fileName = file.fileName();
|
QString const fileName = file.fileName();
|
||||||
|
|
||||||
|
if ( dictMap.contains( fileName.toStdString() ) )
|
||||||
|
continue;
|
||||||
//remove both normal index and fts index.
|
//remove both normal index and fts index.
|
||||||
if ( !dictMap.contains( fileName.toStdString() ) ) {
|
auto filePath = file.absoluteFilePath();
|
||||||
auto filePath = file.absoluteFilePath();
|
qDebug() << "remove invalid index files & fts dirs";
|
||||||
qDebug() << "remove invalid index files & fts dirs";
|
|
||||||
|
|
||||||
QFile::remove( filePath );
|
QFile::remove( filePath );
|
||||||
QDir d( filePath + "_FTS_x" );
|
QDir d( filePath + "_FTS_x" );
|
||||||
if ( d.exists() ) {
|
if ( d.exists() ) {
|
||||||
d.removeRecursively();
|
d.removeRecursively();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue