This action will force synchronization from 陈炳煌/sqlitebrowser, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
#include "VacuumDialog.h"#include "ui_VacuumDialog.h"#include "sqlitedb.h"#include <QTreeWidgetItem>VacuumDialog::VacuumDialog(DBBrowserDB* _db, QWidget* parent) :QDialog(parent),ui(new Ui::VacuumDialog),db(_db){// Create UIui->setupUi(this);// Show warning if DB is dirtyui->labelSavepointWarning->setVisible(db->getDirty());// Populate list of objects to compact. We just support vacuuming the different schemas here.for(const auto& it : db->schemata){QTreeWidgetItem* item = new QTreeWidgetItem(ui->treeDatabases);item->setText(0, QString::fromStdString(it.first));item->setIcon(0, QIcon(QString(":icons/database")));ui->treeDatabases->addTopLevelItem(item);}// Select the first item which should always be the main schemaui->treeDatabases->setCurrentItem(ui->treeDatabases->topLevelItem(0));}VacuumDialog::~VacuumDialog(){delete ui;}void VacuumDialog::accept(){if(ui->treeDatabases->selectedItems().count() == 0)return QDialog::reject();QApplication::setOverrideCursor(Qt::WaitCursor);// Commit all changes firstdb->releaseAllSavepoints();// Loop through all selected databases and vacuum them individuallyQList<QTreeWidgetItem*> selection = ui->treeDatabases->selectedItems();for(const QTreeWidgetItem* item : selection)db->executeSQL(QString("VACUUM %1;").arg(sqlb::escapeIdentifier(item->text(0))), false);QApplication::restoreOverrideCursor();QDialog::accept();}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。