diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-03-27 12:12:38 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-03-27 15:32:13 +0000 |
commit | fc5ce1e710500bb603ceafb9a2c005bbaf2f7cec (patch) | |
tree | 473544ed89fa3158c18f709445314f639f9485f8 /src/plugins/qmlprojectmanager/qmlproject.cpp | |
parent | d1a53045640fc37f00ae556e683a87927cdddf91 (diff) | |
download | qt-creator-fc5ce1e710500bb603ceafb9a2c005bbaf2f7cec.tar.gz |
ProjectExplorer: Handle project file list globally
Handle the generation of the list of files in a project globally, based
on the project tree.
Creator now has the concept of TreeManagers which can enrich the project
tree with additional data (e.g. the files found in a resource file), which
the project does not necessarily know about. So use that tree to find
the files that belong to a project instead of implementing similar features
in each project.
Change-Id: Ia375a914a1f2c0adaa427f9eda834eec2db07f68
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Diffstat (limited to 'src/plugins/qmlprojectmanager/qmlproject.cpp')
-rw-r--r-- | src/plugins/qmlprojectmanager/qmlproject.cpp | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/plugins/qmlprojectmanager/qmlproject.cpp b/src/plugins/qmlprojectmanager/qmlproject.cpp index bb88cc898e..43fbe6ab56 100644 --- a/src/plugins/qmlprojectmanager/qmlproject.cpp +++ b/src/plugins/qmlprojectmanager/qmlproject.cpp @@ -168,9 +168,6 @@ void QmlProject::parseProject(RefreshOptions options) if (options & Configuration) { // update configuration } - - if (options & Files) - emit fileListChanged(); } void QmlProject::refresh(RefreshOptions options) @@ -195,16 +192,6 @@ void QmlProject::refresh(RefreshOptions options) emit parsingFinished(); } -QStringList QmlProject::files() const -{ - QStringList files; - if (m_projectItem) - files = m_projectItem.data()->files(); - else - files = m_files; - return files; -} - QString QmlProject::mainFile() const { if (m_projectItem) @@ -296,11 +283,6 @@ Internal::QmlProjectNode *QmlProject::rootProjectNode() const return static_cast<Internal::QmlProjectNode *>(Project::rootProjectNode()); } -QStringList QmlProject::files(FilesMode) const -{ - return files(); -} - Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *errorMessage) { RestoreResult result = Project::fromMap(map, errorMessage); @@ -371,9 +353,12 @@ Project::RestoreResult QmlProject::fromMap(const QVariantMap &map, QString *erro void QmlProject::generateProjectTree() { + if (!m_projectItem) + return; + auto newRoot = new Internal::QmlProjectNode(this); - for (const QString &f : files()) { + for (const QString &f : m_projectItem.data()->files()) { FileType fileType = FileType::Source; // ### FIXME if (f == projectFilePath().toString()) fileType = FileType::Project; |