actions: use shared_ptr to store actions

This commit is contained in:
Andrzej Rybczak
2016-12-07 19:02:47 +01:00
parent 59197f23d0
commit 56cb940a12
8 changed files with 47 additions and 35 deletions

View File

@@ -46,9 +46,9 @@ void PushCharacters::run()
(*m_window)->pushChar(*it);
}
RequireRunnable::RequireRunnable(BaseAction *action)
RequireRunnable::RequireRunnable(std::shared_ptr<BaseAction> action)
: BaseAction(Type::MacroUtility, "require_runnable")
, m_action(action)
, m_action(std::move(action))
{
assert(m_action != nullptr);
m_name += " \"";
@@ -75,7 +75,7 @@ bool RequireScreen::canBeRun()
return Global::myScreen->type() == m_screen_type;
}
RunExternalCommand::RunExternalCommand(std::string command)
RunExternalCommand::RunExternalCommand(std::string &&command)
: BaseAction(Type::MacroUtility, "run_external_command")
, m_command(std::move(command))
{