ProjectExplorer: Provide ProjectDocument and use it in all projects

Change-Id: I6e054ebf1043bd1f6748f1567f35c68394bd6528
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tobias Hunger
2017-03-29 11:11:49 +02:00
parent df64242ab2
commit 348aa12eaa
23 changed files with 80 additions and 476 deletions

View File

@@ -24,7 +24,6 @@
****************************************************************************/
#include "qmlproject.h"
#include "qmlprojectfile.h"
#include "fileformat/qmlprojectfileformat.h"
#include "fileformat/qmlprojectitem.h"
#include "qmlprojectrunconfiguration.h"
@@ -59,8 +58,8 @@ QmlProject::QmlProject(const Utils::FileName &fileName) :
m_defaultImport(UnknownImport)
{
setId("QmlProjectManager.QmlProject");
setDocument(new Internal::QmlProjectFile(this, fileName));
DocumentManager::addDocument(document(), true);
setDocument(new ProjectDocument(QString::fromLatin1(Constants::QMLPROJECT_MIMETYPE), fileName,
[this]() { refreshProjectFile(); }));
setProjectContext(Context(QmlProjectManager::Constants::PROJECTCONTEXT));
setProjectLanguages(Context(ProjectExplorer::Constants::QMLJS_LANGUAGE_ID));