| 430 | } |
| 431 | |
| 432 | bool Macro::RunActionsHelper( |
| 433 | const std::deque<std::shared_ptr<MacroAction>> &actionsToRun, |
| 434 | bool ignorePause) |
| 435 | { |
| 436 | if (_paused && !ignorePause) { |
| 437 | return true; |
| 438 | } |
| 439 | |
| 440 | // Create copy of action list as elements might be removed, inserted, or |
| 441 | // reordered while actions are currently being executed. |
| 442 | auto actions = actionsToRun; |
| 443 | |
| 444 | bool actionsExecutedSuccessfully = true; |
| 445 | for (auto &action : actions) { |
| 446 | if (!action) { |
| 447 | continue; |
| 448 | } |
| 449 | if (action->Enabled()) { |
| 450 | action->LogAction(); |
| 451 | bool actionResult = false; |
| 452 | action->WithLock([&action, &actionResult]() { |
| 453 | actionResult = action->PerformAction(); |
| 454 | }); |
| 455 | action->ApplyVarMappings(); |
| 456 | actionsExecutedSuccessfully = |
| 457 | actionsExecutedSuccessfully && actionResult; |
| 458 | } else { |
| 459 | vblog(LOG_INFO, "skipping disabled action %s", |
| 460 | action->GetId().c_str()); |
| 461 | } |
| 462 | if (!actionsExecutedSuccessfully || (_paused && !ignorePause) || |
| 463 | _stop || _die) { |
| 464 | break; |
| 465 | } |
| 466 | if (action->Enabled()) { |
| 467 | action->EnableHighlight(); |
| 468 | } |
| 469 | } |
| 470 | return actionsExecutedSuccessfully; |
| 471 | } |
| 472 | |
| 473 | bool Macro::RunActions(bool ignorePause) |
| 474 | { |
nothing calls this directly
no test coverage detected