summaryrefslogtreecommitdiff
path: root/src/plugins/pythoneditor/pythoneditorplugin.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@theqtcompany.com>2016-01-08 11:09:37 +0100
committerTobias Hunger <tobias.hunger@theqtcompany.com>2016-01-11 12:18:11 +0000
commitb386dd0e991492d4d8da59d35aa615e509d10a6e (patch)
treea8120359d2a0b9542d4a0b3d8a6a24caaea92e53 /src/plugins/pythoneditor/pythoneditorplugin.cpp
parentdc3ca42eeaa9b74c98c48ce68ca4c9aa795ca301 (diff)
downloadqt-creator-b386dd0e991492d4d8da59d35aa615e509d10a6e.tar.gz
Project: Add setDocument method
Add setDocument method, implement document method, use this in all projects. Change-Id: I5018bf7c2739665c13eee340184ce7c41fd319bb Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src/plugins/pythoneditor/pythoneditorplugin.cpp')
-rw-r--r--src/plugins/pythoneditor/pythoneditorplugin.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/plugins/pythoneditor/pythoneditorplugin.cpp b/src/plugins/pythoneditor/pythoneditorplugin.cpp
index ce9dfe0193..d6485c6e80 100644
--- a/src/plugins/pythoneditor/pythoneditorplugin.cpp
+++ b/src/plugins/pythoneditor/pythoneditorplugin.cpp
@@ -249,7 +249,6 @@ public:
~PythonProject() override;
QString displayName() const override { return m_projectName; }
- IDocument *document() const override;
IProjectManager *projectManager() const override { return m_manager; }
ProjectNode *rootProjectNode() const override;
@@ -274,7 +273,6 @@ private:
PythonProjectManager *m_manager;
QString m_projectFileName;
QString m_projectName;
- PythonProjectFile *m_document;
QStringList m_rawFileList;
QStringList m_files;
QHash<QString, QString> m_rawListEntries;
@@ -285,9 +283,7 @@ private:
class PythonProjectFile : public Core::IDocument
{
public:
- PythonProjectFile(PythonProject *parent, QString fileName)
- : IDocument(parent),
- m_project(parent)
+ PythonProjectFile(PythonProject *parent, QString fileName) : m_project(parent)
{
setId("Generic.ProjectFile");
setMimeType(QLatin1String(PythonMimeType));
@@ -626,16 +622,15 @@ PythonProject::PythonProject(PythonProjectManager *manager, const QString &fileN
m_projectFileName(fileName)
{
setId(PythonProjectId);
+ setDocument(new PythonProjectFile(this, m_projectFileName));
+ DocumentManager::addDocument(document());
+
setProjectContext(Context(PythonProjectContext));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
QFileInfo fileInfo(m_projectFileName);
m_projectName = fileInfo.completeBaseName();
- m_document = new PythonProjectFile(this, m_projectFileName);
-
- DocumentManager::addDocument(m_document);
-
m_rootNode = new PythonProjectNode(this);
m_manager->registerProject(this);
@@ -648,11 +643,6 @@ PythonProject::~PythonProject()
delete m_rootNode;
}
-IDocument *PythonProject::document() const
-{
- return m_document;
-}
-
static QStringList readLines(const QString &absoluteFileName)
{
QStringList lines;