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();
if ( !cfg.preferences.interfaceFont.isEmpty() && font.family() != cfg.preferences.interfaceFont ) {
font.setFamily( cfg.preferences.interfaceFont );
app.setFont( font );
QApplication::setFont( font );
}
QLocale locale( localeName );

View file

@ -1224,16 +1224,16 @@ void MainWindow::commitData()
for ( auto & file : entries ) {
QString const fileName = file.fileName();
if ( dictMap.contains( fileName.toStdString() ) )
continue;
//remove both normal index and fts index.
if ( !dictMap.contains( fileName.toStdString() ) ) {
auto filePath = file.absoluteFilePath();
qDebug() << "remove invalid index files & fts dirs";
auto filePath = file.absoluteFilePath();
qDebug() << "remove invalid index files & fts dirs";
QFile::remove( filePath );
QDir d( filePath + "_FTS_x" );
if ( d.exists() ) {
d.removeRecursively();
}
QFile::remove( filePath );
QDir d( filePath + "_FTS_x" );
if ( d.exists() ) {
d.removeRecursively();
}
}
}