MCPcopy Create free account
hub / github.com/KDE/kdevelop / showQuickOpenWidget

Method showQuickOpenWidget

plugins/quickopen/quickopenplugin.cpp:495–518  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495void 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
520void QuickOpenPlugin::storeScopes(const QStringList& scopes)
521{

Callers

nothing calls this directly

Calls 12

activeDocumentMethod · 0.80
documentControllerMethod · 0.80
setPreselectedTextMethod · 0.80
showWithWidgetMethod · 0.80
textDocumentMethod · 0.45
isEmptyMethod · 0.45
textSelectionMethod · 0.45
textWordMethod · 0.45
textMethod · 0.45
widgetMethod · 0.45
setEnabledMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected