SetBranchCoverageCommand.h header
#include <ew/core/branching/SetBranchCoverageCommand.h>
Namespace ew::core::branching
SetBranchCoverageCommand class
class ew::core::branching::SetBranchCoverageCommand
Command that replaces the recorded playthrough paths. Undo restores the previous set.
Undoable even though recording is not an edit an author "made": a run taken to try something out is exactly the run a lead does not want counted, and the moment they notice is the moment Undo has to work. It is also how the whole set is cleared and how an import lands, so all three ways coverage changes are one reversible step.
Members
ew::core::branching::SetBranchCoverageCommand::SetBranchCoverageCommand(ew::core::project::Project &project, BranchCoverage coverage, QString description)
Creates a command that sets the recorded paths to coverage when applied, described to the undo UI as description – "Record playthrough", "Clear coverage", "Import runs".
ew::core::branching::SetBranchCoverageCommand::~SetBranchCoverageCommand() override
Destroys the command.
void ew::core::branching::SetBranchCoverageCommand::apply() override
Records the current paths and applies the new ones.
void ew::core::branching::SetBranchCoverageCommand::undo() override
Restores the previous paths.
QString ew::core::branching::SetBranchCoverageCommand::description() const override
Returns the description this command was created with.
Given rather than fixed, because the three things that write coverage are not one action to a reader of the undo list: undoing a clear and undoing a recording are opposite intentions, and one word for both would make the list unreadable at exactly the moment it matters.
ew::core::foundation::OperationSubject ew::core::branching::SetBranchCoverageCommand::subject() const override
Returns the subject this command changes. See Command::subject().