| 145 | } |
| 146 | |
| 147 | void Runner::running() |
| 148 | { |
| 149 | if(d->isRunning) { |
| 150 | outputMsg(0, "The program is running, please try again later!", OutputPane::OutputFormat::ErrorMessage); |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | LanguageService *service = dpfGetService(LanguageService); |
| 155 | if (service) { |
| 156 | auto generator = service->create<LanguageGenerator>(getActiveProjectInfo().kitName()); |
| 157 | if (generator) { |
| 158 | dpfservice::ProjectInfo activeProjInfo = dpfGetService(ProjectService)->getActiveProjectInfo(); |
| 159 | RunCommandInfo args = generator->getRunArguments(activeProjInfo, d->currentOpenedFilePath); |
| 160 | if (!args.runInTerminal) { |
| 161 | uiController.switchContext(tr("&Application Output")); |
| 162 | |
| 163 | QtConcurrent::run([=]() { |
| 164 | execCommand(args); |
| 165 | }); |
| 166 | } else { |
| 167 | uiController.switchContext(TERMINAL_TAB_TEXT); |
| 168 | |
| 169 | auto terminalService = dpfGetService(TerminalService); |
| 170 | terminalService->executeCommand(args.program, args.program, args.arguments, args.workingDir, args.envs); |
| 171 | } |
| 172 | } |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | bool Runner::execCommand(const RunCommandInfo &info) |
| 177 | { |
nothing calls this directly
no test coverage detected