GUI indexing: only ask a confirmation about resetting the index if the dbdir currently exists

This commit is contained in:
Jean-Francois Dockes 2022-08-22 07:56:43 +02:00
parent b8e062f66c
commit 02a4a69482

View File

@ -379,9 +379,12 @@ void RclMain::rebuildIndex()
LOGERR("RclMain::rebuildIndex: current indexer exec not null\n" );
return;
}
int rep = QMessageBox::warning(
0, tr("Erasing index"), tr("Reset the index and start from scratch ?"),
QMessageBox::Ok, QMessageBox::Cancel, QMessageBox::NoButton);
int rep = QMessageBox::Ok;
if (path_exists(theconfig->getDbDir())) {
rep = QMessageBox::warning(
0, tr("Erasing index"), tr("Reset the index and start from scratch ?"),
QMessageBox::Ok, QMessageBox::Cancel, QMessageBox::NoButton);
}
if (rep == QMessageBox::Ok) {
#ifdef _WIN32
// Under windows, it is necessary to close the db here,