Fixed some bugs in DB cleaning.
This commit is contained in:
parent
fc05ba29b4
commit
faad5f9464
3 changed files with 17 additions and 3 deletions
|
@ -8,6 +8,7 @@ Added:
|
||||||
|
|
||||||
Fixed:
|
Fixed:
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Database cleanup tools now do support "shrinking" in in-memory databases, althouth it is bit hacky.</li>
|
||||||
<li>Google suggest API now prevents completion if ENTER in address textbox is hit.</li>
|
<li>Google suggest API now prevents completion if ENTER in address textbox is hit.</li>
|
||||||
<li>Double-clickin on message now results in opening source article in mini web browser.</li>
|
<li>Double-clickin on message now results in opening source article in mini web browser.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -129,6 +129,7 @@ void FormDatabaseCleanup::loadDatabaseInfo() {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->m_txtDatabaseType->setText(qApp->database()->humanDriverName(qApp->database()->activeDatabaseDriver()));
|
m_ui->m_txtDatabaseType->setText(qApp->database()->humanDriverName(qApp->database()->activeDatabaseDriver()));
|
||||||
m_ui->m_checkShrink->setEnabled(qApp->database()->activeDatabaseDriver() == DatabaseFactory::SQLITE);
|
m_ui->m_checkShrink->setEnabled(qApp->database()->activeDatabaseDriver() == DatabaseFactory::SQLITE ||
|
||||||
|
qApp->database()->activeDatabaseDriver() == DatabaseFactory::SQLITE_MEMORY);
|
||||||
m_ui->m_checkShrink->setChecked(m_ui->m_checkShrink->isEnabled());
|
m_ui->m_checkShrink->setChecked(m_ui->m_checkShrink->isEnabled());
|
||||||
}
|
}
|
||||||
|
|
|
@ -704,8 +704,20 @@ QSqlDatabase DatabaseFactory::sqliteConnection(const QString &connection_name, D
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DatabaseFactory::sqliteVacuumDatabase() {
|
bool DatabaseFactory::sqliteVacuumDatabase() {
|
||||||
QSqlDatabase database = sqliteConnection(objectName(), FromSettings);
|
QSqlDatabase database;
|
||||||
|
|
||||||
|
if (m_activeDatabaseDriver == SQLITE) {
|
||||||
|
database = sqliteConnection(objectName(), StrictlyFileBased);
|
||||||
|
}
|
||||||
|
else if (m_activeDatabaseDriver == SQLITE_MEMORY) {
|
||||||
|
sqliteSaveMemoryDatabase();
|
||||||
|
database = sqliteConnection(objectName(), StrictlyFileBased);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
QSqlQuery query_vacuum(database);
|
QSqlQuery query_vacuum(database);
|
||||||
|
|
||||||
return query_vacuum.exec("VACUUM");
|
return query_vacuum.exec("VACUUM");
|
||||||
|
|
Loading…
Add table
Reference in a new issue