SetCommentTargetCommand.h header
#include <ew/core/SetCommentTargetCommand.h>
Namespace ew::core
SetCommentTargetCommand class
class ew::core::SetCommentTargetCommand
Command that re-points which object a comment annotates – its Comment::targetId (a null id detaches it into a free-standing note). The body, anchor, author, thread parent, and timestamps are left untouched (SetCommentCommand covers those); this exists so an operation that rewrites object references – notably merging one entity into another – can move a comment from the merged-away entity onto the survivor. Undo restores the previous target and redo re-applies the new one.
Members
ew::core::SetCommentTargetCommand::SetCommentTargetCommand(Comment &comment, ContentId targetId)
Creates a command that sets comment's target to targetId when applied.
ew::core::SetCommentTargetCommand::~SetCommentTargetCommand() override
Destroys the command.
void ew::core::SetCommentTargetCommand::apply() override
Records the current target and sets the new one.
void ew::core::SetCommentTargetCommand::undo() override
Restores the previous target.
QString ew::core::SetCommentTargetCommand::description() const override
Returns a short description for the undo/redo UI.