mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 04:27:43 +00:00
LibGUI: Rename UndoStack internals
Since we keep a stack of command combos, let's call entries on the stack "Combo" instead of "UndoCommandsContainer". And since it has a vector of commands, let's call it "commands" instead of "m_undo_vector".
This commit is contained in:
parent
b25eba10d2
commit
295cc123c7
2 changed files with 14 additions and 15 deletions
|
@ -19,7 +19,7 @@ public:
|
|||
void push(NonnullOwnPtr<Command>&&);
|
||||
|
||||
bool can_undo() const { return m_stack_index < m_stack.size() && !m_stack.is_empty(); }
|
||||
bool can_redo() const { return m_stack_index > 0 && !m_stack.is_empty() && m_stack[m_stack_index - 1].m_undo_vector.size() > 0; }
|
||||
bool can_redo() const { return m_stack_index > 0 && !m_stack.is_empty() && m_stack[m_stack_index - 1].commands.size() > 0; }
|
||||
|
||||
void undo();
|
||||
void redo();
|
||||
|
@ -32,11 +32,11 @@ public:
|
|||
void clear();
|
||||
|
||||
private:
|
||||
struct UndoCommandsContainer {
|
||||
NonnullOwnPtrVector<Command> m_undo_vector;
|
||||
struct Combo {
|
||||
NonnullOwnPtrVector<Command> commands;
|
||||
};
|
||||
|
||||
NonnullOwnPtrVector<UndoCommandsContainer> m_stack;
|
||||
NonnullOwnPtrVector<Combo> m_stack;
|
||||
size_t m_stack_index { 0 };
|
||||
Optional<size_t> m_clean_index;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue