void UndoManager::switchStack(const QString& stackName) { if (stackName == currentDoc_) return; // already current stack currentDoc_ = stackName; if (!stacks_.contains(currentDoc_)) stacks_[currentDoc_] = UndoStack(); stacks_[currentDoc_].setMaxSize(prefs_->getInt("historylength", 100)); for (uint i = 0; i < undoGuis_.size(); ++i) setState(undoGuis_[i]); setTexts(); }
#include "undo.h" UndoStack UndoStack::stack = UndoStack();