| 24 | |
| 25 | |
| 26 | std::shared_ptr<CommandExecutor> CommandExecutorFactory::create_executor(CommandExecutorFactory::ExecutorType type) |
| 27 | { |
| 28 | switch (type) { |
| 29 | case ExecutorType::Smartctl: |
| 30 | { |
| 31 | if (use_gui_) { |
| 32 | auto ex = std::make_shared<SmartctlExecutorGui>(); |
| 33 | ex->create_running_dialog(parent_); // dialog parent |
| 34 | return ex; |
| 35 | } |
| 36 | return std::make_shared<SmartctlExecutor>(); |
| 37 | } |
| 38 | case ExecutorType::TwCli: |
| 39 | { |
| 40 | if (use_gui_) { |
| 41 | auto ex = std::make_shared<TwCliExecutorGui>(); |
| 42 | ex->create_running_dialog(parent_); // dialog parent |
| 43 | return ex; |
| 44 | } |
| 45 | return std::make_shared<TwCliExecutor>(); |
| 46 | } |
| 47 | case ExecutorType::ArecaCli: |
| 48 | { |
| 49 | if (use_gui_) { |
| 50 | auto ex = std::make_shared<ArecaCliExecutorGui>(); |
| 51 | ex->create_running_dialog(parent_); // dialog parent |
| 52 | return ex; |
| 53 | } |
| 54 | return std::make_shared<ArecaCliExecutor>(); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | DBG_ASSERT(0); |
| 59 | return std::make_shared<CommandExecutor>(); |
| 60 | } |
| 61 | |
| 62 | |
| 63 |
no test coverage detected