summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.cpp6
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsproject.h1
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.cpp6
-rw-r--r--src/plugins/cmakeprojectmanager/cmakeproject.h1
-rw-r--r--src/plugins/cpptools/modelmanagertesthelper.cpp1
-rw-r--r--src/plugins/cpptools/modelmanagertesthelper.h3
-rw-r--r--src/plugins/genericprojectmanager/genericproject.cpp6
-rw-r--r--src/plugins/genericprojectmanager/genericproject.h1
-rw-r--r--src/plugins/projectexplorer/project.cpp12
-rw-r--r--src/plugins/projectexplorer/project.h3
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.cpp6
-rw-r--r--src/plugins/qbsprojectmanager/qbsproject.h1
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.cpp6
-rw-r--r--src/plugins/qmlprojectmanager/qmlproject.h1
-rw-r--r--src/plugins/qt4projectmanager/qt4project.cpp6
-rw-r--r--src/plugins/qt4projectmanager/qt4project.h1
16 files changed, 21 insertions, 40 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
index 2891954bf1..a1c9c15984 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.cpp
@@ -78,6 +78,7 @@ AutotoolsProject::AutotoolsProject(AutotoolsManager *manager, const QString &fil
m_watchedFiles(),
m_makefileParserThread(0)
{
+ setId(Constants::AUTOTOOLS_PROJECT_ID);
setProjectContext(Core::Context(Constants::PROJECT_CONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
@@ -108,11 +109,6 @@ QString AutotoolsProject::displayName() const
return m_projectName;
}
-Core::Id AutotoolsProject::id() const
-{
- return Core::Id(Constants::AUTOTOOLS_PROJECT_ID);
-}
-
Core::IDocument *AutotoolsProject::document() const
{
return m_file;
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsproject.h b/src/plugins/autotoolsprojectmanager/autotoolsproject.h
index f5304358c5..e9bc643c6b 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsproject.h
+++ b/src/plugins/autotoolsprojectmanager/autotoolsproject.h
@@ -73,7 +73,6 @@ public:
~AutotoolsProject();
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const;
ProjectExplorer::ProjectNode *rootProjectNode() const;
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
index 68acc76aa6..8708272914 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp
@@ -92,6 +92,7 @@ CMakeProject::CMakeProject(CMakeManager *manager, const QString &fileName)
m_rootNode(new CMakeProjectNode(fileName)),
m_watcher(new QFileSystemWatcher(this))
{
+ setId(Constants::CMAKEPROJECT_ID);
setProjectContext(Core::Context(CMakeProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
@@ -512,11 +513,6 @@ QString CMakeProject::displayName() const
return m_projectName;
}
-Core::Id CMakeProject::id() const
-{
- return Core::Id(Constants::CMAKEPROJECT_ID);
-}
-
Core::IDocument *CMakeProject::document() const
{
return m_file;
diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.h b/src/plugins/cmakeprojectmanager/cmakeproject.h
index c950575e0f..f89081bd43 100644
--- a/src/plugins/cmakeprojectmanager/cmakeproject.h
+++ b/src/plugins/cmakeprojectmanager/cmakeproject.h
@@ -80,7 +80,6 @@ public:
~CMakeProject();
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
CMakeManager *projectManager() const;
diff --git a/src/plugins/cpptools/modelmanagertesthelper.cpp b/src/plugins/cpptools/modelmanagertesthelper.cpp
index 4d7590e130..9c139c5a7b 100644
--- a/src/plugins/cpptools/modelmanagertesthelper.cpp
+++ b/src/plugins/cpptools/modelmanagertesthelper.cpp
@@ -39,6 +39,7 @@ TestProject::TestProject(const QString &name, QObject *parent)
: m_name (name)
{
setParent(parent);
+ setId(Core::Id::fromString(name));
}
TestProject::~TestProject()
diff --git a/src/plugins/cpptools/modelmanagertesthelper.h b/src/plugins/cpptools/modelmanagertesthelper.h
index d4ac671bc1..4ed45195cd 100644
--- a/src/plugins/cpptools/modelmanagertesthelper.h
+++ b/src/plugins/cpptools/modelmanagertesthelper.h
@@ -48,9 +48,6 @@ public:
virtual QString displayName() const
{ return m_name; }
- virtual Core::Id id() const
- { return Core::Id::fromString(m_name); }
-
virtual Core::IDocument *document() const
{ return 0; }
diff --git a/src/plugins/genericprojectmanager/genericproject.cpp b/src/plugins/genericprojectmanager/genericproject.cpp
index 784f425235..2af8354999 100644
--- a/src/plugins/genericprojectmanager/genericproject.cpp
+++ b/src/plugins/genericprojectmanager/genericproject.cpp
@@ -69,6 +69,7 @@ GenericProject::GenericProject(Manager *manager, const QString &fileName)
: m_manager(manager),
m_fileName(fileName)
{
+ setId(Constants::GENERICPROJECT_ID);
setProjectContext(Context(GenericProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
@@ -375,11 +376,6 @@ QString GenericProject::displayName() const
return m_projectName;
}
-Id GenericProject::id() const
-{
- return Id(Constants::GENERICPROJECT_ID);
-}
-
IDocument *GenericProject::document() const
{
return m_creatorIDocument;
diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h
index f4f2fb5457..0291485f18 100644
--- a/src/plugins/genericprojectmanager/genericproject.h
+++ b/src/plugins/genericprojectmanager/genericproject.h
@@ -60,7 +60,6 @@ public:
QString configFileName() const;
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const;
diff --git a/src/plugins/projectexplorer/project.cpp b/src/plugins/projectexplorer/project.cpp
index e5b49f2ce9..63c0051fcf 100644
--- a/src/plugins/projectexplorer/project.cpp
+++ b/src/plugins/projectexplorer/project.cpp
@@ -85,6 +85,7 @@ public:
ProjectPrivate();
~ProjectPrivate();
+ Core::Id m_id;
QList<Target *> m_targets;
Target *m_activeTarget;
EditorConfiguration *m_editorConfiguration;
@@ -114,6 +115,12 @@ Project::~Project()
delete d;
}
+Core::Id Project::id() const
+{
+ QTC_CHECK(d->m_id.isValid());
+ return d->m_id;
+}
+
QString Project::projectFilePath() const
{
return document()->filePath();
@@ -264,6 +271,11 @@ bool Project::setupTarget(Target *t)
return true;
}
+void Project::setId(Core::Id id)
+{
+ d->m_id = id;
+}
+
Target *Project::restoreTarget(const QVariantMap &data)
{
Core::Id id = idFromMap(data);
diff --git a/src/plugins/projectexplorer/project.h b/src/plugins/projectexplorer/project.h
index 782fa9932c..c61db0cb21 100644
--- a/src/plugins/projectexplorer/project.h
+++ b/src/plugins/projectexplorer/project.h
@@ -73,7 +73,7 @@ public:
virtual ~Project();
virtual QString displayName() const = 0;
- virtual Core::Id id() const = 0;
+ Core::Id id() const;
virtual Core::IDocument *document() const = 0;
virtual IProjectManager *projectManager() const = 0;
@@ -164,6 +164,7 @@ protected:
virtual bool fromMap(const QVariantMap &map);
virtual bool setupTarget(Target *t);
+ void setId(Core::Id id);
void setProjectContext(Core::Context context);
void setProjectLanguages(Core::Context language);
void addProjectLanguage(Core::Id id);
diff --git a/src/plugins/qbsprojectmanager/qbsproject.cpp b/src/plugins/qbsprojectmanager/qbsproject.cpp
index d6b4c262bb..5bfa4ddf61 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.cpp
+++ b/src/plugins/qbsprojectmanager/qbsproject.cpp
@@ -102,6 +102,7 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
{
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
+ setId(Constants::PROJECT_ID);
setProjectContext(Context(Constants::PROJECT_ID));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
@@ -132,11 +133,6 @@ QString QbsProject::displayName() const
return m_projectName;
}
-Id QbsProject::id() const
-{
- return Constants::PROJECT_ID;
-}
-
IDocument *QbsProject::document() const
{
foreach (IDocument *doc, m_qbsDocuments) {
diff --git a/src/plugins/qbsprojectmanager/qbsproject.h b/src/plugins/qbsprojectmanager/qbsproject.h
index 1a8d9232d8..d43ead569c 100644
--- a/src/plugins/qbsprojectmanager/qbsproject.h
+++ b/src/plugins/qbsprojectmanager/qbsproject.h
@@ -74,7 +74,6 @@ public:
~QbsProject();
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
QbsManager *projectManager() const;
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp
index dabdf32771..9973dbd34d 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.cpp
+++ b/src/plugins/qmlprojectmanager/qmlproject.cpp
@@ -110,6 +110,7 @@ QmlProject::QmlProject(Internal::Manager *manager, const QString &fileName)
m_defaultImport(UnknownImport),
m_modelManager(QmlJS::ModelManagerInterface::instance())
{
+ setId("QmlProjectManager.QmlProject");
setProjectContext(Context(QmlProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_QMLJS));
@@ -311,11 +312,6 @@ QString QmlProject::displayName() const
return m_projectName;
}
-Id QmlProject::id() const
-{
- return "QmlProjectManager.QmlProject";
-}
-
IDocument *QmlProject::document() const
{
return m_file;
diff --git a/src/plugins/qmlprojectmanager/qmlproject.h b/src/plugins/qmlprojectmanager/qmlproject.h
index 01b6ccb589..6a6033479e 100644
--- a/src/plugins/qmlprojectmanager/qmlproject.h
+++ b/src/plugins/qmlprojectmanager/qmlproject.h
@@ -61,7 +61,6 @@ public:
QString filesFileName() const;
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const;
diff --git a/src/plugins/qt4projectmanager/qt4project.cpp b/src/plugins/qt4projectmanager/qt4project.cpp
index 9d65382d92..edc57f369e 100644
--- a/src/plugins/qt4projectmanager/qt4project.cpp
+++ b/src/plugins/qt4projectmanager/qt4project.cpp
@@ -343,6 +343,7 @@ Qt4Project::Qt4Project(Qt4Manager *manager, const QString& fileName) :
m_centralizedFolderWatcher(0),
m_activeTarget(0)
{
+ setId(Constants::QT4PROJECT_ID);
setProjectContext(Core::Context(Qt4ProjectManager::Constants::PROJECT_ID));
setProjectLanguages(Core::Context(ProjectExplorer::Constants::LANG_CXX));
@@ -888,11 +889,6 @@ QString Qt4Project::displayName() const
return QFileInfo(projectFilePath()).completeBaseName();
}
-Core::Id Qt4Project::id() const
-{
- return Core::Id(Constants::QT4PROJECT_ID);
-}
-
Core::IDocument *Qt4Project::document() const
{
return m_fileInfo;
diff --git a/src/plugins/qt4projectmanager/qt4project.h b/src/plugins/qt4projectmanager/qt4project.h
index 43afcbe728..666170c55e 100644
--- a/src/plugins/qt4projectmanager/qt4project.h
+++ b/src/plugins/qt4projectmanager/qt4project.h
@@ -77,7 +77,6 @@ public:
virtual ~Qt4Project();
QString displayName() const;
- Core::Id id() const;
Core::IDocument *document() const;
ProjectExplorer::IProjectManager *projectManager() const;
Qt4Manager *qt4ProjectManager() const;