Provide empty implementation for ILocatorFilter::refresh()

Make this method just virtual, not a pure virtual.
Remove all empty reimplementations of this method.

Change-Id: Idf10e492355e8519172facd421ea0b2b13ce3b80
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Jarek Kobus
2021-02-11 11:41:55 +01:00
parent 9ad5cd5f58
commit 6a2088d8ec
34 changed files with 3 additions and 93 deletions

View File

@@ -133,8 +133,3 @@ void BookmarkFilter::accept(LocatorFilterEntry selection, QString *newText,
m_manager->gotoBookmark(bookmark);
}
}
void BookmarkFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}

View File

@@ -42,7 +42,6 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
BookmarkManager *m_manager = nullptr; // not owned

View File

@@ -145,10 +145,6 @@ void ClangCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection,
lineColumn.column - 1);
}
void ClangCurrentDocumentFilter::refresh(QFutureInterface<void> &)
{
}
void ClangCurrentDocumentFilter::reset(Core::IEditor *newCurrent, const QString &path)
{
m_currentEditor = newCurrent;

View File

@@ -44,7 +44,7 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
void onEditorAboutToClose(Core::IEditor *editors);
void onCurrentEditorChanged(Core::IEditor *newCurrent);

View File

@@ -102,11 +102,6 @@ QList<Core::LocatorFilterEntry> CMakeTargetLocatorFilter::matchesFor(QFutureInte
return m_result;
}
void CMakeTargetLocatorFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}
void CMakeTargetLocatorFilter::projectListUpdated()
{
// Enable the filter if there's at least one CMake project

View File

@@ -40,7 +40,6 @@ public:
void prepareSearch(const QString &entry) override;
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry) final;
void refresh(QFutureInterface<void> &future) final;
private:
void projectListUpdated();

View File

@@ -129,8 +129,4 @@ void CommandLocator::accept(LocatorFilterEntry entry,
}, Qt::QueuedConnection);
}
void CommandLocator::refresh(QFutureInterface<void> &)
{
}
} // namespace Core

View File

@@ -50,7 +50,6 @@ public:
const QString &entry) override;
void accept(LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
CommandLocatorPrivate *d = nullptr;

View File

@@ -53,7 +53,6 @@ public:
const QString &entry) override;
void accept(LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &) override {}
private:
void finished(int exitCode, QProcess::ExitStatus status);

View File

@@ -61,10 +61,6 @@ void ExternalToolsFilter::accept(LocatorFilterEntry selection,
MessageManager::writeFlashing(runner->errorString());
}
void ExternalToolsFilter::refresh(QFutureInterface<void> &)
{
}
void ExternalToolsFilter::prepareSearch(const QString &entry)
{
QList<LocatorFilterEntry> bestEntries;

View File

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

View File

@@ -49,7 +49,6 @@ public:
QString *newText, int *selectionStart, int *selectionLength) const override;
void restoreState(const QByteArray &state) override;
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;
void refresh(QFutureInterface<void> &) override {}
protected:
void saveState(QJsonObject &object) const final;

View File

@@ -145,7 +145,7 @@ public:
virtual void accept(LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const = 0;
virtual void refresh(QFutureInterface<void> &future) = 0;
virtual void refresh(QFutureInterface<void> &future) { Q_UNUSED(future) };
virtual QByteArray saveState() const;
virtual void restoreState(const QByteArray &state);

View File

@@ -110,12 +110,6 @@ void JavaScriptFilter::accept(Core::LocatorFilterEntry selection, QString *newTe
clipboard->setText(selection.internalData.toString());
}
void JavaScriptFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
// Nothing to refresh
}
void JavaScriptFilter::setupEngine()
{
m_engine.reset(new QJSEngine);

View File

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

View File

@@ -99,9 +99,3 @@ void LocatorFiltersFilter::accept(LocatorFilterEntry selection,
*selectionStart = shortcutString.length() + 1;
}
}
void LocatorFiltersFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
// Nothing to refresh
}

View File

@@ -51,7 +51,6 @@ public:
const QString &entry) override;
void accept(LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
QStringList m_filterShortcutStrings;

View File

@@ -265,11 +265,6 @@ void SpotlightLocatorFilter::prepareSearch(const QString &entry)
BaseFileFilter::prepareSearch(entry);
}
void SpotlightLocatorFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}
bool SpotlightLocatorFilter::openConfigDialog(QWidget *parent, bool &needsRefresh)
{
Q_UNUSED(needsRefresh)

View File

@@ -39,7 +39,6 @@ public:
SpotlightLocatorFilter();
void prepareSearch(const QString &entry) override;
void refresh(QFutureInterface<void> &future) override;
using ILocatorFilter::openConfigDialog;
bool openConfigDialog(QWidget *parent, bool &needsRefresh) final;

View File

@@ -175,12 +175,6 @@ void UrlLocatorFilter::accept(Core::LocatorFilterEntry selection,
QDesktopServices::openUrl(url);
}
void UrlLocatorFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
// Nothing to refresh
}
const char kDisplayNameKey[] = "displayName";
const char kRemoteUrlsKey[] = "remoteUrls";

View File

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

View File

@@ -90,11 +90,6 @@ void MenuBarFilter::accept(LocatorFilterEntry selection, QString *newText,
}
}
void MenuBarFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}
QList<LocatorFilterEntry> MenuBarFilter::matchesForAction(QAction *action,
const QStringList &entryPath,
const QStringList &path,

View File

@@ -49,8 +49,8 @@ public:
const QString &entry) override;
void accept(LocatorFilterEntry selection, QString *newText,
int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
void prepareSearch(const QString &entry) override;
private:
QList<LocatorFilterEntry> matchesForAction(QAction *action,
const QStringList &entryPath,

View File

@@ -127,11 +127,6 @@ void CppCurrentDocumentFilter::accept(Core::LocatorFilterEntry selection,
Core::EditorManager::openEditorAt(info->fileName(), info->line(), info->column());
}
void CppCurrentDocumentFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}
void CppCurrentDocumentFilter::onDocumentUpdated(Document::Ptr doc)
{
QMutexLocker locker(&m_mutex);

View File

@@ -49,7 +49,6 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);

View File

@@ -61,11 +61,6 @@ Core::LocatorFilterEntry CppLocatorFilter::filterEntryFromIndexItem(IndexItem::P
return filterEntry;
}
void CppLocatorFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}
QList<Core::LocatorFilterEntry> CppLocatorFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry)
{

View File

@@ -45,7 +45,6 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
protected:
virtual IndexItem::ItemType matchTypes() const { return IndexItem::All; }

View File

@@ -197,8 +197,6 @@ void DocumentLocatorFilter::accept(Core::LocatorFilterEntry selection,
}
}
void DocumentLocatorFilter::refresh(QFutureInterface<void> & /*future*/) {}
WorkspaceLocatorFilter::WorkspaceLocatorFilter()
: WorkspaceLocatorFilter(QVector<SymbolKind>())
{}
@@ -279,8 +277,6 @@ void WorkspaceLocatorFilter::accept(Core::LocatorFilterEntry selection,
}
}
void WorkspaceLocatorFilter::refresh(QFutureInterface<void> & /*future*/) {}
void WorkspaceLocatorFilter::handleResponse(Client *client,
const WorkspaceSymbolRequest::Response &response)
{

View File

@@ -52,7 +52,6 @@ public:
QString *newText,
int *selectionStart,
int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
signals:
void symbolsUpToDate(QPrivateSignal);
@@ -88,7 +87,6 @@ public:
QString *newText,
int *selectionStart,
int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
signals:
void allRequestsFinished(QPrivateSignal);

View File

@@ -96,8 +96,3 @@ void MacroLocatorFilter::accept(Core::LocatorFilterEntry selection,
MacroManager::instance()->executeMacro(selection.displayName);
}
void MacroLocatorFilter::refresh(QFutureInterface<void> &future)
{
Q_UNUSED(future)
}

View File

@@ -44,7 +44,6 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &future) override;
private:
const QIcon m_icon;

View File

@@ -50,10 +50,6 @@ FunctionFilter::FunctionFilter(LocatorData *data, QObject *parent)
FunctionFilter::~FunctionFilter() = default;
void FunctionFilter::refresh(QFutureInterface<void> &)
{
}
QList<Core::LocatorFilterEntry> FunctionFilter::matchesFor(
QFutureInterface<Core::LocatorFilterEntry> &future,
const QString &entry)

View File

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

View File

@@ -48,7 +48,6 @@ public:
const QString &entry) override;
void accept(Core::LocatorFilterEntry selection,
QString *newText, int *selectionStart, int *selectionLength) const override;
void refresh(QFutureInterface<void> &) override {}
private:
bool m_hasCurrentEditor = false;