SetVariablesCommand.h header
#include <ew/core/SetVariablesCommand.h>
Namespace ew::core
SetVariablesCommand class
class ew::core::SetVariablesCommand
Command that replaces the project's story variables (used to add, edit or remove one by pushing the new list). Undo restores the previous list.
Whole-list rather than per-variable for the reason the registry commands beside it are: there is no natural command already in play when a panel edits a project-wide setting, so the tempting shortcut is to call the setter directly – which compiles, works, and silently makes the edit un-undoable. That is the shape of the shipped defect where Version-History Restore wrote through a direct setter and undo lost the only copy of a draft (CL 3233).
Members
ew::core::branching::SetVariablesCommand::SetVariablesCommand(ew::core::project::Project &project, std::vector< Variable > variables)
Creates a command that sets the variables to variables when applied.
ew::core::branching::SetVariablesCommand::~SetVariablesCommand() override
Destroys the command.
void ew::core::branching::SetVariablesCommand::apply() override
Records the current variables and applies the new list.
void ew::core::branching::SetVariablesCommand::undo() override
Restores the previous variables.
QString ew::core::branching::SetVariablesCommand::description() const override
Returns a short description for the undo/redo UI.
ew::core::foundation::OperationSubject ew::core::branching::SetVariablesCommand::subject() const override
Returns the subject this command changes. See Command::subject().