Merge pull request #1210 from xiaoyifang/opt/code-smell

refactor: use static class method instead of instance method
This commit is contained in:
xiaoyifang 2023-10-07 21:51:26 +08:00 committed by GitHub
commit 8798f04312
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View file

@ -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 );

View file

@ -1224,8 +1224,9 @@ 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";
@ -1236,7 +1237,6 @@ void MainWindow::commitData()
} }
} }
} }
}
try { try {