Commit b3c24925 authored by Karel Slaný's avatar Karel Slaný

Using SQLiteDb::vacuum() in file db.

parent c5e61663
......@@ -416,7 +416,7 @@ void Files::vacuumFileDbs(void)
userName.toUtf8().constData());
return;
}
fDb->vacuumFileDb();
fDb->vacuum();
}
emit statusBarTextChanged(tr("Operation Vacuum has finished"), false);
......
......@@ -304,18 +304,6 @@ bool FileDb::openDb(const QString &fileName, bool storeToDisk)
return SQLiteDb::openDb(fileName, flags);
}
bool FileDb::vacuumFileDb(void)
{
QSqlQuery query(m_db);
/* Vacuum can take a long time. */
if (query.exec("VACUUM")) {
return true;
}
return false;
}
QList<qint64> FileDb::searchAttachmentName(const QString &phrase) const
{
QSqlQuery query(m_db);
......@@ -517,7 +505,7 @@ bool fileSizeColMakeInt(FileDb &fDb, QSqlDatabase &db)
fDb.commitTransaction();
/* Cannot vacuum from within a transaction. */
fDb.vacuumFileDb();
fDb.vacuum();
return true;
......
......@@ -131,13 +131,6 @@ public:
*/
bool openDb(const QString &fileName, bool storeToDisk);
/*!
* @brief Vacuum file database.
*
* @return True on success.
*/
bool vacuumFileDb(void);
/*!
* @brief Search messages with attachment names matching supplied phrase.
*
......@@ -146,6 +139,9 @@ public:
*/
QList<qint64> searchAttachmentName(const QString &phrase) const;
/* Make some inherited methods public. */
using SQLiteDb::vacuum;
protected:
/*!
* @brief Returns list of tables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment