Remove History::optimizeHistory() function

It is no longer needed, this function was little confusing
as it actually only executed VACUUM.
Instead, execute VACUUM after clearing all history in
History::clearHistory()
remotes/origin/falkon
David Rosca 12 years ago
parent 1a54cda705
commit 15bb39689c
  1. 10
      src/lib/history/history.cpp
  2. 2
      src/lib/history/history.h
  3. 1
      src/lib/history/historymanager.cpp

@ -241,15 +241,13 @@ bool History::optimizeHistory()
return query.exec("VACUUM"); return query.exec("VACUUM");
} }
bool History::clearHistory() void History::clearHistory()
{ {
QSqlQuery query; QSqlQuery query;
if (query.exec("DELETE FROM history")) { query.exec(QSL("DELETE FROM history"));
emit resetHistory(); query.exec(QSL("VACUUM"));
return true;
}
return false; emit resetHistory();
} }
void History::setSaving(bool state) void History::setSaving(bool state)

@ -62,7 +62,7 @@ public:
QVector<HistoryEntry> mostVisited(int count); QVector<HistoryEntry> mostVisited(int count);
bool clearHistory(); void clearHistory();
bool optimizeHistory(); bool optimizeHistory();
bool isSaving(); bool isSaving();
void setSaving(bool state); void setSaving(bool state);

@ -81,7 +81,6 @@ void HistoryManager::clearHistory()
} }
mApp->history()->clearHistory(); mApp->history()->clearHistory();
mApp->history()->optimizeHistory();
} }
void HistoryManager::search(const QString &searchText) void HistoryManager::search(const QString &searchText)

Loading…
Cancel
Save