diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.cpp b/src/plugins/coreplugin/locator/ilocatorfilter.cpp index 8b7c924a2ff..a2d8d847f52 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.cpp +++ b/src/plugins/coreplugin/locator/ilocatorfilter.cpp @@ -516,24 +516,6 @@ std::optional ILocatorFilter::refreshRecipe() const return m_refreshRecipe; } -/*! - Called with the entry specified by \a selection when the user activates it - in the result list. - Implementations can return a new search term \a newText, which has \a selectionLength characters - starting from \a selectionStart preselected, and the cursor set to the end of the selection. - - The default implementation tries to open an editor for \a selections's linkForEditor, - if it exists. -*/ -void ILocatorFilter::accept(const LocatorFilterEntry &selection, QString *newText, - int *selectionStart, int *selectionLength) const -{ - Q_UNUSED(newText) - Q_UNUSED(selectionStart) - Q_UNUSED(selectionLength) - EditorManager::openEditor(selection); -} - /*! Sets the default \a shortcut string that can be used to explicitly choose this filter in the locator input field. Call for example from the diff --git a/src/plugins/coreplugin/locator/ilocatorfilter.h b/src/plugins/coreplugin/locator/ilocatorfilter.h index c116209be7e..b1a20dd67f8 100644 --- a/src/plugins/coreplugin/locator/ilocatorfilter.h +++ b/src/plugins/coreplugin/locator/ilocatorfilter.h @@ -225,9 +225,6 @@ public: virtual QList matchesFor(QFutureInterface &future, const QString &entry) = 0; - virtual void accept(const LocatorFilterEntry &selection, QString *newText, - int *selectionStart, int *selectionLength) const; - virtual QByteArray saveState() const; virtual void restoreState(const QByteArray &state); diff --git a/src/plugins/coreplugin/locator/locatorwidget.cpp b/src/plugins/coreplugin/locator/locatorwidget.cpp index 889223e440a..cd98f8e5dd1 100644 --- a/src/plugins/coreplugin/locator/locatorwidget.cpp +++ b/src/plugins/coreplugin/locator/locatorwidget.cpp @@ -1018,15 +1018,9 @@ void LocatorWidget::acceptEntry(int row) return; const LocatorFilterEntry entry = m_locatorModel->data(index, LocatorEntryRole).value(); QWidget *focusBeforeAccept = QApplication::focusWidget(); - AcceptResult result; - if (entry.acceptor) { - result = entry.acceptor(); - } else if (entry.filter) { - entry.filter->accept(entry, &result.newText, &result.selectionStart, - &result.selectionLength); - } else { + if (!entry.acceptor) EditorManager::openEditor(entry); - } + const AcceptResult result = entry.acceptor ? entry.acceptor() : AcceptResult(); if (result.newText.isEmpty()) { emit hidePopup(); if (QApplication::focusWidget() == focusBeforeAccept)