diff --git a/src/main.cc b/src/main.cc index 63b53288..68750cc6 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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 ); diff --git a/src/ui/mainwindow.cc b/src/ui/mainwindow.cc index 4e1a88f9..a5f0be9d 100644 --- a/src/ui/mainwindow.cc +++ b/src/ui/mainwindow.cc @@ -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(); } } }