forked from qt-creator/qt-creator
		
	Rename the internal parts that still used QuickOpen instead of Locator
Merge branch 'adams' into 1.3
This commit is contained in:
		@@ -21,6 +21,6 @@ will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.</license>
 | 
			
		||||
    <dependencyList>
 | 
			
		||||
        <dependency name="TextEditor" version="1.2.93"/>
 | 
			
		||||
        <dependency name="ProjectExplorer" version="1.2.93"/>
 | 
			
		||||
        <dependency name="QuickOpen" version="1.2.93"/>
 | 
			
		||||
        <dependency name="Locator" version="1.2.93"/>
 | 
			
		||||
    </dependencyList>
 | 
			
		||||
</plugin>
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@
 | 
			
		||||
using namespace CppTools::Internal;
 | 
			
		||||
 | 
			
		||||
CppClassesFilter::CppClassesFilter(CppModelManager *manager, Core::EditorManager *editorManager)
 | 
			
		||||
    : CppQuickOpenFilter(manager, editorManager)
 | 
			
		||||
    : CppLocatorFilter(manager, editorManager)
 | 
			
		||||
{
 | 
			
		||||
    setShortcutString("c");
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,12 @@
 | 
			
		||||
#ifndef CPPCLASSESFILTER_H
 | 
			
		||||
#define CPPCLASSESFILTER_H
 | 
			
		||||
 | 
			
		||||
#include <cppquickopenfilter.h>
 | 
			
		||||
#include <cpplocatorfilter.h>
 | 
			
		||||
 | 
			
		||||
namespace CppTools {
 | 
			
		||||
namespace Internal {
 | 
			
		||||
 | 
			
		||||
class CppClassesFilter : public CppQuickOpenFilter
 | 
			
		||||
class CppClassesFilter : public CppLocatorFilter
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -58,11 +58,11 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Cor
 | 
			
		||||
            this,          SLOT(onEditorAboutToClose(Core::IEditor*)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString & origEntry)
 | 
			
		||||
QList<Locator::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString & origEntry)
 | 
			
		||||
{
 | 
			
		||||
    QString entry = trimWildcards(origEntry);
 | 
			
		||||
    QList<QuickOpen::FilterEntry> goodEntries;
 | 
			
		||||
    QList<QuickOpen::FilterEntry> betterEntries;
 | 
			
		||||
    QList<Locator::FilterEntry> goodEntries;
 | 
			
		||||
    QList<Locator::FilterEntry> betterEntries;
 | 
			
		||||
    QStringMatcher matcher(entry, Qt::CaseInsensitive);
 | 
			
		||||
    const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
 | 
			
		||||
    if (!regexp.isValid())
 | 
			
		||||
@@ -86,7 +86,7 @@ QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString
 | 
			
		||||
        {
 | 
			
		||||
            QString symbolName = info.symbolName;// + (info.type == ModelItemInfo::Declaration ? ";" : " {...}");
 | 
			
		||||
            QVariant id = qVariantFromValue(info);
 | 
			
		||||
            QuickOpen::FilterEntry filterEntry(this, symbolName, id, info.icon);
 | 
			
		||||
            Locator::FilterEntry filterEntry(this, symbolName, id, info.icon);
 | 
			
		||||
            filterEntry.extraInfo = info.symbolType;
 | 
			
		||||
 | 
			
		||||
            if (info.symbolName.startsWith(entry))
 | 
			
		||||
@@ -102,7 +102,7 @@ QList<QuickOpen::FilterEntry> CppCurrentDocumentFilter::matchesFor(const QString
 | 
			
		||||
    return betterEntries;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppCurrentDocumentFilter::accept(QuickOpen::FilterEntry selection) const
 | 
			
		||||
void CppCurrentDocumentFilter::accept(Locator::FilterEntry selection) const
 | 
			
		||||
{
 | 
			
		||||
    ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
 | 
			
		||||
    TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
 | 
			
		||||
 
 | 
			
		||||
@@ -30,7 +30,7 @@
 | 
			
		||||
#define CPPCURRENTDOCUMENTFILTER_H
 | 
			
		||||
 | 
			
		||||
#include "searchsymbols.h"
 | 
			
		||||
#include <quickopen/iquickopenfilter.h>
 | 
			
		||||
#include <locator/ilocatorfilter.h>
 | 
			
		||||
 | 
			
		||||
namespace Core {
 | 
			
		||||
class EditorManager;
 | 
			
		||||
@@ -42,7 +42,7 @@ namespace Internal {
 | 
			
		||||
 | 
			
		||||
class CppModelManager;
 | 
			
		||||
 | 
			
		||||
class CppCurrentDocumentFilter : public  QuickOpen::IQuickOpenFilter
 | 
			
		||||
class CppCurrentDocumentFilter : public  Locator::ILocatorFilter
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
@@ -53,8 +53,8 @@ public:
 | 
			
		||||
    QString trName() const { return tr("Methods in current Document"); }
 | 
			
		||||
    QString name() const { return QLatin1String("Methods in current Document"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
    QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
 | 
			
		||||
    void accept(QuickOpen::FilterEntry selection) const;
 | 
			
		||||
    QList<Locator::FilterEntry> matchesFor(const QString &entry);
 | 
			
		||||
    void accept(Locator::FilterEntry selection) const;
 | 
			
		||||
    void refresh(QFutureInterface<void> &future);
 | 
			
		||||
 | 
			
		||||
private slots:
 | 
			
		||||
 
 | 
			
		||||
@@ -32,7 +32,7 @@
 | 
			
		||||
using namespace CppTools::Internal;
 | 
			
		||||
 | 
			
		||||
CppFunctionsFilter::CppFunctionsFilter(CppModelManager *manager, Core::EditorManager *editorManager)
 | 
			
		||||
    : CppQuickOpenFilter(manager, editorManager)
 | 
			
		||||
    : CppLocatorFilter(manager, editorManager)
 | 
			
		||||
{
 | 
			
		||||
    setShortcutString("m");
 | 
			
		||||
    setIncludedByDefault(false);
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,12 @@
 | 
			
		||||
#ifndef CPPFUNCTIONSFILTER_H
 | 
			
		||||
#define CPPFUNCTIONSFILTER_H
 | 
			
		||||
 | 
			
		||||
#include <cppquickopenfilter.h>
 | 
			
		||||
#include <cpplocatorfilter.h>
 | 
			
		||||
 | 
			
		||||
namespace CppTools {
 | 
			
		||||
namespace Internal {
 | 
			
		||||
 | 
			
		||||
class CppFunctionsFilter : public CppQuickOpenFilter
 | 
			
		||||
class CppFunctionsFilter : public CppLocatorFilter
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -27,7 +27,7 @@
 | 
			
		||||
**
 | 
			
		||||
**************************************************************************/
 | 
			
		||||
 | 
			
		||||
#include "cppquickopenfilter.h"
 | 
			
		||||
#include "cpplocatorfilter.h"
 | 
			
		||||
#include "cppmodelmanager.h"
 | 
			
		||||
 | 
			
		||||
#include <coreplugin/editormanager/editormanager.h>
 | 
			
		||||
@@ -39,7 +39,7 @@
 | 
			
		||||
 | 
			
		||||
using namespace CppTools::Internal;
 | 
			
		||||
 | 
			
		||||
CppQuickOpenFilter::CppQuickOpenFilter(CppModelManager *manager, Core::EditorManager *editorManager)
 | 
			
		||||
CppLocatorFilter::CppLocatorFilter(CppModelManager *manager, Core::EditorManager *editorManager)
 | 
			
		||||
    : m_manager(manager),
 | 
			
		||||
    m_editorManager(editorManager),
 | 
			
		||||
    m_forceNewSearchList(true)
 | 
			
		||||
@@ -54,36 +54,36 @@ CppQuickOpenFilter::CppQuickOpenFilter(CppModelManager *manager, Core::EditorMan
 | 
			
		||||
            this, SLOT(onAboutToRemoveFiles(QStringList)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
CppQuickOpenFilter::~CppQuickOpenFilter()
 | 
			
		||||
CppLocatorFilter::~CppLocatorFilter()
 | 
			
		||||
{ }
 | 
			
		||||
 | 
			
		||||
void CppQuickOpenFilter::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
 | 
			
		||||
void CppLocatorFilter::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
 | 
			
		||||
{
 | 
			
		||||
    m_searchList[doc->fileName()] = Info(doc);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppQuickOpenFilter::onAboutToRemoveFiles(const QStringList &files)
 | 
			
		||||
void CppLocatorFilter::onAboutToRemoveFiles(const QStringList &files)
 | 
			
		||||
{
 | 
			
		||||
    foreach (const QString &file, files)
 | 
			
		||||
        m_searchList.remove(file);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppQuickOpenFilter::refresh(QFutureInterface<void> &future)
 | 
			
		||||
void CppLocatorFilter::refresh(QFutureInterface<void> &future)
 | 
			
		||||
{
 | 
			
		||||
    Q_UNUSED(future)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool compareLexigraphically(const QuickOpen::FilterEntry &a,
 | 
			
		||||
                                   const QuickOpen::FilterEntry &b)
 | 
			
		||||
static bool compareLexigraphically(const Locator::FilterEntry &a,
 | 
			
		||||
                                   const Locator::FilterEntry &b)
 | 
			
		||||
{
 | 
			
		||||
    return a.displayName < b.displayName;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QList<QuickOpen::FilterEntry> CppQuickOpenFilter::matchesFor(const QString &origEntry)
 | 
			
		||||
QList<Locator::FilterEntry> CppLocatorFilter::matchesFor(const QString &origEntry)
 | 
			
		||||
{
 | 
			
		||||
    QString entry = trimWildcards(origEntry);
 | 
			
		||||
    QList<QuickOpen::FilterEntry> goodEntries;
 | 
			
		||||
    QList<QuickOpen::FilterEntry> betterEntries;
 | 
			
		||||
    QList<Locator::FilterEntry> goodEntries;
 | 
			
		||||
    QList<Locator::FilterEntry> betterEntries;
 | 
			
		||||
    QStringMatcher matcher(entry, Qt::CaseInsensitive);
 | 
			
		||||
    const QRegExp regexp("*"+entry+"*", Qt::CaseInsensitive, QRegExp::Wildcard);
 | 
			
		||||
    if (!regexp.isValid())
 | 
			
		||||
@@ -108,7 +108,7 @@ QList<QuickOpen::FilterEntry> CppQuickOpenFilter::matchesFor(const QString &orig
 | 
			
		||||
                    || (!hasWildcard && matcher.indexIn(info.symbolName) != -1)) {
 | 
			
		||||
 | 
			
		||||
                QVariant id = qVariantFromValue(info);
 | 
			
		||||
                QuickOpen::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
 | 
			
		||||
                Locator::FilterEntry filterEntry(this, info.symbolName, id, info.icon);
 | 
			
		||||
                if (! info.symbolType.isEmpty())
 | 
			
		||||
                    filterEntry.extraInfo = info.symbolType;
 | 
			
		||||
                else
 | 
			
		||||
@@ -131,7 +131,7 @@ QList<QuickOpen::FilterEntry> CppQuickOpenFilter::matchesFor(const QString &orig
 | 
			
		||||
    return betterEntries;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void CppQuickOpenFilter::accept(QuickOpen::FilterEntry selection) const
 | 
			
		||||
void CppLocatorFilter::accept(Locator::FilterEntry selection) const
 | 
			
		||||
{
 | 
			
		||||
    ModelItemInfo info = qvariant_cast<CppTools::Internal::ModelItemInfo>(selection.internalData);
 | 
			
		||||
    TextEditor::BaseTextEditor::openEditorAt(info.fileName, info.line);
 | 
			
		||||
@@ -27,12 +27,12 @@
 | 
			
		||||
**
 | 
			
		||||
**************************************************************************/
 | 
			
		||||
 | 
			
		||||
#ifndef CPPQUICKOPENFILTER_H
 | 
			
		||||
#define CPPQUICKOPENFILTER_H
 | 
			
		||||
#ifndef CPPLOCATORFILTER_H
 | 
			
		||||
#define CPPLOCATORFILTER_H
 | 
			
		||||
 | 
			
		||||
#include "searchsymbols.h"
 | 
			
		||||
 | 
			
		||||
#include <quickopen/iquickopenfilter.h>
 | 
			
		||||
#include <locator/ilocatorfilter.h>
 | 
			
		||||
 | 
			
		||||
namespace Core {
 | 
			
		||||
class EditorManager;
 | 
			
		||||
@@ -43,18 +43,18 @@ namespace Internal {
 | 
			
		||||
 | 
			
		||||
class CppModelManager;
 | 
			
		||||
 | 
			
		||||
class CppQuickOpenFilter : public QuickOpen::IQuickOpenFilter
 | 
			
		||||
class CppLocatorFilter : public Locator::ILocatorFilter
 | 
			
		||||
{
 | 
			
		||||
    Q_OBJECT
 | 
			
		||||
public:
 | 
			
		||||
    CppQuickOpenFilter(CppModelManager *manager, Core::EditorManager *editorManager);
 | 
			
		||||
    ~CppQuickOpenFilter();
 | 
			
		||||
    CppLocatorFilter(CppModelManager *manager, Core::EditorManager *editorManager);
 | 
			
		||||
    ~CppLocatorFilter();
 | 
			
		||||
 | 
			
		||||
    QString trName() const { return tr("Classes and Methods"); }
 | 
			
		||||
    QString name() const { return QLatin1String("Classes and Methods"); }
 | 
			
		||||
    Priority priority() const { return Medium; }
 | 
			
		||||
    QList<QuickOpen::FilterEntry> matchesFor(const QString &entry);
 | 
			
		||||
    void accept(QuickOpen::FilterEntry selection) const;
 | 
			
		||||
    QList<Locator::FilterEntry> matchesFor(const QString &entry);
 | 
			
		||||
    void accept(Locator::FilterEntry selection) const;
 | 
			
		||||
    void refresh(QFutureInterface<void> &future);
 | 
			
		||||
 | 
			
		||||
protected:
 | 
			
		||||
@@ -86,4 +86,4 @@ private:
 | 
			
		||||
} // namespace Internal
 | 
			
		||||
} // namespace CppTools
 | 
			
		||||
 | 
			
		||||
#endif // CPPQUICKOPENFILTER_H
 | 
			
		||||
#endif // CPPLOCATORFILTER_H
 | 
			
		||||
@@ -1,7 +1,7 @@
 | 
			
		||||
TEMPLATE = lib
 | 
			
		||||
TARGET = CppTools
 | 
			
		||||
include(../../qtcreatorplugin.pri)
 | 
			
		||||
include(../../plugins/quickopen/quickopen.pri)
 | 
			
		||||
include(../../plugins/locator/locator.pri)
 | 
			
		||||
include(cpptools_dependencies.pri)
 | 
			
		||||
 | 
			
		||||
# DEFINES += QT_NO_CAST_FROM_ASCII
 | 
			
		||||
@@ -15,7 +15,7 @@ HEADERS += completionsettingspage.h \
 | 
			
		||||
    cppfunctionsfilter.h \
 | 
			
		||||
    cppmodelmanager.h \
 | 
			
		||||
    cppmodelmanagerinterface.h \
 | 
			
		||||
    cppquickopenfilter.h \
 | 
			
		||||
    cpplocatorfilter.h \
 | 
			
		||||
    cpptools_global.h \
 | 
			
		||||
    cpptoolsconstants.h \
 | 
			
		||||
    cpptoolseditorsupport.h \
 | 
			
		||||
@@ -31,7 +31,7 @@ SOURCES += completionsettingspage.cpp \
 | 
			
		||||
    cppcurrentdocumentfilter.cpp \
 | 
			
		||||
    cppfunctionsfilter.cpp \
 | 
			
		||||
    cppmodelmanager.cpp \
 | 
			
		||||
    cppquickopenfilter.cpp \
 | 
			
		||||
    cpplocatorfilter.cpp \
 | 
			
		||||
    cpptoolseditorsupport.cpp \
 | 
			
		||||
    cpptoolsplugin.cpp \
 | 
			
		||||
    searchsymbols.cpp \
 | 
			
		||||
 
 | 
			
		||||
@@ -36,7 +36,7 @@
 | 
			
		||||
#include "cppcurrentdocumentfilter.h"
 | 
			
		||||
#include "cppmodelmanager.h"
 | 
			
		||||
#include "cpptoolsconstants.h"
 | 
			
		||||
#include "cppquickopenfilter.h"
 | 
			
		||||
#include "cpplocatorfilter.h"
 | 
			
		||||
 | 
			
		||||
#include <extensionsystem/pluginmanager.h>
 | 
			
		||||
 | 
			
		||||
@@ -104,9 +104,9 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
 | 
			
		||||
 | 
			
		||||
    addAutoReleasedObject(new CppQuickFixCollector(m_modelManager));
 | 
			
		||||
 | 
			
		||||
    CppQuickOpenFilter *quickOpenFilter = new CppQuickOpenFilter(m_modelManager,
 | 
			
		||||
    CppLocatorFilter *locatorFilter = new CppLocatorFilter(m_modelManager,
 | 
			
		||||
                                                                 core->editorManager());
 | 
			
		||||
    addAutoReleasedObject(quickOpenFilter);
 | 
			
		||||
    addAutoReleasedObject(locatorFilter);
 | 
			
		||||
    addAutoReleasedObject(new CppClassesFilter(m_modelManager, core->editorManager()));
 | 
			
		||||
    addAutoReleasedObject(new CppFunctionsFilter(m_modelManager, core->editorManager()));
 | 
			
		||||
    addAutoReleasedObject(new CppCurrentDocumentFilter(m_modelManager, core->editorManager()));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user