History items can now be removed.

Refs #23
This commit is contained in:
Florian Geyer 2012-05-18 19:22:22 +02:00
parent e4a5cd214f
commit 4797926be6
7 changed files with 126 additions and 7 deletions

View file

@ -367,6 +367,21 @@ void Entry::addHistoryItem(Entry* entry)
Q_EMIT modified();
}
void Entry::removeHistoryItems(QList<Entry*> historyEntries)
{
bool emitModified = historyEntries.count() > 0;
Q_FOREACH (Entry* entry, historyEntries) {
Q_ASSERT(!entry->parent());
Q_ASSERT(entry->uuid() == uuid());
Q_ASSERT(m_history.removeAll(entry) > 0);
delete entry;
}
if (emitModified) {
Q_EMIT modified();
}
}
void Entry::truncateHistory() {
const Database* db = database();