forked from qt-creator/qt-creator
Locator filters: Add overrides
Change-Id: I20f93d6bcb22a342d9f662d8190f97798ca3e423 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -69,9 +69,10 @@ public:
|
|||||||
|
|
||||||
BaseFileFilter();
|
BaseFileFilter();
|
||||||
~BaseFileFilter();
|
~BaseFileFilter();
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
void accept(LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void setFileIterator(Iterator *iterator);
|
void setFileIterator(Iterator *iterator);
|
||||||
|
|||||||
@@ -45,9 +45,10 @@ public:
|
|||||||
|
|
||||||
void appendCommand(Command *cmd);
|
void appendCommand(Command *cmd);
|
||||||
|
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
void accept(LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CommandLocatorPrivate *d;
|
CommandLocatorPrivate *d;
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ class DirectoryFilter : public BaseFileFilter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
DirectoryFilter(Id id);
|
DirectoryFilter(Id id);
|
||||||
QByteArray saveState() const;
|
QByteArray saveState() const override;
|
||||||
void restoreState(const QByteArray &state);
|
void restoreState(const QByteArray &state) override;
|
||||||
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void addDirectory();
|
void addDirectory();
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ class ExecuteFilter : public Core::ILocatorFilter
|
|||||||
public:
|
public:
|
||||||
ExecuteFilter();
|
ExecuteFilter();
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
const QString &entry);
|
const QString &entry) override;
|
||||||
void accept(LocatorFilterEntry selection) const;
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
void refresh(QFutureInterface<void> &) {}
|
void refresh(QFutureInterface<void> &) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void finished(int exitCode, QProcess::ExitStatus status);
|
void finished(int exitCode, QProcess::ExitStatus status);
|
||||||
|
|||||||
@@ -44,13 +44,14 @@ class FileSystemFilter : public ILocatorFilter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
explicit FileSystemFilter(LocatorWidget *locatorWidget);
|
explicit FileSystemFilter(LocatorWidget *locatorWidget);
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
void accept(LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
QByteArray saveState() const;
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
void restoreState(const QByteArray &state);
|
QByteArray saveState() const override;
|
||||||
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
void restoreState(const QByteArray &state) override;
|
||||||
void refresh(QFutureInterface<void> &) {}
|
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;
|
||||||
|
void refresh(QFutureInterface<void> &) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LocatorWidget *m_locatorWidget;
|
LocatorWidget *m_locatorWidget;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public:
|
|||||||
setFileIterator(new BaseFileFilter::ListIterator(theFiles));
|
setFileIterator(new BaseFileFilter::ListIterator(theFiles));
|
||||||
}
|
}
|
||||||
|
|
||||||
void refresh(QFutureInterface<void> &) {}
|
void refresh(QFutureInterface<void> &) override {}
|
||||||
};
|
};
|
||||||
|
|
||||||
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
|
inline QString _(const QByteArray &ba) { return QString::fromLatin1(ba, ba.size()); }
|
||||||
|
|||||||
@@ -48,10 +48,11 @@ public:
|
|||||||
LocatorWidget *locatorWidget);
|
LocatorWidget *locatorWidget);
|
||||||
|
|
||||||
// ILocatorFilter
|
// ILocatorFilter
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
void accept(LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Locator *m_plugin;
|
Locator *m_plugin;
|
||||||
|
|||||||
@@ -43,9 +43,10 @@ class OpenDocumentsFilter : public ILocatorFilter
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
OpenDocumentsFilter();
|
OpenDocumentsFilter();
|
||||||
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future, const QString &entry);
|
QList<LocatorFilterEntry> matchesFor(QFutureInterface<LocatorFilterEntry> &future,
|
||||||
void accept(LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void refreshInternally();
|
void refreshInternally();
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public:
|
|||||||
setShortcutString(QLatin1String("md"));
|
setShortcutString(QLatin1String("md"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // Internal
|
} // Internal
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ public:
|
|||||||
StringTable &stringTable);
|
StringTable &stringTable);
|
||||||
~CppCurrentDocumentFilter() {}
|
~CppCurrentDocumentFilter() {}
|
||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
|
void onDocumentUpdated(CPlusPlus::Document::Ptr doc);
|
||||||
|
|||||||
@@ -39,8 +39,8 @@ public:
|
|||||||
|
|
||||||
// ILocatorFilter interface
|
// ILocatorFilter interface
|
||||||
public:
|
public:
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void markOutdated();
|
void markOutdated();
|
||||||
|
|||||||
@@ -42,9 +42,9 @@ public:
|
|||||||
~CppLocatorFilter();
|
~CppLocatorFilter();
|
||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry);
|
const QString &entry) override;
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual IndexItem::ItemType matchTypes() const { return IndexItem::All; }
|
virtual IndexItem::ItemType matchTypes() const { return IndexItem::All; }
|
||||||
|
|||||||
@@ -42,11 +42,11 @@ public:
|
|||||||
~HelpIndexFilter();
|
~HelpIndexFilter();
|
||||||
|
|
||||||
// ILocatorFilter
|
// ILocatorFilter
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
const QString &entry);
|
const QString &entry) override;
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
Q_INVOKABLE QSet<QString> searchMatches(const QString &databaseFilePath,
|
Q_INVOKABLE QSet<QString> searchMatches(const QString &databaseFilePath,
|
||||||
const QString &term, int limit);
|
const QString &term, int limit);
|
||||||
|
|||||||
@@ -43,12 +43,13 @@ public:
|
|||||||
~RemoteHelpFilter();
|
~RemoteHelpFilter();
|
||||||
|
|
||||||
// ILocatorFilter
|
// ILocatorFilter
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
QByteArray saveState() const;
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
void restoreState(const QByteArray &state);
|
QByteArray saveState() const override;
|
||||||
bool openConfigDialog(QWidget *parent, bool &needsRefresh);
|
void restoreState(const QByteArray &state) override;
|
||||||
|
bool openConfigDialog(QWidget *parent, bool &needsRefresh) override;
|
||||||
|
|
||||||
QStringList remoteUrls() const;
|
QStringList remoteUrls() const;
|
||||||
|
|
||||||
|
|||||||
@@ -43,9 +43,10 @@ public:
|
|||||||
MacroLocatorFilter();
|
MacroLocatorFilter();
|
||||||
~MacroLocatorFilter();
|
~MacroLocatorFilter();
|
||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QIcon m_icon;
|
const QIcon m_icon;
|
||||||
|
|||||||
@@ -40,9 +40,10 @@ public:
|
|||||||
explicit FunctionFilter(LocatorData *data, QObject *parent = 0);
|
explicit FunctionFilter(LocatorData *data, QObject *parent = 0);
|
||||||
~FunctionFilter();
|
~FunctionFilter();
|
||||||
|
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &future);
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &future) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LocatorData *m_data;
|
LocatorData *m_data;
|
||||||
|
|||||||
@@ -43,10 +43,11 @@ class LineNumberFilter : public Core::ILocatorFilter
|
|||||||
public:
|
public:
|
||||||
explicit LineNumberFilter(QObject *parent = 0);
|
explicit LineNumberFilter(QObject *parent = 0);
|
||||||
|
|
||||||
void prepareSearch(const QString &entry);
|
void prepareSearch(const QString &entry) override;
|
||||||
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future, const QString &entry);
|
QList<Core::LocatorFilterEntry> matchesFor(QFutureInterface<Core::LocatorFilterEntry> &future,
|
||||||
void accept(Core::LocatorFilterEntry selection) const;
|
const QString &entry) override;
|
||||||
void refresh(QFutureInterface<void> &) {}
|
void accept(Core::LocatorFilterEntry selection) const override;
|
||||||
|
void refresh(QFutureInterface<void> &) override {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_hasCurrentEditor;
|
bool m_hasCurrentEditor;
|
||||||
|
|||||||
Reference in New Issue
Block a user