diff options
author | Tim Jenssen <tim.jenssen@qt.io> | 2018-05-24 11:17:04 +0200 |
---|---|---|
committer | Tim Jenssen <tim.jenssen@qt.io> | 2018-05-24 10:09:26 +0000 |
commit | b5a4e88485a130c00b465f24e228f712684eb98a (patch) | |
tree | ea18f986c5b0d9ccc7527f8e251b642432b6b89d /src/plugins/qtsupport | |
parent | 3fa66ca6e0f240f05a77d177dbf7cb7a6f7609db (diff) |
FileInProjectFinder: Use FileNameList for file names
This simplifies code and reduces the number of conversions between
QString and Utils::FileName.
Change-Id: I47bd86b9ae09b1da37b4e5e604761367ac1ab26b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/qtsupport')
-rw-r--r-- | src/plugins/qtsupport/baseqtversion.cpp | 8 | ||||
-rw-r--r-- | src/plugins/qtsupport/qtoutputformatter.cpp | 4 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp index 12941ee0d2..34e4ef20e3 100644 --- a/src/plugins/qtsupport/baseqtversion.cpp +++ b/src/plugins/qtsupport/baseqtversion.cpp @@ -1413,20 +1413,18 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar QTC_CHECK(projects.isEmpty() || startupProject); QString projectDirectory; - QStringList sourceFiles; + Utils::FileNameList sourceFiles; // Sort files from startupProject to the front of the list ... if (startupProject) { projectDirectory = startupProject->projectDirectory().toString(); - sourceFiles.append(Utils::transform(startupProject->files(ProjectExplorer::Project::SourceFiles), - &Utils::FileName::toString)); + sourceFiles.append(startupProject->files(ProjectExplorer::Project::SourceFiles)); } // ... then add all the other projects' files. for (const ProjectExplorer::Project *project : projects) { if (project != startupProject) - sourceFiles.append(Utils::transform(project->files(ProjectExplorer::Project::SourceFiles), - &Utils::FileName::toString)); + sourceFiles.append(project->files(ProjectExplorer::Project::SourceFiles)); } // If no target was given, but we've found a startupProject, then try to deduce a diff --git a/src/plugins/qtsupport/qtoutputformatter.cpp b/src/plugins/qtsupport/qtoutputformatter.cpp index 67984fce30..25ee4a07d7 100644 --- a/src/plugins/qtsupport/qtoutputformatter.cpp +++ b/src/plugins/qtsupport/qtoutputformatter.cpp @@ -87,7 +87,7 @@ QtOutputFormatter::QtOutputFormatter(Project *project) : d(new Internal::QtOutputFormatterPrivate(project)) { if (project) { - d->projectFinder.setProjectFiles(Utils::transform(project->files(Project::SourceFiles), &Utils::FileName::toString)); + d->projectFinder.setProjectFiles(project->files(Project::SourceFiles)); d->projectFinder.setProjectDirectory(project->projectDirectory().toString()); connect(project, &Project::fileListChanged, @@ -281,7 +281,7 @@ void QtOutputFormatter::openEditor(const QString &fileName, int line, int column void QtOutputFormatter::updateProjectFileList() { if (d->project) - d->projectFinder.setProjectFiles(transform(d->project->files(Project::SourceFiles), &FileName::toString)); + d->projectFinder.setProjectFiles(d->project->files(Project::SourceFiles)); } } // namespace QtSupport |