void start() { _redoStack.clear(); if (_undoStack.size() == _undoLevels) { _undoStack.pop_front(); } startUndo(); trackersBegin(); }
// Sets the size of the undoStack void setLevels(std::size_t levels) { if (levels > MAX_UNDO_LEVELS) { levels = MAX_UNDO_LEVELS; } while (_undoStack.size() > levels) { _undoStack.pop_front(); } _undoLevels = levels; }
QStringList UndoManager::getLastFromStack( int count, UndoStack & stack ) { QStringList ret; for( int i = stack.size() - 1; i >= 0 && count > 0; i--, count-- ) { UndoBlock * ub = stack[i]; QString ttl = ub->title(); ret += ttl.isEmpty() ? "Unknown Operation" : ttl; } return ret; }
std::size_t size() const { return _undoStack.size(); }