| 493 | } |
| 494 | |
| 495 | void QuickOpenPlugin::showQuickOpenWidget(const QStringList& items, const QStringList& scopes, bool preselectText) |
| 496 | { |
| 497 | auto* dialog = new QuickOpenWidgetDialog(i18nc("@title:window", "Quick Open"), m_model, items, scopes); |
| 498 | m_currentWidgetHandler = dialog; |
| 499 | if (preselectText) { |
| 500 | KDevelop::IDocument* currentDoc = core()->documentController()->activeDocument(); |
| 501 | if (currentDoc && currentDoc->textDocument()) { |
| 502 | QString preselected = currentDoc->textSelection().isEmpty() ? currentDoc->textWord() : currentDoc->textDocument()->text(currentDoc->textSelection()); |
| 503 | dialog->widget()->setPreselectedText(preselected); |
| 504 | } |
| 505 | } |
| 506 | |
| 507 | connect(dialog->widget(), &QuickOpenWidget::scopesChanged, this, &QuickOpenPlugin::storeScopes); |
| 508 | //Not connecting itemsChanged to storeItems, as showQuickOpen doesn't use lastUsedItems and so shouldn't store item changes |
| 509 | //connect( dialog->widget(), SIGNAL(itemsChanged(QStringList)), this, SLOT(storeItems(QStringList)) ); |
| 510 | dialog->widget()->ui.itemsButton->setEnabled(false); |
| 511 | |
| 512 | if (quickOpenLine()) { |
| 513 | quickOpenLine()->showWithWidget(dialog->widget()); |
| 514 | dialog->deleteLater(); |
| 515 | } else { |
| 516 | dialog->run(); |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | void QuickOpenPlugin::storeScopes(const QStringList& scopes) |
| 521 | { |
nothing calls this directly
no test coverage detected