26 std::string generate_description(
const TagRow& tagrow);
52 auto reco_item =
p_impl->backup_strategy->restoreItem();
53 parent->insertItem(reco_item.release(),
p_impl->tagrow);
59 if (
auto child = parent->takeItem(
p_impl->tagrow); child) {
60 p_impl->backup_strategy->saveItem(child);
70 std::string generate_description(
const TagRow& tagrow)
72 std::ostringstream ostr;
73 ostr <<
"Remove item from tag '" << tagrow.
tag <<
"', row " << tagrow.
row;
Abstract command interface to manipulate SessionItem in model context.
SessionItem * itemFromPath(const Path &path) const
void setDescription(const std::string &text)
Sets command description.
void setResult(const CommandResult &command_result)
Path pathFromItem(SessionItem *item) const
void setObsolete(bool flag)
Sets command obsolete flag.
Supports navigation through SessionModel.
void undo_command() override
std::unique_ptr< RemoveItemCommandImpl > p_impl
void execute_command() override
~RemoveItemCommand() override
RemoveItemCommand(SessionItem *parent, TagRow tagrow)
The main object representing an editable/displayable/serializable entity.
SessionModel * model() const
Returns the model to which given item belongs to.
Aggregate to hold (tag, row) information for SessionModel.
materialitems.h Collection of materials to populate MaterialModel.
MVVM_MODEL_EXPORT std::unique_ptr< ItemBackupStrategy > CreateItemBackupStrategy(const SessionModel *model)
Creates strategy suitable for item saving/restoring.
std::unique_ptr< ItemBackupStrategy > backup_strategy
RemoveItemCommandImpl(TagRow tagrow)