Core: Turn LocatorFilterEntry ofn ILocatorFilter::accept to const &

In ILocatorFilter::accept and all the overrides.

Change-Id: I27cd6babb66d91aad57e85572a1cdc77aef4fd79
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Alessandro Portale
2022-02-10 17:16:04 +01:00
parent 93fc6b5c3c
commit 26bf18e1fe
44 changed files with 50 additions and 50 deletions

View File

@@ -124,7 +124,7 @@ QList<LocatorFilterEntry> BookmarkFilter::matchesFor(QFutureInterface<LocatorFil
return m_results;
}
void BookmarkFilter::accept(LocatorFilterEntry selection, QString *newText,
void BookmarkFilter::accept(const LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -40,7 +40,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection, QString *newText,
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -135,7 +135,7 @@ QList<Core::LocatorFilterEntry> ClangCurrentDocumentFilter::matchesFor(
return goodEntries;
}
void ClangCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection,
void ClangCurrentDocumentFilter::accept(const Core::LocatorFilterEntry &selection,
QString *, int *, int *) const
{
if (!m_currentEditor)

View File

@@ -42,7 +42,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -198,7 +198,7 @@ QList<Core::LocatorFilterEntry> ClangGlobalSymbolFilter::matchesFor(
return matches;
}
void ClangGlobalSymbolFilter::accept(Core::LocatorFilterEntry selection, QString *newText,
void ClangGlobalSymbolFilter::accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const
{
if (qvariant_cast<CppEditor::IndexItem::Ptr>(selection.internalData))
@@ -318,7 +318,7 @@ QList<Core::LocatorFilterEntry> ClangdCurrentDocumentFilter::matchesFor(
return d->activeFilter->matchesFor(future, entry);
}
void ClangdCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection, QString *newText,
void ClangdCurrentDocumentFilter::accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const
{
QTC_ASSERT(d->activeFilter, return);

View File

@@ -41,7 +41,7 @@ private:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection, QString *newText,
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
Core::ILocatorFilter * const m_cppFilter;
@@ -70,7 +70,7 @@ private:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection, QString *newText,
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
class Private;

View File

@@ -121,7 +121,7 @@ BuildCMakeTargetLocatorFilter::BuildCMakeTargetLocatorFilter()
setPriority(High);
}
void BuildCMakeTargetLocatorFilter::accept(Core::LocatorFilterEntry selection,
void BuildCMakeTargetLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const
@@ -171,7 +171,7 @@ OpenCMakeTargetLocatorFilter::OpenCMakeTargetLocatorFilter()
setPriority(Medium);
}
void OpenCMakeTargetLocatorFilter::accept(Core::LocatorFilterEntry selection,
void OpenCMakeTargetLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const

View File

@@ -54,7 +54,7 @@ class BuildCMakeTargetLocatorFilter : CMakeTargetLocatorFilter
public:
BuildCMakeTargetLocatorFilter();
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const final;
@@ -67,7 +67,7 @@ class OpenCMakeTargetLocatorFilter : CMakeTargetLocatorFilter
public:
OpenCMakeTargetLocatorFilter();
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const final;

View File

@@ -218,7 +218,7 @@ QList<LocatorFilterEntry> BaseFileFilter::matchesFor(QFutureInterface<LocatorFil
/*!
\reimp
*/
void BaseFileFilter::accept(LocatorFilterEntry selection,
void BaseFileFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -68,7 +68,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
static void openEditorAt(const LocatorFilterEntry &selection);

View File

@@ -112,7 +112,7 @@ QList<LocatorFilterEntry> CommandLocator::matchesFor(QFutureInterface<LocatorFil
return betterEntries;
}
void CommandLocator::accept(LocatorFilterEntry entry,
void CommandLocator::accept(const LocatorFilterEntry &entry,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -48,7 +48,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -80,7 +80,7 @@ QList<LocatorFilterEntry> ExecuteFilter::matchesFor(QFutureInterface<LocatorFilt
return value;
}
void ExecuteFilter::accept(LocatorFilterEntry selection,
void ExecuteFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -51,7 +51,7 @@ public:
~ExecuteFilter() override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -49,7 +49,7 @@ QList<LocatorFilterEntry> ExternalToolsFilter::matchesFor(QFutureInterface<Locat
return m_results;
}
void ExternalToolsFilter::accept(LocatorFilterEntry selection,
void ExternalToolsFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -38,7 +38,7 @@ public:
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void prepareSearch(const QString &entry) override;

View File

@@ -169,7 +169,7 @@ QList<LocatorFilterEntry> FileSystemFilter::matchesFor(QFutureInterface<LocatorF
const char kAlwaysCreate[] = "Locator/FileSystemFilter/AlwaysCreate";
void FileSystemFilter::accept(LocatorFilterEntry selection,
void FileSystemFilter::accept(const LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const

View File

@@ -45,7 +45,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void restoreState(const QByteArray &state) override;
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;

View File

@@ -595,7 +595,7 @@ bool ILocatorFilter::isOldSetting(const QByteArray &state)
*/
/*!
\fn void Core::ILocatorFilter::accept(Core::LocatorFilterEntry selection, QString *newText, int *selectionStart, int *selectionLength) const
\fn void Core::ILocatorFilter::accept(Core::const LocatorFilterEntry &selection, QString *newText, int *selectionStart, int *selectionLength) const
Called with the entry specified by \a selection when the user activates it
in the result list.

View File

@@ -143,7 +143,7 @@ public:
virtual QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry) = 0;
virtual void accept(LocatorFilterEntry selection,
virtual void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const = 0;
virtual void refresh(QFutureInterface<void> &future) { Q_UNUSED(future) };

View File

@@ -89,7 +89,7 @@ QList<LocatorFilterEntry> JavaScriptFilter::matchesFor(
return entries;
}
void JavaScriptFilter::accept(Core::LocatorFilterEntry selection, QString *newText,
void JavaScriptFilter::accept(const LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -49,7 +49,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection, QString *newText,
void accept(const Core::LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -89,7 +89,7 @@ QList<LocatorFilterEntry> LocatorFiltersFilter::matchesFor(QFutureInterface<Loca
return entries;
}
void LocatorFiltersFilter::accept(LocatorFilterEntry selection,
void LocatorFiltersFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(selectionLength)

View File

@@ -49,7 +49,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -120,7 +120,7 @@ void OpenDocumentsFilter::refresh(QFutureInterface<void> &future)
QMetaObject::invokeMethod(this, &OpenDocumentsFilter::refreshInternally, Qt::QueuedConnection);
}
void OpenDocumentsFilter::accept(LocatorFilterEntry selection,
void OpenDocumentsFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -45,7 +45,7 @@ public:
OpenDocumentsFilter();
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection,
void accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;

View File

@@ -162,7 +162,7 @@ QList<Core::LocatorFilterEntry> UrlLocatorFilter::matchesFor(
return entries;
}
void UrlLocatorFilter::accept(Core::LocatorFilterEntry selection,
void UrlLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const

View File

@@ -46,7 +46,7 @@ public:
// ILocatorFilter
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void restoreState(const QByteArray &state) override;
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;

View File

@@ -79,7 +79,7 @@ QList<LocatorFilterEntry> MenuBarFilter::matchesFor(QFutureInterface<LocatorFilt
return std::move(m_entries);
}
void MenuBarFilter::accept(LocatorFilterEntry selection, QString *newText,
void MenuBarFilter::accept(const LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -47,7 +47,7 @@ public:
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
const QString &entry) override;
void accept(LocatorFilterEntry selection, QString *newText,
void accept(const LocatorFilterEntry &selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
void prepareSearch(const QString &entry) override;

View File

@@ -117,7 +117,7 @@ QList<Core::LocatorFilterEntry> CppCurrentDocumentFilter::matchesFor(
return betterEntries;
}
void CppCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection,
void CppCurrentDocumentFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart,
int *selectionLength) const
{

View File

@@ -47,7 +47,7 @@ public:
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -136,7 +136,7 @@ QList<Core::LocatorFilterEntry> CppLocatorFilter::matchesFor(
return std::accumulate(std::begin(entries), std::end(entries), QList<Core::LocatorFilterEntry>());
}
void CppLocatorFilter::accept(Core::LocatorFilterEntry selection,
void CppLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -43,7 +43,7 @@ public:
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
protected:

View File

@@ -197,7 +197,7 @@ QList<LocatorFilterEntry> HelpIndexFilter::matchesFor(QFutureInterface<LocatorFi
#endif
void HelpIndexFilter::accept(LocatorFilterEntry selection,
void HelpIndexFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -48,7 +48,7 @@ public:
// ILocatorFilter
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;

View File

@@ -218,7 +218,7 @@ QList<Core::LocatorFilterEntry> DocumentLocatorFilter::matchesFor(
return {};
}
void DocumentLocatorFilter::accept(Core::LocatorFilterEntry selection,
void DocumentLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString * /*newText*/,
int * /*selectionStart*/,
int * /*selectionLength*/) const
@@ -325,7 +325,7 @@ QList<Core::LocatorFilterEntry> WorkspaceLocatorFilter::matchesFor(
.toList();
}
void WorkspaceLocatorFilter::accept(Core::LocatorFilterEntry selection,
void WorkspaceLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString * /*newText*/,
int * /*selectionStart*/,
int * /*selectionLength*/) const

View File

@@ -49,7 +49,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const override;
@@ -103,7 +103,7 @@ public:
void prepareSearch(const QString &entry, const QVector<Client *> &clients);
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText,
int *selectionStart,
int *selectionLength) const override;

View File

@@ -85,7 +85,7 @@ QList<Core::LocatorFilterEntry> MacroLocatorFilter::matchesFor(QFutureInterface<
return betterEntries;
}
void MacroLocatorFilter::accept(Core::LocatorFilterEntry selection,
void MacroLocatorFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -42,7 +42,7 @@ public:
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -95,7 +95,7 @@ QList<Core::LocatorFilterEntry> FunctionFilter::matchesFor(
return std::accumulate(std::begin(entries), std::end(entries), QList<Core::LocatorFilterEntry>());
}
void FunctionFilter::accept(Core::LocatorFilterEntry selection,
void FunctionFilter::accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -42,7 +42,7 @@ public:
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private:

View File

@@ -90,7 +90,7 @@ QList<LocatorFilterEntry> LineNumberFilter::matchesFor(QFutureInterface<LocatorF
return value;
}
void LineNumberFilter::accept(LocatorFilterEntry selection,
void LineNumberFilter::accept(const LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const
{
Q_UNUSED(newText)

View File

@@ -46,7 +46,7 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
void accept(const Core::LocatorFilterEntry &selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
private: