EditorManager: Use interface directly instead of going through ICore

In the majority of cases we were doing that anyways, having two
ways is just needlessly confusing.

Change-Id: Ied362a702c23beee528368d74df1f2aabe5807f8
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
hjk
2013-08-29 17:17:24 +02:00
parent 4a24df38a3
commit eb724f3772
29 changed files with 76 additions and 108 deletions

View File

@@ -36,7 +36,7 @@
using namespace CppTools::Internal;
using namespace CPlusPlus;
CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager)
CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager)
: m_modelManager(manager)
{
setId("Methods in current Document");
@@ -51,9 +51,9 @@ CppCurrentDocumentFilter::CppCurrentDocumentFilter(CppModelManager *manager, Cor
connect(manager, SIGNAL(documentUpdated(CPlusPlus::Document::Ptr)),
this, SLOT(onDocumentUpdated(CPlusPlus::Document::Ptr)));
connect(editorManager, SIGNAL(currentEditorChanged(Core::IEditor*)),
connect(Core::EditorManager::instance(), SIGNAL(currentEditorChanged(Core::IEditor*)),
this, SLOT(onCurrentEditorChanged(Core::IEditor*)));
connect(editorManager, SIGNAL(editorAboutToClose(Core::IEditor*)),
connect(Core::EditorManager::instance(), SIGNAL(editorAboutToClose(Core::IEditor*)),
this, SLOT(onEditorAboutToClose(Core::IEditor*)));
}

View File

@@ -33,10 +33,7 @@
#include <locator/ilocatorfilter.h>
namespace Core {
class EditorManager;
class IEditor;
}
namespace Core { class IEditor; }
namespace CppTools {
namespace Internal {
@@ -48,7 +45,7 @@ class CppCurrentDocumentFilter : public Locator::ILocatorFilter
Q_OBJECT
public:
CppCurrentDocumentFilter(CppModelManager *manager, Core::EditorManager *editorManager);
explicit CppCurrentDocumentFilter(CppModelManager *manager);
~CppCurrentDocumentFilter() {}
QList<Locator::FilterEntry> matchesFor(QFutureInterface<Locator::FilterEntry> &future, const QString &entry);

View File

@@ -104,7 +104,7 @@ bool CppToolsPlugin::initialize(const QStringList &arguments, QString *error)
addAutoReleasedObject(new CppLocatorFilter(modelManager));
addAutoReleasedObject(new CppClassesFilter(modelManager));
addAutoReleasedObject(new CppFunctionsFilter(modelManager));
addAutoReleasedObject(new CppCurrentDocumentFilter(modelManager, Core::ICore::editorManager()));
addAutoReleasedObject(new CppCurrentDocumentFilter(modelManager));
addAutoReleasedObject(new CppFileSettingsPage(m_fileSettings));
addAutoReleasedObject(new SymbolsFindFilter(modelManager));
addAutoReleasedObject(new CppCodeStyleSettingsPage);