MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / executeTool

Method executeTool

src/plugins/binarytools/configure/binarytoolsmanager.cpp:370–402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

368}
369
370void BinaryToolsManager::executeTool(const QString &id)
371{
372 const auto &tool = this->findTool(id);
373 if (!tool.isValid())
374 return;
375
376 if (!checkCommandExists(tool.command))
377 return toolMissingHint(tool);
378
379 AppOutputPane::instance()->createApplicationPane(id, tool.name);
380 auto stopHandler = std::bind(&BinaryToolsManager::stopTool, this, id);
381 AppOutputPane::instance()->setStopHandler(id, stopHandler);
382 QString startMsg = tr("Start execute tool \"%1\".\n").arg(tool.name);
383 printOutput(id, startMsg, OutputPane::NormalMessage);
384 uiController.switchContext(tr("&Application Output"));
385
386 auto toolProcess = createToolProcess(tool);
387 if (!toolProcess) {
388 printOutput(id, tr("The tool is running. Please stop it before running.\n"), OutputPane::ErrorMessage);
389 return;
390 }
391
392 QString errorMsg;
393 if (!checkAndSetProcessParams(toolProcess, tool, errorMsg)) {
394 printOutput(id, errorMsg, OutputPane::ErrorMessage);
395 stopTool(id);
396 toolTaskMap.remove(id);
397 AppOutputPane::instance()->setProcessFinished(id);
398 return;
399 }
400
401 Q_EMIT execute(id);
402}
403
404void BinaryToolsManager::checkAndAddToToolbar(const BinaryTools &tools)
405{

Callers

nothing calls this directly

Calls 6

findToolMethod · 0.95
createApplicationPaneMethod · 0.80
setStopHandlerMethod · 0.80
setProcessFinishedMethod · 0.80
isValidMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected