MCPcopy Create free account
hub / github.com/Palm1r/QodeAssist / findCurrentInstruction

Method findCurrentInstruction

widgets/QuickRefactorDialog.cpp:441–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

439}
440
441CustomInstruction 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
468void QuickRefactorDialog::onCommandSelected(int index)
469{

Callers

nothing calls this directly

Calls 6

CustomInstructionClass · 0.85
currentIndexMethod · 0.80
getInstructionByIdMethod · 0.80
isEmptyMethod · 0.45
instructionsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected