mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 18:40:13 -06:00
VacuumDialog: Fix dialog after savepoint change
Call saveAll() in the VacuumDialog to make sure to release all savepoints. Also cancel the dialog when no object was select but the OK button clicked. This avoids an unnecessary DB reload in the main window.
This commit is contained in:
@@ -38,12 +38,12 @@ VacuumDialog::~VacuumDialog()
|
||||
void VacuumDialog::accept()
|
||||
{
|
||||
if(ui->treeSelectedObjects->selectedItems().count() == 0)
|
||||
QDialog::accept();
|
||||
return QDialog::reject();
|
||||
|
||||
QApplication::setOverrideCursor(Qt::WaitCursor);
|
||||
|
||||
// Commit all changes first
|
||||
db->save();
|
||||
db->saveAll();
|
||||
|
||||
// All items selected?
|
||||
if(ui->treeSelectedObjects->selectedItems().count() == ui->treeSelectedObjects->topLevelItemCount())
|
||||
@@ -57,7 +57,6 @@ void VacuumDialog::accept()
|
||||
db->executeSQL(QString("VACUUM `%1`;").arg(item->text(0)), false);
|
||||
}
|
||||
|
||||
db->setDirty(false);
|
||||
QApplication::restoreOverrideCursor();
|
||||
QDialog::accept();
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ class DBBrowserDB;
|
||||
class VacuumDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
explicit VacuumDialog(DBBrowserDB* _db, QWidget* parent = 0);
|
||||
~VacuumDialog();
|
||||
|
||||
|
||||
private:
|
||||
Ui::VacuumDialog* ui;
|
||||
DBBrowserDB* db;
|
||||
|
||||
Reference in New Issue
Block a user