ILocatorFilter: Provide default implementation for accept()

Change-Id: Ide3c65ac78da60c9634b8f1c3009e947e8f1e2f3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2023-02-22 23:08:19 +01:00
parent 215f79f580
commit 6efecebb10
19 changed files with 22 additions and 164 deletions

View File

@@ -5,13 +5,10 @@
#include "qmljslocatordata.h"
#include "qmljstoolstr.h"
#include <coreplugin/editormanager/editormanager.h>
#include <utils/algorithm.h>
#include <QRegularExpression>
#include <numeric>
using namespace Core;
using namespace QmlJSTools::Internal;
@@ -72,12 +69,3 @@ QList<LocatorFilterEntry> FunctionFilter::matchesFor(QFutureInterface<LocatorFil
}
return std::accumulate(std::begin(entries), std::end(entries), QList<LocatorFilterEntry>());
}
void FunctionFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)
Q_UNUSED(selectionStart)
Q_UNUSED(selectionLength)
EditorManager::openEditor(selection);
}

View File

@@ -20,9 +20,6 @@ public:
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:
LocatorData *m_data = nullptr;
};