forked from qt-creator/qt-creator
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:
@@ -133,8 +133,3 @@ void BookmarkFilter::accept(LocatorFilterEntry selection, QString *newText,
|
||||
m_manager->gotoBookmark(bookmark);
|
||||
}
|
||||
}
|
||||
|
||||
void BookmarkFilter::refresh(QFutureInterface<void> &future)
|
||||
{
|
||||
Q_UNUSED(future)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -129,8 +129,4 @@ void CommandLocator::accept(LocatorFilterEntry entry,
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
void CommandLocator::refresh(QFutureInterface<void> &)
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace Core
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -96,8 +96,3 @@ void MacroLocatorFilter::accept(Core::LocatorFilterEntry selection,
|
||||
|
||||
MacroManager::instance()->executeMacro(selection.displayName);
|
||||
}
|
||||
|
||||
void MacroLocatorFilter::refresh(QFutureInterface<void> &future)
|
||||
{
|
||||
Q_UNUSED(future)
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user