MoveTaskCommand.h header
#include <ew/core/MoveTaskCommand.h>
Namespace ew::core
MoveTaskCommand class
class ew::core::MoveTaskCommand
Command that moves a task on the kanban board: it takes a new status (its column) and is inserted at a target position among that column's tasks. Affected tasks in the source and destination columns are renumbered so their sort indices stay contiguous. Undo restores the status and position of every task the move touched.
Members
ew::core::MoveTaskCommand::MoveTaskCommand(Project &project, ContentId taskId, QString newStatus, int targetIndex)
Creates a command that, when applied, moves taskId to newStatus at targetIndex (clamped to the destination column's task count) within project.
ew::core::MoveTaskCommand::~MoveTaskCommand() override
Defaulted.
void ew::core::MoveTaskCommand::apply() override
Applies the move, recording the previous placement of every touched task.
void ew::core::MoveTaskCommand::undo() override
Restores the status and position of every task the move touched.
QString ew::core::MoveTaskCommand::description() const override
Returns a short description for the undo/redo UI.
Placement struct
struct ew::core::Placement
The status and position a task had before the move, captured for undo.
Members
QString ew::core::MoveTaskCommand::Placement::status
The status (column) the task was in.
int ew::core::MoveTaskCommand::Placement::sortIndex
The task's position within that column.