forked from qt-creator/qt-creator
LocatorFilterEntry: Get rid of filter field
Remove also c'tor taking a pointer to filter. Change-Id: Ic0fe62daeb6e79a729bee24d07d7eb77559e19c4 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -153,7 +153,8 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
|
||||
QRegularExpressionMatch match = regexp.match(matchText);
|
||||
|
||||
if (match.hasMatch()) {
|
||||
LocatorFilterEntry filterEntry(this, path.fileName());
|
||||
LocatorFilterEntry filterEntry;
|
||||
filterEntry.displayName = path.fileName();
|
||||
filterEntry.filePath = path;
|
||||
filterEntry.extraInfo = path.shortNativePath();
|
||||
filterEntry.linkForEditor = Link(path, link.targetLine, link.targetColumn);
|
||||
|
||||
@@ -66,7 +66,8 @@ void ExternalToolsFilter::prepareSearch(const QString &entry)
|
||||
goodEntries.append(filterEntry);
|
||||
}
|
||||
}
|
||||
LocatorFilterEntry configEntry(this, "Configure External Tool...");
|
||||
LocatorFilterEntry configEntry;
|
||||
configEntry.displayName = "Configure External Tool...";
|
||||
configEntry.extraInfo = "Opens External Tool settings";
|
||||
configEntry.acceptor = [] {
|
||||
QMetaObject::invokeMethod(CorePlugin::instance(), [] {
|
||||
|
||||
@@ -80,14 +80,7 @@ public:
|
||||
|
||||
LocatorFilterEntry() = default;
|
||||
|
||||
LocatorFilterEntry(ILocatorFilter *fromFilter, const QString &name)
|
||||
: filter(fromFilter)
|
||||
, displayName(name)
|
||||
{}
|
||||
|
||||
using Acceptor = std::function<AcceptResult()>;
|
||||
/* backpointer to creating filter */
|
||||
ILocatorFilter *filter = nullptr;
|
||||
/* displayed string */
|
||||
QString displayName;
|
||||
/* extra information displayed in parentheses and light-gray next to display name (optional)*/
|
||||
|
||||
@@ -75,7 +75,12 @@ QList<LocatorFilterEntry> JavaScriptFilter::matchesFor(
|
||||
};
|
||||
};
|
||||
const QString expression = entry + " = " + result;
|
||||
entries.append({this, expression});
|
||||
|
||||
LocatorFilterEntry entry;
|
||||
entry.displayName = expression;
|
||||
entry.acceptor = [] { return AcceptResult(); };
|
||||
entries.append(entry);
|
||||
|
||||
LocatorFilterEntry resultEntry;
|
||||
resultEntry.displayName = Tr::tr("Copy to clipboard: %1").arg(result);
|
||||
resultEntry.acceptor = acceptor(result);
|
||||
|
||||
@@ -96,7 +96,8 @@ QList<LocatorFilterEntry> OpenDocumentsFilter::matchesFor(QFutureInterface<Locat
|
||||
QString displayName = editorEntry.displayName;
|
||||
const QRegularExpressionMatch match = regexp.match(displayName);
|
||||
if (match.hasMatch()) {
|
||||
LocatorFilterEntry filterEntry(this, displayName);
|
||||
LocatorFilterEntry filterEntry;
|
||||
filterEntry.displayName = displayName;
|
||||
filterEntry.filePath = FilePath::fromString(fileName);
|
||||
filterEntry.extraInfo = filterEntry.filePath.shortNativePath();
|
||||
filterEntry.highlightInfo = highlightInfo(match);
|
||||
|
||||
Reference in New Issue
Block a user