| 439 | } |
| 440 | |
| 441 | CustomInstruction QuickRefactorDialog::findCurrentInstruction() const |
| 442 | { |
| 443 | QString currentText = m_commandsComboBox->currentText().trimmed(); |
| 444 | if (currentText.isEmpty()) { |
| 445 | return CustomInstruction(); |
| 446 | } |
| 447 | |
| 448 | auto &manager = CustomInstructionsManager::instance(); |
| 449 | const QVector<CustomInstruction> &instructions = manager.instructions(); |
| 450 | |
| 451 | for (const CustomInstruction &instruction : instructions) { |
| 452 | if (instruction.name == currentText) { |
| 453 | return instruction; |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | int currentIndex = m_commandsComboBox->currentIndex(); |
| 458 | if (currentIndex > 0) { |
| 459 | QString instructionId = m_commandsComboBox->itemData(currentIndex).toString(); |
| 460 | if (!instructionId.isEmpty()) { |
| 461 | return manager.getInstructionById(instructionId); |
| 462 | } |
| 463 | } |
| 464 | |
| 465 | return CustomInstruction(); |
| 466 | } |
| 467 | |
| 468 | void QuickRefactorDialog::onCommandSelected(int index) |
| 469 | { |
nothing calls this directly
no test coverage detected