forked from qt-creator/qt-creator
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:
@@ -113,6 +113,10 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
|
||||
m_parsingDelay.setInterval(1000); // delay parsing by 1s.
|
||||
|
||||
setId(Constants::PROJECT_ID);
|
||||
|
||||
setDocument(new QbsProjectFile(this, m_fileName));
|
||||
DocumentManager::addDocument(document());
|
||||
|
||||
setProjectContext(Context(Constants::PROJECT_ID));
|
||||
setProjectLanguages(Context(ProjectExplorer::Constants::LANG_CXX));
|
||||
|
||||
@@ -124,8 +128,6 @@ QbsProject::QbsProject(QbsManager *manager, const QString &fileName) :
|
||||
|
||||
connect(&m_parsingDelay, SIGNAL(timeout()), this, SLOT(startParsing()));
|
||||
|
||||
updateDocuments(QSet<QString>() << fileName);
|
||||
|
||||
// NOTE: QbsProjectNode does not use this as a parent!
|
||||
m_rootProjectNode = new QbsRootProjectNode(this); // needs documents to be initialized!
|
||||
}
|
||||
@@ -153,15 +155,6 @@ QString QbsProject::displayName() const
|
||||
return m_projectName;
|
||||
}
|
||||
|
||||
IDocument *QbsProject::document() const
|
||||
{
|
||||
foreach (IDocument *doc, m_qbsDocuments) {
|
||||
if (doc->filePath().toString() == m_fileName)
|
||||
return doc;
|
||||
}
|
||||
QTC_ASSERT(false, return 0);
|
||||
}
|
||||
|
||||
QbsManager *QbsProject::projectManager() const
|
||||
{
|
||||
return m_manager;
|
||||
|
||||
Reference in New Issue
Block a user