MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / startExeAction

Method startExeAction

src/mainwindow.cpp:1674–1702  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1672}
1673
1674void MainWindow::startExeAction()
1675{
1676 QAction* action = qobject_cast<QAction*>(sender());
1677
1678 if (action == nullptr) {
1679 log::error("not an action?");
1680 return;
1681 }
1682
1683 const auto& list = *m_OrganizerCore.executablesList();
1684
1685 const auto title = action->text();
1686 auto itor = list.find(title);
1687
1688 if (itor == list.end()) {
1689 log::warn("startExeAction(): executable '{}' not found", title);
1690 return;
1691 }
1692
1693 action->setEnabled(false);
1694 Guard g([&] {
1695 action->setEnabled(true);
1696 });
1697
1698 m_OrganizerCore.processRunner()
1699 .setFromExecutable(*itor)
1700 .setWaitForCompletion(ProcessRunner::TriggerRefresh)
1701 .run();
1702}
1703
1704void MainWindow::activateSelectedProfile()
1705{

Callers

nothing calls this directly

Calls 6

executablesListMethod · 0.80
processRunnerMethod · 0.80
findMethod · 0.45
endMethod · 0.45
setEnabledMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected