diff --git a/src/lib/history/history.cpp b/src/lib/history/history.cpp index b38af7f53..000492ede 100644 --- a/src/lib/history/history.cpp +++ b/src/lib/history/history.cpp @@ -241,15 +241,13 @@ bool History::optimizeHistory() return query.exec("VACUUM"); } -bool History::clearHistory() +void History::clearHistory() { QSqlQuery query; - if (query.exec("DELETE FROM history")) { - emit resetHistory(); - return true; - } + query.exec(QSL("DELETE FROM history")); + query.exec(QSL("VACUUM")); - return false; + emit resetHistory(); } void History::setSaving(bool state) diff --git a/src/lib/history/history.h b/src/lib/history/history.h index 046e6b387..40f2753c0 100644 --- a/src/lib/history/history.h +++ b/src/lib/history/history.h @@ -62,7 +62,7 @@ public: QVector mostVisited(int count); - bool clearHistory(); + void clearHistory(); bool optimizeHistory(); bool isSaving(); void setSaving(bool state); diff --git a/src/lib/history/historymanager.cpp b/src/lib/history/historymanager.cpp index 126bbbfa9..f0d71a23b 100644 --- a/src/lib/history/historymanager.cpp +++ b/src/lib/history/historymanager.cpp @@ -81,7 +81,6 @@ void HistoryManager::clearHistory() } mApp->history()->clearHistory(); - mApp->history()->optimizeHistory(); } void HistoryManager::search(const QString &searchText)