forked from qt-creator/qt-creator
		
	Core: simplify ILocator interface
Use data members instead of virtual functions for id, displayName and priority, use Core::Id, not QStrings for id, de-pimpl CommandLocator. Change-Id: Id8b41f184cb995138b2d76c923d6d3ae02b7e3f5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
		@@ -35,8 +35,10 @@ using namespace CppTools::Internal;
 | 
			
		||||
CppClassesFilter::CppClassesFilter(CppModelManager *manager)
 | 
			
		||||
    : CppLocatorFilter(manager)
 | 
			
		||||
{
 | 
			
		||||
    setId("Classes");
 | 
			
		||||
    setShortcutString(QLatin1String("c"));
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
    setDisplayName(tr("C++ Classes"));
 | 
			
		||||
 | 
			
		||||
    search.setSymbolsToSearchFor(SymbolSearcher::Classes);
 | 
			
		||||
    search.setSeparateScope(true);
 | 
			
		||||
 
 | 
			
		||||
@@ -42,10 +42,6 @@ class CPPTOOLS_EXPORT CppClassesFilter : public Internal::CppLocatorFilter
 | 
			
		||||
public:
 | 
			
		||||
    CppClassesFilter(Internal::CppModelManager *manager);
 | 
			
		||||
    ~CppClassesFilter();
 | 
			
		||||
 | 
			
		||||
    QString displayName() const { return tr("C++ Classes"); }
 | 
			
		||||
    QString id() const { return QLatin1String("Classes"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace CppTools
 | 
			
		||||
 
 | 
			
		||||
@@ -40,6 +40,8 @@ using namespace CPlusPlus;
 | 
			
		||||
CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager)
 | 
			
		||||
    : m_modelManager(manager)
 | 
			
		||||
{
 | 
			
		||||
    setId("Methods in current Document");
 | 
			
		||||
    setDisplayName(tr("C++ Methods in Current Document"));
 | 
			
		||||
    setShortcutString(QString(QLatin1Char('.')));
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -50,9 +50,6 @@ public:
 | 
			
		||||
    CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager);
 | 
			
		||||
    ~CppCurrentDocumentFilter() {}
 | 
			
		||||
 | 
			
		||||
    QString displayName() const { return tr("C++ Methods in Current Document"); }
 | 
			
		||||
    QString id() const { return QLatin1String("Methods in current Document"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
    QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry);
 | 
			
		||||
    void accept(Locator::FilterEntry selection) const;
 | 
			
		||||
    void refresh(QFutureInterface<void> &future);
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,8 @@ using namespace CppTools::Internal;
 | 
			
		||||
CppFunctionsFilter::CppFunctionsFilter(CppModelManager *manager)
 | 
			
		||||
    : CppLocatorFilter(manager)
 | 
			
		||||
{
 | 
			
		||||
    setId("Methods");
 | 
			
		||||
    setDisplayName(tr("C++ Methods and Functions"));
 | 
			
		||||
    setShortcutString(QString(QLatin1Char('m')));
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -42,10 +42,6 @@ class CppFunctionsFilter : public CppLocatorFilter
 | 
			
		||||
public:
 | 
			
		||||
    CppFunctionsFilter(CppModelManager *manager);
 | 
			
		||||
    ~CppFunctionsFilter();
 | 
			
		||||
 | 
			
		||||
    QString displayName() const { return tr("C++ Methods and Functions"); }
 | 
			
		||||
    QString id() const { return QLatin1String("Methods"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
} // namespace Internal
 | 
			
		||||
 
 | 
			
		||||
@@ -43,6 +43,8 @@ CppLocatorFilter::CppLocatorFilter(CppModelManager *manager)
 | 
			
		||||
    : m_manager(manager),
 | 
			
		||||
    m_forceNewSearchList(true)
 | 
			
		||||
{
 | 
			
		||||
    setId("Classes and Methods");
 | 
			
		||||
    setDisplayName(tr("C++ Classes and Methods"));
 | 
			
		||||
    setShortcutString(QString(QLatin1Char(':')));
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -41,13 +41,11 @@ class CppModelManager;
 | 
			
		||||
class CppLocatorFilter : public Locator::ILocatorFilter
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
public:
 | 
			
		||||
    CppLocatorFilter(CppModelManager *manager);
 | 
			
		||||
    ~CppLocatorFilter();
 | 
			
		||||
 | 
			
		||||
    QString displayName() const { return tr("C++ Classes and Methods"); }
 | 
			
		||||
    QString id() const { return QLatin1String("Classes and Methods"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
    QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry);
 | 
			
		||||
    void accept(Locator::FilterEntry selection) const;
 | 
			
		||||
    void refresh(QFutureInterface<void> &future);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user