RemoveCategoryCommand.h header

#include <ew/core/RemoveCategoryCommand.h>

Namespace ew::core

RemoveCategoryCommand class

class ew::core::RemoveCategoryCommand

Command that removes a category from a taxonomy. Because removal promotes the category's children to its former parent, undo restores the category and re-parents those children back under it, so the tree is returned exactly to its prior shape.

Members

ew::core::RemoveCategoryCommand::RemoveCategoryCommand(Taxonomy &taxonomy, CategoryId id)

Creates a command that removes the category id from taxonomy when applied.

ew::core::RemoveCategoryCommand::~RemoveCategoryCommand() override

Destroys the command.

void ew::core::RemoveCategoryCommand::apply() override

Records the category and its direct children, then removes it.

void ew::core::RemoveCategoryCommand::undo() override

Restores the category and re-parents its recorded children back under it.

QString ew::core::RemoveCategoryCommand::description() const override

Returns a short description for the undo/redo UI.