Clear history when setting deck.

Took 6 minutes
This commit is contained in:
Lukas Brübach 2025-11-19 23:16:44 +01:00
parent 126b338d3e
commit d4afa0e330
3 changed files with 11 additions and 0 deletions

View file

@ -7,6 +7,14 @@ void DeckListHistoryManager::save(DeckListMemento *memento)
emit undoRedoStateChanged();
}
void DeckListHistoryManager::clear()
{
undoStack.clear();
redoStack.clear();
emit undoRedoStateChanged();
}
void DeckListHistoryManager::undo(DeckList *deck)
{
if (undoStack.isEmpty()) {

View file

@ -22,6 +22,8 @@ public:
void save(DeckListMemento *memento);
void clear();
bool canUndo() const
{
return !undoStack.isEmpty();