summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/plugins/clangcodemodel/clangmodelmanagersupport.cpp9
-rw-r--r--src/plugins/clangcodemodel/clangmodelmanagersupport.h1
-rw-r--r--src/plugins/cpptools/cppeditoroutline.cpp2
-rw-r--r--src/plugins/cpptools/cppmodelmanager.cpp6
-rw-r--r--src/plugins/cpptools/cppmodelmanager.h2
-rw-r--r--src/plugins/cpptools/cppmodelmanagersupport.h4
-rw-r--r--src/plugins/cpptools/cppmodelmanagersupportinternal.cpp6
-rw-r--r--src/plugins/cpptools/cppmodelmanagersupportinternal.h1
8 files changed, 30 insertions, 1 deletions
diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
index 0371b3a06f..4859504e29 100644
--- a/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
+++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.cpp
@@ -35,6 +35,10 @@
#include "clangcurrentdocumentfilter.h"
#include <coreplugin/editormanager/editormanager.h>
+
+// TODO: replace with clang based overview model
+#include <cpptools/cppoverviewmodel.h>
+
#include <cpptools/cppcodemodelsettings.h>
#include <cpptools/cppfollowsymbolundercursor.h>
#include <cpptools/cppmodelmanager.h>
@@ -144,6 +148,11 @@ CppTools::RefactoringEngineInterface &ModelManagerSupportClang::refactoringEngin
return *m_refactoringEngine;
}
+std::unique_ptr<CppTools::AbstractOverviewModel> ModelManagerSupportClang::createOverviewModel()
+{
+ return std::make_unique<CppTools::OverviewModel>();
+}
+
CppTools::BaseEditorDocumentProcessor *ModelManagerSupportClang::createEditorDocumentProcessor(
TextEditor::TextDocument *baseTextDocument)
{
diff --git a/src/plugins/clangcodemodel/clangmodelmanagersupport.h b/src/plugins/clangcodemodel/clangmodelmanagersupport.h
index d8c3e1c917..3b62aae108 100644
--- a/src/plugins/clangcodemodel/clangmodelmanagersupport.h
+++ b/src/plugins/clangcodemodel/clangmodelmanagersupport.h
@@ -71,6 +71,7 @@ public:
TextEditor::TextDocument *baseTextDocument) override;
CppTools::FollowSymbolInterface &followSymbolInterface() override;
CppTools::RefactoringEngineInterface &refactoringEngineInterface() override;
+ std::unique_ptr<CppTools::AbstractOverviewModel> createOverviewModel() override;
BackendCommunicator &communicator();
QString dummyUiHeaderOnDiskDirPath() const;
diff --git a/src/plugins/cpptools/cppeditoroutline.cpp b/src/plugins/cpptools/cppeditoroutline.cpp
index 033f5e9090..e629ea8230 100644
--- a/src/plugins/cpptools/cppeditoroutline.cpp
+++ b/src/plugins/cpptools/cppeditoroutline.cpp
@@ -94,7 +94,7 @@ CppEditorOutline::CppEditorOutline(TextEditor::TextEditorWidget *editorWidget)
, m_editorWidget(editorWidget)
, m_combo(new Utils::TreeViewComboBox)
{
- m_model = std::make_unique<CppTools::OverviewModel>();
+ m_model = CppModelManager::instance()->createOverviewModel();
m_proxyModel = new OverviewProxyModel(*m_model, this);
m_proxyModel->setSourceModel(m_model.get());
diff --git a/src/plugins/cpptools/cppmodelmanager.cpp b/src/plugins/cpptools/cppmodelmanager.cpp
index 508bf76be4..ed9042b001 100644
--- a/src/plugins/cpptools/cppmodelmanager.cpp
+++ b/src/plugins/cpptools/cppmodelmanager.cpp
@@ -26,6 +26,7 @@
#include "cppmodelmanager.h"
#include "abstracteditorsupport.h"
+#include "abstractoverviewmodel.h"
#include "baseeditordocumentprocessor.h"
#include "builtinindexingsupport.h"
#include "cppclassesfilter.h"
@@ -400,6 +401,11 @@ FollowSymbolInterface &CppModelManager::followSymbolInterface() const
return d->m_activeModelManagerSupport->followSymbolInterface();
}
+std::unique_ptr<AbstractOverviewModel> CppModelManager::createOverviewModel() const
+{
+ return d->m_activeModelManagerSupport->createOverviewModel();
+}
+
QString CppModelManager::configurationFileName()
{
return Preprocessor::configurationFileName();
diff --git a/src/plugins/cpptools/cppmodelmanager.h b/src/plugins/cpptools/cppmodelmanager.h
index 7bd7ce157a..7dd32fd860 100644
--- a/src/plugins/cpptools/cppmodelmanager.h
+++ b/src/plugins/cpptools/cppmodelmanager.h
@@ -54,6 +54,7 @@ class TextDocument;
namespace CppTools {
class AbstractEditorSupport;
+class AbstractOverviewModel;
class BaseEditorDocumentProcessor;
class CppCompletionAssistProvider;
class CppEditorDocumentHandle;
@@ -183,6 +184,7 @@ public:
TextEditor::TextDocument *baseTextDocument) const;
TextEditor::BaseHoverHandler *createHoverHandler() const;
FollowSymbolInterface &followSymbolInterface() const;
+ std::unique_ptr<AbstractOverviewModel> createOverviewModel() const;
void setIndexingSupport(CppIndexingSupport *indexingSupport);
CppIndexingSupport *indexingSupport();
diff --git a/src/plugins/cpptools/cppmodelmanagersupport.h b/src/plugins/cpptools/cppmodelmanagersupport.h
index 06102f6007..c5457cd51f 100644
--- a/src/plugins/cpptools/cppmodelmanagersupport.h
+++ b/src/plugins/cpptools/cppmodelmanagersupport.h
@@ -30,6 +30,8 @@
#include <QSharedPointer>
#include <QString>
+#include <memory>
+
namespace TextEditor {
class TextDocument;
class BaseHoverHandler;
@@ -37,6 +39,7 @@ class BaseHoverHandler;
namespace CppTools {
+class AbstractOverviewModel;
class BaseEditorDocumentProcessor;
class CppCompletionAssistProvider;
class FollowSymbolInterface;
@@ -56,6 +59,7 @@ public:
TextEditor::TextDocument *baseTextDocument) = 0;
virtual FollowSymbolInterface &followSymbolInterface() = 0;
virtual RefactoringEngineInterface &refactoringEngineInterface() = 0;
+ virtual std::unique_ptr<AbstractOverviewModel> createOverviewModel() = 0;
};
class CPPTOOLS_EXPORT ModelManagerSupportProvider
diff --git a/src/plugins/cpptools/cppmodelmanagersupportinternal.cpp b/src/plugins/cpptools/cppmodelmanagersupportinternal.cpp
index 5191995554..2bf4ac2700 100644
--- a/src/plugins/cpptools/cppmodelmanagersupportinternal.cpp
+++ b/src/plugins/cpptools/cppmodelmanagersupportinternal.cpp
@@ -27,6 +27,7 @@
#include "cppmodelmanagersupportinternal.h"
#include "cppfollowsymbolundercursor.h"
#include "cpphoverhandler.h"
+#include "cppoverviewmodel.h"
#include "cpprefactoringengine.h"
#include "builtineditordocumentprocessor.h"
@@ -89,3 +90,8 @@ RefactoringEngineInterface &ModelManagerSupportInternal::refactoringEngineInterf
{
return *m_refactoringEngine;
}
+
+std::unique_ptr<AbstractOverviewModel> ModelManagerSupportInternal::createOverviewModel()
+{
+ return std::make_unique<CppTools::OverviewModel>();
+}
diff --git a/src/plugins/cpptools/cppmodelmanagersupportinternal.h b/src/plugins/cpptools/cppmodelmanagersupportinternal.h
index e2954792ea..cfa326e778 100644
--- a/src/plugins/cpptools/cppmodelmanagersupportinternal.h
+++ b/src/plugins/cpptools/cppmodelmanagersupportinternal.h
@@ -46,6 +46,7 @@ public:
TextEditor::TextDocument *baseTextDocument) final;
FollowSymbolInterface &followSymbolInterface() final;
RefactoringEngineInterface &refactoringEngineInterface() final;
+ std::unique_ptr<AbstractOverviewModel> createOverviewModel() final;
private:
QScopedPointer<CppCompletionAssistProvider> m_completionAssistProvider;