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>
This commit is contained in:
Tobias Hunger
2016-01-08 11:09:37 +01:00
parent dc3ca42eea
commit b386dd0e99
24 changed files with 62 additions and 123 deletions

View File

@@ -74,14 +74,12 @@ using namespace ProjectExplorer;
AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fileName) :
m_manager(manager),
m_fileName(fileName),
m_files(),
m_file(new AutotoolsProjectFile(this, m_fileName)),
m_rootNode(new AutotoolsProjectNode(m_file->filePath())),
m_fileWatcher(new Utils::FileSystemWatcher(this)),
m_watchedFiles(),
m_makefileParserThread(0)
{
setId(Constants::AUTOTOOLS_PROJECT_ID);
setDocument(new AutotoolsProjectFile(m_fileName));
m_rootNode = new AutotoolsProjectNode(projectFilePath());
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
@@ -112,11 +110,6 @@ QString AutotoolsProject::displayName() const
return m_projectName;
}
Core::IDocument *AutotoolsProject::document() const
{
return m_file;
}
IProjectManager *AutotoolsProject::projectManager() const
{
return m_manager;

View File

@@ -74,10 +74,9 @@ public:
~AutotoolsProject() override;
QString displayName() const override;
Core::IDocument *document() const override;
ProjectExplorer::IProjectManager *projectManager() const override;
ProjectExplorer::ProjectNode *rootProjectNode() const override;
QStringList files(FilesMode fileMode) const;
QStringList files(FilesMode fileMode) const override;
static QString defaultBuildDirectory(const QString &projectPath);
QStringList buildTargets() const;
@@ -147,9 +146,6 @@ private:
/// Return value for AutotoolsProject::files()
QStringList m_files;
/// Return value for AutotoolsProject::file()
AutotoolsProjectFile *m_file;
/// Return value for AutotoolsProject::rootProjectNode()
AutotoolsProjectNode *m_rootNode;

View File

@@ -37,9 +37,7 @@
using namespace AutotoolsProjectManager;
using namespace AutotoolsProjectManager::Internal;
AutotoolsProjectFile::AutotoolsProjectFile(AutotoolsProject *project, const QString &fileName) :
Core::IDocument(project),
m_project(project)
AutotoolsProjectFile::AutotoolsProjectFile(const QString &fileName)
{
setId("Autotools.ProjectFile");
setMimeType(QLatin1String(Constants::MAKEFILE_MIMETYPE));

View File

@@ -55,7 +55,7 @@ class AutotoolsProjectFile : public Core::IDocument
Q_OBJECT
public:
AutotoolsProjectFile(AutotoolsProject *project, const QString &fileName);
AutotoolsProjectFile(const QString &fileName);
bool save(QString *errorString, const QString &fileName, bool autoSave) override;
QString defaultPath() const override;
@@ -63,9 +63,6 @@ public:
bool isModified() const override;
bool isSaveAsAllowed() const override;
bool reload(QString *errorString, ReloadFlag flag, ChangeType type) override;
private:
AutotoolsProject *m_project;
};
} // namespace Internal