| 414 | } |
| 415 | |
| 416 | void QuickRefactorDialog::loadCustomCommands() |
| 417 | { |
| 418 | m_commandsComboBox->clear(); |
| 419 | m_commandsComboBox->addItem("", QString()); |
| 420 | |
| 421 | auto &manager = CustomInstructionsManager::instance(); |
| 422 | const QVector<CustomInstruction> &instructions = manager.instructions(); |
| 423 | |
| 424 | QStringList instructionNames; |
| 425 | |
| 426 | for (const CustomInstruction &instruction : instructions) { |
| 427 | m_commandsComboBox->addItem(instruction.name, instruction.id); |
| 428 | instructionNames.append(instruction.name); |
| 429 | } |
| 430 | |
| 431 | if (m_commandsComboBox->completer()) { |
| 432 | QStringListModel *model = new QStringListModel(instructionNames, this); |
| 433 | m_commandsComboBox->completer()->setModel(model); |
| 434 | } |
| 435 | |
| 436 | bool hasInstructions = !instructions.isEmpty(); |
| 437 | m_editCommandButton->setEnabled(hasInstructions); |
| 438 | m_deleteCommandButton->setEnabled(hasInstructions); |
| 439 | } |
| 440 | |
| 441 | CustomInstruction QuickRefactorDialog::findCurrentInstruction() const |
| 442 | { |
nothing calls this directly
no test coverage detected