Commit 18f38ff1 authored by Tobias Hunger's avatar Tobias Hunger

Project: Make Project::files return a FileNameList

Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3
Reviewed-by: Eike Ziller's avatarEike Ziller <eike.ziller@qt.io>
parent e6fb9f08
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <qtsupport/qtkitinformation.h> #include <qtsupport/qtkitinformation.h>
#include <utils/algorithm.h>
#include <utils/synchronousprocess.h> #include <utils/synchronousprocess.h>
#include <utils/utilsicons.h> #include <utils/utilsicons.h>
...@@ -157,7 +158,8 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps) ...@@ -157,7 +158,8 @@ bool AndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
} }
JavaParser *parser = new JavaParser; JavaParser *parser = new JavaParser;
parser->setProjectFileList(target()->project()->files(ProjectExplorer::Project::AllFiles)); parser->setProjectFileList(Utils::transform(target()->project()->files(ProjectExplorer::Project::AllFiles),
&Utils::FileName::toString));
parser->setSourceDirectory(androidPackageSourceDir()); parser->setSourceDirectory(androidPackageSourceDir());
parser->setBuildDirectory(Utils::FileName::fromString(bc->buildDirectory().appendPath(Constants::ANDROID_BUILDDIRECTORY).toString())); parser->setBuildDirectory(Utils::FileName::fromString(bc->buildDirectory().appendPath(Constants::ANDROID_BUILDDIRECTORY).toString()));
setOutputParser(parser); setOutputParser(parser);
......
...@@ -343,7 +343,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList, ITestParser *pars ...@@ -343,7 +343,7 @@ void TestCodeParser::scanForTests(const QStringList &fileList, ITestParser *pars
return; return;
QStringList list; QStringList list;
if (isFullParse) { if (isFullParse) {
list = project->files(Project::SourceFiles); list = Utils::transform(project->files(Project::SourceFiles), &Utils::FileName::toString);
if (list.isEmpty()) { if (list.isEmpty()) {
// at least project file should be there, but might happen if parsing current project // at least project file should be there, but might happen if parsing current project
// takes too long, especially when opening sessions holding multiple projects // takes too long, especially when opening sessions holding multiple projects
......
...@@ -118,13 +118,13 @@ QString ArtisticStyle::configurationFile() const ...@@ -118,13 +118,13 @@ QString ArtisticStyle::configurationFile() const
if (m_settings->useOtherFiles()) { if (m_settings->useOtherFiles()) {
if (const ProjectExplorer::Project *project if (const ProjectExplorer::Project *project
= ProjectExplorer::ProjectTree::currentProject()) { = ProjectExplorer::ProjectTree::currentProject()) {
const QStringList files = project->files(ProjectExplorer::Project::AllFiles); const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles);
for (const QString &file : files) { for (const Utils::FileName &file : files) {
if (!file.endsWith(".astylerc")) if (!file.endsWith(".astylerc"))
continue; continue;
const QFileInfo fi(file); const QFileInfo fi = file.toFileInfo();
if (fi.isReadable()) if (fi.isReadable())
return file; return file.toString();
} }
} }
} }
......
...@@ -247,8 +247,7 @@ void BeautifierPlugin::autoFormatOnSave(Core::IDocument *document) ...@@ -247,8 +247,7 @@ void BeautifierPlugin::autoFormatOnSave(Core::IDocument *document)
// Check if file is contained in the current project (if wished) // Check if file is contained in the current project (if wished)
if (m_generalSettings->autoFormatOnlyCurrentProject()) { if (m_generalSettings->autoFormatOnlyCurrentProject()) {
const ProjectExplorer::Project *pro = ProjectExplorer::ProjectTree::currentProject(); const ProjectExplorer::Project *pro = ProjectExplorer::ProjectTree::currentProject();
if (!pro || !pro->files(ProjectExplorer::Project::SourceFiles).contains( if (!pro || !pro->files(ProjectExplorer::Project::SourceFiles).contains(document->filePath())) {
document->filePath().toString())) {
return; return;
} }
} }
......
...@@ -160,13 +160,13 @@ QString Uncrustify::configurationFile() const ...@@ -160,13 +160,13 @@ QString Uncrustify::configurationFile() const
if (m_settings->useOtherFiles()) { if (m_settings->useOtherFiles()) {
if (const ProjectExplorer::Project *project if (const ProjectExplorer::Project *project
= ProjectExplorer::ProjectTree::currentProject()) { = ProjectExplorer::ProjectTree::currentProject()) {
const QStringList files = project->files(ProjectExplorer::Project::AllFiles); const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles);
for (const QString &file : files) { for (const Utils::FileName &file : files) {
if (!file.endsWith("cfg")) if (!file.endsWith("cfg"))
continue; continue;
const QFileInfo fi(file); const QFileInfo fi = file.toFileInfo();
if (fi.isReadable() && fi.fileName() == "uncrustify.cfg") if (fi.isReadable() && fi.fileName() == "uncrustify.cfg")
return file; return file.toString();
} }
} }
} }
......
...@@ -41,6 +41,8 @@ ...@@ -41,6 +41,8 @@
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projectnodes.h> #include <projectexplorer/projectnodes.h>
#include <utils/algorithm.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
#include <QStandardItem> #include <QStandardItem>
...@@ -635,12 +637,12 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot) ...@@ -635,12 +637,12 @@ void Parser::resetData(const CPlusPlus::Snapshot &snapshot)
d->docLocker.unlock(); d->docLocker.unlock();
// recalculate file list // recalculate file list
QStringList fileList; ::Utils::FileNameList fileList;
// check all projects // check all projects
for (const Project *prj : SessionManager::projects()) for (const Project *prj : SessionManager::projects())
fileList += prj->files(Project::SourceFiles); fileList += prj->files(Project::SourceFiles);
setFileList(fileList); setFileList(::Utils::transform(fileList, &::Utils::FileName::toString));
emit resetDataDone(); emit resetDataDone();
} }
...@@ -722,7 +724,7 @@ QStringList Parser::addProjectTree(const ParserTreeItem::Ptr &item, const Projec ...@@ -722,7 +724,7 @@ QStringList Parser::addProjectTree(const ParserTreeItem::Ptr &item, const Projec
if (cit != d->cachedPrjFileLists.constEnd()) { if (cit != d->cachedPrjFileLists.constEnd()) {
fileList = cit.value(); fileList = cit.value();
} else { } else {
fileList = project->files(Project::SourceFiles); fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FileName::toString);
d->cachedPrjFileLists[projectPath] = fileList; d->cachedPrjFileLists[projectPath] = fileList;
} }
if (fileList.count() > 0) { if (fileList.count() > 0) {
...@@ -747,7 +749,7 @@ QStringList Parser::getAllFiles(const Project *project) ...@@ -747,7 +749,7 @@ QStringList Parser::getAllFiles(const Project *project)
if (cit != d->cachedPrjFileLists.constEnd()) { if (cit != d->cachedPrjFileLists.constEnd()) {
fileList = cit.value(); fileList = cit.value();
} else { } else {
fileList = project->files(Project::SourceFiles); fileList = ::Utils::transform(project->files(Project::SourceFiles), &::Utils::FileName::toString);
d->cachedPrjFileLists[nodePath] = fileList; d->cachedPrjFileLists[nodePath] = fileList;
} }
return fileList; return fileList;
......
...@@ -2044,7 +2044,7 @@ void ClearCasePlugin::updateIndex() ...@@ -2044,7 +2044,7 @@ void ClearCasePlugin::updateIndex()
return; return;
m_checkInAllAction->setEnabled(false); m_checkInAllAction->setEnabled(false);
m_statusMap->clear(); m_statusMap->clear();
QFuture<void> result = Utils::runAsync(sync, project->files(Project::SourceFiles)); QFuture<void> result = Utils::runAsync(sync, transform(project->files(Project::SourceFiles), &FileName::toString));
if (!m_settings.disableIndexer) if (!m_settings.disableIndexer)
ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX); ProgressManager::addTask(result, tr("Updating ClearCase Index"), ClearCase::Constants::TASK_INDEX);
} }
......
...@@ -728,28 +728,27 @@ void CMakeProject::createGeneratedCodeModelSupport() ...@@ -728,28 +728,27 @@ void CMakeProject::createGeneratedCodeModelSupport()
= Utils::transform<QSet>(factories, [](const ExtraCompilerFactory *f) { return f->sourceTag(); }); = Utils::transform<QSet>(factories, [](const ExtraCompilerFactory *f) { return f->sourceTag(); });
// Find all files generated by any of the extra compilers, in a rather crude way. // Find all files generated by any of the extra compilers, in a rather crude way.
const QStringList fileList = files(SourceFiles, [&fileExtensions](const Node *n) { const FileNameList fileList = files(SourceFiles, [&fileExtensions](const Node *n) {
const QString fp = n->filePath().toString(); const QString fp = n->filePath().toString();
const int pos = fp.lastIndexOf('.'); const int pos = fp.lastIndexOf('.');
return pos >= 0 && fileExtensions.contains(fp.mid(pos + 1)); return pos >= 0 && fileExtensions.contains(fp.mid(pos + 1));
}); });
// Generate the necessary information: // Generate the necessary information:
for (const QString &file : fileList) { for (const FileName &file : fileList) {
ExtraCompilerFactory *factory = Utils::findOrDefault(factories, [&file](const ExtraCompilerFactory *f) { ExtraCompilerFactory *factory = Utils::findOrDefault(factories, [&file](const ExtraCompilerFactory *f) {
return file.endsWith('.' + f->sourceTag()); return file.endsWith('.' + f->sourceTag());
}); });
QTC_ASSERT(factory, continue); QTC_ASSERT(factory, continue);
QStringList generated = filesGeneratedFrom(file); QStringList generated = filesGeneratedFrom(file.toString());
if (generated.isEmpty()) if (generated.isEmpty())
continue; continue;
const FileNameList fileNames const FileNameList fileNames
= transform(generated, = transform(generated,
[](const QString &s) { return FileName::fromString(s); }); [](const QString &s) { return FileName::fromString(s); });
m_extraCompilers.append(factory->create(this, FileName::fromString(file), m_extraCompilers.append(factory->create(this, file, fileNames));
fileNames));
} }
CppTools::GeneratedCodeModelSupport::update(m_extraCompilers); CppTools::GeneratedCodeModelSupport::update(m_extraCompilers);
......
...@@ -142,14 +142,14 @@ static QString findResourceInProject(const QString &resName) ...@@ -142,14 +142,14 @@ static QString findResourceInProject(const QString &resName)
return QString(); return QString();
if (auto *project = ProjectExplorer::ProjectTree::currentProject()) { if (auto *project = ProjectExplorer::ProjectTree::currentProject()) {
const QStringList files = project->files(ProjectExplorer::Project::AllFiles); const Utils::FileNameList files = project->files(ProjectExplorer::Project::AllFiles);
for (const QString &file : files) { for (const Utils::FileName &file : files) {
if (!file.endsWith(".qrc")) if (!file.endsWith(".qrc"))
continue; continue;
const QFileInfo fi(file); const QFileInfo fi = file.toFileInfo();
if (!fi.isReadable()) if (!fi.isReadable())
continue; continue;
const QString fileName = findResourceInFile(s, file); const QString fileName = findResourceInFile(s, file.toString());
if (fileName.isEmpty()) if (fileName.isEmpty())
continue; continue;
......
...@@ -159,8 +159,8 @@ void CppIncludesFilter::prepareSearch(const QString &entry) ...@@ -159,8 +159,8 @@ void CppIncludesFilter::prepareSearch(const QString &entry)
m_needsUpdate = false; m_needsUpdate = false;
QSet<QString> seedPaths; QSet<QString> seedPaths;
for (Project *project : SessionManager::projects()) { for (Project *project : SessionManager::projects()) {
foreach (const QString &filePath, project->files(Project::AllFiles)) foreach (const Utils::FileName &filePath, project->files(Project::AllFiles))
seedPaths.insert(filePath); seedPaths.insert(filePath.toString());
} }
foreach (DocumentModel::Entry *entry, DocumentModel::entries()) { foreach (DocumentModel::Entry *entry, DocumentModel::entries()) {
if (entry) if (entry)
......
...@@ -57,6 +57,7 @@ ...@@ -57,6 +57,7 @@
#include <projectexplorer/project.h> #include <projectexplorer/project.h>
#include <projectexplorer/projecttree.h> #include <projectexplorer/projecttree.h>
#include <utils/algorithm.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/hostosinfo.h> #include <utils/hostosinfo.h>
#include <utils/macroexpander.h> #include <utils/macroexpander.h>
...@@ -261,7 +262,8 @@ static QStringList findFilesInProject(const QString &name, ...@@ -261,7 +262,8 @@ static QStringList findFilesInProject(const QString &name,
QString pattern = QString(1, QLatin1Char('/')); QString pattern = QString(1, QLatin1Char('/'));
pattern += name; pattern += name;
const QStringList projectFiles = project->files(ProjectExplorer::Project::AllFiles); const QStringList projectFiles
= Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString);
const QStringList::const_iterator pcend = projectFiles.constEnd(); const QStringList::const_iterator pcend = projectFiles.constEnd();
QStringList candidateList; QStringList candidateList;
for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) { for (QStringList::const_iterator it = projectFiles.constBegin(); it != pcend; ++it) {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h> #include <projectexplorer/session.h>
#include <utils/algorithm.h>
#include <utils/runextensions.h> #include <utils/runextensions.h>
#include <utils/qtcassert.h> #include <utils/qtcassert.h>
...@@ -128,7 +129,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search) ...@@ -128,7 +129,7 @@ void SymbolsFindFilter::startSearch(SearchResult *search)
QSet<QString> projectFileNames; QSet<QString> projectFileNames;
if (parameters.scope == SymbolSearcher::SearchProjectsOnly) { if (parameters.scope == SymbolSearcher::SearchProjectsOnly) {
for (ProjectExplorer::Project *project : ProjectExplorer::SessionManager::projects()) for (ProjectExplorer::Project *project : ProjectExplorer::SessionManager::projects())
projectFileNames += project->files(ProjectExplorer::Project::AllFiles).toSet(); projectFileNames += Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString).toSet();
} }
QFutureWatcher<SearchResultItem> *watcher = new QFutureWatcher<SearchResultItem>(); QFutureWatcher<SearchResultItem> *watcher = new QFutureWatcher<SearchResultItem>();
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
#include <projectexplorer/taskhub.h> #include <projectexplorer/taskhub.h>
#include <projectexplorer/toolchain.h> #include <projectexplorer/toolchain.h>
#include <utils/algorithm.h>
#include <utils/checkablemessagebox.h> #include <utils/checkablemessagebox.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/portlist.h> #include <utils/portlist.h>
...@@ -276,7 +277,7 @@ void DebuggerRunTool::setStartMode(DebuggerStartMode startMode) ...@@ -276,7 +277,7 @@ void DebuggerRunTool::setStartMode(DebuggerStartMode startMode)
projects.insert(0, startupProject); projects.insert(0, startupProject);
} }
foreach (Project *project, projects) foreach (Project *project, projects)
m_runParameters.projectSourceFiles.append(project->files(Project::SourceFiles)); m_runParameters.projectSourceFiles.append(transform(project->files(Project::SourceFiles), &FileName::toString));
if (!projects.isEmpty()) if (!projects.isEmpty())
m_runParameters.projectSourceDirectory = projects.first()->projectDirectory().toString(); m_runParameters.projectSourceDirectory = projects.first()->projectDirectory().toString();
...@@ -849,7 +850,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTer ...@@ -849,7 +850,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTer
Project *project = runConfig ? runConfig->target()->project() : nullptr; Project *project = runConfig ? runConfig->target()->project() : nullptr;
if (project) { if (project) {
m_runParameters.projectSourceDirectory = project->projectDirectory().toString(); m_runParameters.projectSourceDirectory = project->projectDirectory().toString();
m_runParameters.projectSourceFiles = project->files(Project::SourceFiles); m_runParameters.projectSourceFiles = transform(project->files(Project::SourceFiles), &FileName::toString);
} }
m_runParameters.toolChainAbi = ToolChainKitInformation::targetAbi(kit); m_runParameters.toolChainAbi = ToolChainKitInformation::targetAbi(kit);
......
...@@ -87,8 +87,7 @@ void GenericProjectPlugin::editFiles() ...@@ -87,8 +87,7 @@ void GenericProjectPlugin::editFiles()
if (!genericProject) if (!genericProject)
return; return;
SelectableFilesDialogEditFiles sfd(genericProject->projectDirectory(), SelectableFilesDialogEditFiles sfd(genericProject->projectDirectory(),
Utils::transform(genericProject->files(Project::AllFiles), genericProject->files(Project::AllFiles),
[](const QString &f) { return Utils::FileName::fromString(f); }),
ICore::mainWindow()); ICore::mainWindow());
if (sfd.exec() == QDialog::Accepted) if (sfd.exec() == QDialog::Accepted)
genericProject->setFiles(Utils::transform(sfd.selectedFiles(), &Utils::FileName::toString)); genericProject->setFiles(Utils::transform(sfd.selectedFiles(), &Utils::FileName::toString));
......
...@@ -392,15 +392,15 @@ void ModelIndexer::scanProject(ProjectExplorer::Project *project) ...@@ -392,15 +392,15 @@ void ModelIndexer::scanProject(ProjectExplorer::Project *project)
return; return;
// TODO harmonize following code with findFirstModel()? // TODO harmonize following code with findFirstModel()?
QStringList files = project->files(ProjectExplorer::Project::SourceFiles); const Utils::FileNameList files = project->files(ProjectExplorer::Project::SourceFiles);
QQueue<QueuedFile> filesQueue; QQueue<QueuedFile> filesQueue;
QSet<QueuedFile> filesSet; QSet<QueuedFile> filesSet;
foreach (const QString &file, files) { for (const Utils::FileName &file : files) {
QFileInfo fileInfo(file); QFileInfo fileInfo = file.toFileInfo();
Utils::MimeType mimeType = Utils::mimeTypeForFile(fileInfo); Utils::MimeType mimeType = Utils::mimeTypeForFile(fileInfo);
if (mimeType.name() == QLatin1String(Constants::MIME_TYPE_MODEL)) { if (mimeType.name() == QLatin1String(Constants::MIME_TYPE_MODEL)) {
QueuedFile queuedFile(file, project, fileInfo.lastModified()); QueuedFile queuedFile(file.toString(), project, fileInfo.lastModified());
filesQueue.append(queuedFile); filesQueue.append(queuedFile);
filesSet.insert(queuedFile); filesSet.insert(queuedFile);
} }
...@@ -474,20 +474,21 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode) ...@@ -474,20 +474,21 @@ QString ModelIndexer::findFirstModel(ProjectExplorer::FolderNode *folderNode)
void ModelIndexer::forgetProject(ProjectExplorer::Project *project) void ModelIndexer::forgetProject(ProjectExplorer::Project *project)
{ {
QStringList files = project->files(ProjectExplorer::Project::SourceFiles); const Utils::FileNameList files = project->files(ProjectExplorer::Project::SourceFiles);
QMutexLocker locker(&d->indexerMutex); QMutexLocker locker(&d->indexerMutex);
foreach (const QString &file, files) { for (const Utils::FileName &file : files) {
const QString fileString = file.toString();
// remove file from queue // remove file from queue
QueuedFile queuedFile(file, project); QueuedFile queuedFile(fileString, project);
if (d->queuedFilesSet.contains(queuedFile)) { if (d->queuedFilesSet.contains(queuedFile)) {
QMT_CHECK(d->filesQueue.contains(queuedFile)); QMT_CHECK(d->filesQueue.contains(queuedFile));
d->filesQueue.removeOne(queuedFile); d->filesQueue.removeOne(queuedFile);
QMT_CHECK(!d->filesQueue.contains(queuedFile)); QMT_CHECK(!d->filesQueue.contains(queuedFile));
d->queuedFilesSet.remove(queuedFile); d->queuedFilesSet.remove(queuedFile);
} }
removeModelFile(file, project); removeModelFile(fileString, project);
removeDiagramReferenceFile(file, project); removeDiagramReferenceFile(fileString, project);
} }
} }
......
...@@ -177,10 +177,7 @@ bool NimProject::supportsKit(Kit *k, QString *errorMessage) const ...@@ -177,10 +177,7 @@ bool NimProject::supportsKit(Kit *k, QString *errorMessage) const
FileNameList NimProject::nimFiles() const FileNameList NimProject::nimFiles() const
{ {
const QStringList nim = files(AllFiles, [](const ProjectExplorer::Node *n) { return files(AllFiles, [](const ProjectExplorer::Node *n) { return n->filePath().endsWith(".nim"); });
return n->filePath().endsWith(".nim");
});
return Utils::transform(nim, [](const QString &fp) { return Utils::FileName::fromString(fp); });
} }
QVariantMap NimProject::toMap() const QVariantMap NimProject::toMap() const
......
...@@ -379,8 +379,8 @@ void AbstractProcessStep::taskAdded(const Task &task, int linkedOutputLines, int ...@@ -379,8 +379,8 @@ void AbstractProcessStep::taskAdded(const Task &task, int linkedOutputLines, int
QList<QFileInfo> possibleFiles; QList<QFileInfo> possibleFiles;
QString fileName = Utils::FileName::fromString(filePath).fileName(); QString fileName = Utils::FileName::fromString(filePath).fileName();
foreach (const QString &file, project()->files(Project::AllFiles)) { foreach (const Utils::FileName &file, project()->files(Project::AllFiles)) {
QFileInfo candidate(file); QFileInfo candidate = file.toFileInfo();
if (candidate.fileName() == fileName) if (candidate.fileName() == fileName)
possibleFiles << candidate; possibleFiles << candidate;
} }
......
...@@ -59,7 +59,7 @@ void AllProjectsFilter::prepareSearch(const QString &entry) ...@@ -59,7 +59,7 @@ void AllProjectsFilter::prepareSearch(const QString &entry)
if (!fileIterator()) { if (!fileIterator()) {
QStringList paths; QStringList paths;
for (Project *project : SessionManager::projects()) for (Project *project : SessionManager::projects())
paths.append(project->files(Project::AllFiles)); paths.append(Utils::transform(project->files(Project::AllFiles), &Utils::FileName::toString));
Utils::sort(paths); Utils::sort(paths);
setFileIterator(new BaseFileFilter::ListIterator(paths)); setFileIterator(new BaseFileFilter::ListIterator(paths));
} }
......
...@@ -88,7 +88,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi ...@@ -88,7 +88,7 @@ Utils::FileIterator *AllProjectsFind::filesForProjects(const QStringList &nameFi
QTextCodec *projectCodec = config->useGlobalSettings() QTextCodec *projectCodec = config->useGlobalSettings()
? Core::EditorManager::defaultTextCodec() ? Core::EditorManager::defaultTextCodec()
: config->textCodec(); : config->textCodec();
const QStringList filteredFiles = filterFiles(project->files(Project::AllFiles)); const QStringList filteredFiles = filterFiles(Utils::transform(project->files(Project::AllFiles), &Utils::FileName::toString));
for (const QString &fileName : filteredFiles) { for (const QString &fileName : filteredFiles) {
QTextCodec *codec = openEditorEncodings.value(fileName); QTextCodec *codec = openEditorEncodings.value(fileName);
if (!codec) if (!codec)
......
...@@ -58,7 +58,7 @@ void CurrentProjectFilter::prepareSearch(const QString &entry) ...@@ -58,7 +58,7 @@ void CurrentProjectFilter::prepareSearch(const QString &entry)
if (!fileIterator()) { if (!fileIterator()) {
QStringList paths; QStringList paths;
if (m_project) { if (m_project) {
paths = m_project->files(Project::AllFiles); paths = Utils::transform(m_project->files(Project::AllFiles), &Utils::FileName::toString);
Utils::sort(paths); Utils::sort(paths);
} }
setFileIterator(new BaseFileFilter::ListIterator(paths)); setFileIterator(new BaseFileFilter::ListIterator(paths));
......
...@@ -557,17 +557,17 @@ Project::RestoreResult Project::restoreSettings(QString *errorMessage) ...@@ -557,17 +557,17 @@ Project::RestoreResult Project::restoreSettings(QString *errorMessage)
return result; return result;
} }
QStringList Project::files(Project::FilesMode fileMode, Utils::FileNameList Project::files(Project::FilesMode fileMode,
const std::function<bool(const Node *)> &filter) const const std::function<bool(const Node *)> &filter) const
{ {
QStringList result; Utils::FileNameList result;
if (!rootProjectNode()) if (!rootProjectNode())
return result; return result;
<