diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 2714f97..bb6f59d 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -408,6 +408,17 @@ void MainWindow::initSettingsTabs() void MainWindow::saveSettings() { + if(ui->chkRemoveOldDb->isChecked()) + { + bool result = QFile::remove(Common::databasePath()); + if(!result) + { + QMessageBox::critical(this, "Error removing database", + "Failed to remove old database. Settings not saved."); + return; + } + } + QSettings settings; QString pdfViewerCmd = ui->txtSettingPdfPreviewerCmd->text(); diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 2d707a6..24a98ac 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -532,6 +532,13 @@ + + + + Remove old database on save + + +