forked from qt-creator/qt-creator
Project: Make Project::files return a FileNameList
Change-Id: I75ceb22ac65b8288d824f229d44089cba6fc8ea3 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -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)
|
|||||||
}
|
}
|
||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
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)
|
|||||||
// 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
|
|||||||
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 @@
|
|||||||
#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)
|
|||||||
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
|
|||||||
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)
|
|||||||
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()
|
|||||||
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()
|
|||||||
= 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)
|
|||||||
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)
|
|||||||
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 @@
|
|||||||
#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,
|
|||||||
|
|
||||||
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 @@
|
|||||||
#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)
|
|||||||
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 @@
|
|||||||
#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)
|
|||||||
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
|
|||||||
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()
|
|||||||
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)
|
|||||||
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)
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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
|
|||||||
|
|
||||||
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)
|
|||||||
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
|
|||||||
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)
|
|||||||
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)
|
|||||||
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;
|
||||||
|
|
||||||
QSet<QString> alreadySeen;
|
QSet<Utils::FileName> alreadySeen;
|
||||||
rootProjectNode()->forEachGenericNode([&](const Node *n) {
|
rootProjectNode()->forEachGenericNode([&](const Node *n) {
|
||||||
const QString path = n->filePath().toString();
|
const Utils::FileName path = n->filePath();
|
||||||
const int count = alreadySeen.count();
|
const int count = alreadySeen.count();
|
||||||
alreadySeen.insert(path);
|
alreadySeen.insert(path);
|
||||||
if (count == alreadySeen.count())
|
if (count == alreadySeen.count())
|
||||||
|
@@ -135,8 +135,8 @@ public:
|
|||||||
GeneratedFiles = 0x2,
|
GeneratedFiles = 0x2,
|
||||||
AllFiles = SourceFiles | GeneratedFiles
|
AllFiles = SourceFiles | GeneratedFiles
|
||||||
};
|
};
|
||||||
QStringList files(FilesMode fileMode,
|
Utils::FileNameList files(FilesMode fileMode,
|
||||||
const std::function<bool(const Node *)> &filter = {}) const;
|
const std::function<bool(const Node *)> &filter = {}) const;
|
||||||
virtual QStringList filesGeneratedFrom(const QString &sourceFile) const;
|
virtual QStringList filesGeneratedFrom(const QString &sourceFile) const;
|
||||||
|
|
||||||
static QString makeUnique(const QString &preferredName, const QStringList &usedNames);
|
static QString makeUnique(const QString &preferredName, const QStringList &usedNames);
|
||||||
|
@@ -690,7 +690,7 @@ Project *SessionManager::projectForFile(const Utils::FileName &fileName)
|
|||||||
bool SessionManager::projectContainsFile(Project *p, const Utils::FileName &fileName)
|
bool SessionManager::projectContainsFile(Project *p, const Utils::FileName &fileName)
|
||||||
{
|
{
|
||||||
if (!d->m_projectFileCache.contains(p))
|
if (!d->m_projectFileCache.contains(p))
|
||||||
d->m_projectFileCache.insert(p, p->files(Project::AllFiles));
|
d->m_projectFileCache.insert(p, Utils::transform(p->files(Project::AllFiles), &Utils::FileName::toString));
|
||||||
|
|
||||||
return d->m_projectFileCache.value(p).contains(fileName.toString());
|
return d->m_projectFileCache.value(p).contains(fileName.toString());
|
||||||
}
|
}
|
||||||
|
@@ -283,7 +283,7 @@ public:
|
|||||||
Q_UNUSED(mode);
|
Q_UNUSED(mode);
|
||||||
//return { Core::Id(PythonExecutableId) };
|
//return { Core::Id(PythonExecutableId) };
|
||||||
PythonProject *project = static_cast<PythonProject *>(parent->project());
|
PythonProject *project = static_cast<PythonProject *>(parent->project());
|
||||||
return project->files(ProjectExplorer::Project::AllFiles);
|
return Utils::transform(project->files(ProjectExplorer::Project::AllFiles), &Utils::FileName::toString);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool canCreateHelper(Target *parent, const QString &buildTarget) const override
|
bool canCreateHelper(Target *parent, const QString &buildTarget) const override
|
||||||
@@ -292,7 +292,7 @@ public:
|
|||||||
const QString script = buildTarget;
|
const QString script = buildTarget;
|
||||||
if (script.endsWith(".pyqtc"))
|
if (script.endsWith(".pyqtc"))
|
||||||
return false;
|
return false;
|
||||||
return project->files(ProjectExplorer::Project::AllFiles).contains(script);
|
return project->files(ProjectExplorer::Project::AllFiles).contains(FileName::fromString(script));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -849,7 +849,7 @@ static void notifyChangedHelper(const FileName &fileName, QmakeProFile *file)
|
|||||||
void QmakeProject::notifyChanged(const FileName &name)
|
void QmakeProject::notifyChanged(const FileName &name)
|
||||||
{
|
{
|
||||||
for (QmakeProject *project : s_projects) {
|
for (QmakeProject *project : s_projects) {
|
||||||
if (project->files(QmakeProject::SourceFiles).contains(name.toString()))
|
if (project->files(QmakeProject::SourceFiles).contains(name))
|
||||||
notifyChangedHelper(name, project->rootProFile());
|
notifyChangedHelper(name, project->rootProFile());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -38,9 +38,9 @@ static QString styleConfigFileName(const QString &qmlFileName)
|
|||||||
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(qmlFileName));
|
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(Utils::FileName::fromString(qmlFileName));
|
||||||
|
|
||||||
if (currentProject)
|
if (currentProject)
|
||||||
foreach (const QString &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles))
|
foreach (const Utils::FileName &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles))
|
||||||
if (fileName.endsWith("qtquickcontrols2.conf"))
|
if (fileName.endsWith("qtquickcontrols2.conf"))
|
||||||
return fileName;
|
return fileName.toString();
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@@ -288,9 +288,9 @@ void DesignDocument::updateQrcFiles()
|
|||||||
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName());
|
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName());
|
||||||
|
|
||||||
if (currentProject) {
|
if (currentProject) {
|
||||||
foreach (const QString &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
for (const Utils::FileName &fileName : currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
||||||
if (fileName.endsWith(".qrc"))
|
if (fileName.endsWith(".qrc"))
|
||||||
QmlJS::ModelManagerInterface::instance()->updateQrcFile(fileName);
|
QmlJS::ModelManagerInterface::instance()->updateQrcFile(fileName.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -150,10 +150,9 @@ QString PuppetCreator::getStyleConfigFileName() const
|
|||||||
{
|
{
|
||||||
#ifndef QMLDESIGNER_TEST
|
#ifndef QMLDESIGNER_TEST
|
||||||
if (m_currentProject) {
|
if (m_currentProject) {
|
||||||
for (const QString &fileName : m_currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
for (const Utils::FileName &fileName : m_currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
||||||
QFileInfo fileInfo(fileName);
|
if (fileName.fileName() == "qtquickcontrols2.conf")
|
||||||
if (fileInfo.fileName() == "qtquickcontrols2.conf")
|
return fileName.toString();
|
||||||
return fileName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -213,9 +213,9 @@ static QStringList allUiQmlFilesforCurrentProject(const Utils::FileName &fileNam
|
|||||||
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName);
|
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(fileName);
|
||||||
|
|
||||||
if (currentProject) {
|
if (currentProject) {
|
||||||
foreach (const QString &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
foreach (const Utils::FileName &fileName, currentProject->files(ProjectExplorer::Project::SourceFiles)) {
|
||||||
if (fileName.endsWith(".ui.qml"))
|
if (fileName.endsWith(".ui.qml"))
|
||||||
list.append(fileName);
|
list.append(fileName.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -349,10 +349,8 @@ void QmlJSEditorPlugin::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 (QmlJsEditingSettings::get().autoFormatOnlyCurrentProject()) {
|
if (QmlJsEditingSettings::get().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;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reformatFile();
|
reformatFile();
|
||||||
|
@@ -49,6 +49,8 @@
|
|||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
#include <qtsupport/qtsupportconstants.h>
|
#include <qtsupport/qtsupportconstants.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/mimetypes/mimedatabase.h>
|
#include <utils/mimetypes/mimedatabase.h>
|
||||||
|
|
||||||
@@ -84,15 +86,15 @@ ModelManagerInterface::ProjectInfo ModelManager::defaultProjectInfoForProject(
|
|||||||
Constants::QMLPROJECT_MIMETYPE,
|
Constants::QMLPROJECT_MIMETYPE,
|
||||||
Constants::QMLTYPES_MIMETYPE,
|
Constants::QMLTYPES_MIMETYPE,
|
||||||
Constants::QMLUI_MIMETYPE };
|
Constants::QMLUI_MIMETYPE };
|
||||||
projectInfo.sourceFiles = project->files(Project::SourceFiles,
|
projectInfo.sourceFiles = Utils::transform(project->files(Project::SourceFiles,
|
||||||
[&qmlTypeNames](const Node *n) {
|
[&qmlTypeNames](const Node *n) {
|
||||||
if (const FileNode *fn = n->asFileNode()) {
|
if (const FileNode *fn = n->asFileNode()) {
|
||||||
return fn->fileType() == FileType::QML
|
return fn->fileType() == FileType::QML
|
||||||
&& qmlTypeNames.contains(Utils::mimeTypeForFile(fn->filePath().toString(),
|
&& qmlTypeNames.contains(Utils::mimeTypeForFile(fn->filePath().toString(),
|
||||||
MimeMatchMode::MatchExtension).name());
|
MimeMatchMode::MatchExtension).name());
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
}), &FileName::toString);
|
||||||
activeTarget = project->activeTarget();
|
activeTarget = project->activeTarget();
|
||||||
}
|
}
|
||||||
Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit();
|
Kit *activeKit = activeTarget ? activeTarget->kit() : KitManager::defaultKit();
|
||||||
|
@@ -261,15 +261,15 @@ void QmlProjectRunConfiguration::updateEnabledState()
|
|||||||
|| mainScriptMimeType.matchesName(QLatin1String(QmlJSTools::Constants::QMLPROJECT_MIMETYPE))) {
|
|| mainScriptMimeType.matchesName(QLatin1String(QmlJSTools::Constants::QMLPROJECT_MIMETYPE))) {
|
||||||
// find a qml file with lowercase filename. This is slow, but only done
|
// find a qml file with lowercase filename. This is slow, but only done
|
||||||
// in initialization/other border cases.
|
// in initialization/other border cases.
|
||||||
foreach (const QString &filename, target()->project()->files(Project::AllFiles)) {
|
foreach (const Utils::FileName &filename, target()->project()->files(Project::AllFiles)) {
|
||||||
const QFileInfo fi(filename);
|
const QFileInfo fi = filename.toFileInfo();
|
||||||
|
|
||||||
if (!filename.isEmpty() && fi.baseName()[0].isLower()) {
|
if (!filename.isEmpty() && fi.baseName()[0].isLower()) {
|
||||||
Utils::MimeType type = Utils::mimeTypeForFile(fi);
|
Utils::MimeType type = Utils::mimeTypeForFile(fi);
|
||||||
if (type.matchesName(QLatin1String(ProjectExplorer::Constants::QML_MIMETYPE))
|
if (type.matchesName(QLatin1String(ProjectExplorer::Constants::QML_MIMETYPE))
|
||||||
|| type.matchesName(
|
|| type.matchesName(
|
||||||
QLatin1String(ProjectExplorer::Constants::QMLUI_MIMETYPE))) {
|
QLatin1String(ProjectExplorer::Constants::QMLUI_MIMETYPE))) {
|
||||||
m_currentFileFilename = filename;
|
m_currentFileFilename = filename.toString();
|
||||||
qmlFileFound = true;
|
qmlFileFound = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,8 @@
|
|||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <projectexplorer/projectexplorer.h>
|
#include <projectexplorer/projectexplorer.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/detailswidget.h>
|
#include <utils/detailswidget.h>
|
||||||
|
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
@@ -38,7 +40,6 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
using Core::ICore;
|
using Core::ICore;
|
||||||
using ProjectExplorer::ProjectExplorerPlugin;
|
using ProjectExplorer::ProjectExplorerPlugin;
|
||||||
@@ -114,7 +115,8 @@ void QmlProjectRunConfigurationWidget::updateFileComboBox()
|
|||||||
m_fileListModel->appendRow(new QStandardItem(QLatin1String(CURRENT_FILE)));
|
m_fileListModel->appendRow(new QStandardItem(QLatin1String(CURRENT_FILE)));
|
||||||
QModelIndex currentIndex;
|
QModelIndex currentIndex;
|
||||||
|
|
||||||
QStringList sortedFiles = project->files(ProjectExplorer::Project::AllFiles);
|
QStringList sortedFiles = Utils::transform(project->files(ProjectExplorer::Project::AllFiles),
|
||||||
|
&Utils::FileName::toString);
|
||||||
|
|
||||||
// make paths relative to project directory
|
// make paths relative to project directory
|
||||||
QStringList relativeFiles;
|
QStringList relativeFiles;
|
||||||
|
@@ -1348,13 +1348,15 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar
|
|||||||
// Sort files from startupProject to the front of the list ...
|
// Sort files from startupProject to the front of the list ...
|
||||||
if (startupProject) {
|
if (startupProject) {
|
||||||
projectDirectory = startupProject->projectDirectory().toString();
|
projectDirectory = startupProject->projectDirectory().toString();
|
||||||
sourceFiles.append(startupProject->files(ProjectExplorer::Project::SourceFiles));
|
sourceFiles.append(Utils::transform(startupProject->files(ProjectExplorer::Project::SourceFiles),
|
||||||
|
&Utils::FileName::toString));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ... then add all the other projects' files.
|
// ... then add all the other projects' files.
|
||||||
for (const ProjectExplorer::Project *project : projects) {
|
for (const ProjectExplorer::Project *project : projects) {
|
||||||
if (project != startupProject)
|
if (project != startupProject)
|
||||||
sourceFiles.append(project->files(ProjectExplorer::Project::SourceFiles));
|
sourceFiles.append(Utils::transform(project->files(ProjectExplorer::Project::SourceFiles),
|
||||||
|
&Utils::FileName::toString));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If no target was given, but we've found a startupProject, then try to deduce a
|
// If no target was given, but we've found a startupProject, then try to deduce a
|
||||||
|
@@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
#include <coreplugin/editormanager/editormanager.h>
|
#include <coreplugin/editormanager/editormanager.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/ansiescapecodehandler.h>
|
#include <utils/ansiescapecodehandler.h>
|
||||||
#include <utils/fileinprojectfinder.h>
|
#include <utils/fileinprojectfinder.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
@@ -85,7 +87,7 @@ QtOutputFormatter::QtOutputFormatter(Project *project)
|
|||||||
: d(new Internal::QtOutputFormatterPrivate(project))
|
: d(new Internal::QtOutputFormatterPrivate(project))
|
||||||
{
|
{
|
||||||
if (project) {
|
if (project) {
|
||||||
d->projectFinder.setProjectFiles(project->files(Project::SourceFiles));
|
d->projectFinder.setProjectFiles(Utils::transform(project->files(Project::SourceFiles), &Utils::FileName::toString));
|
||||||
d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
|
d->projectFinder.setProjectDirectory(project->projectDirectory().toString());
|
||||||
|
|
||||||
connect(project, &Project::fileListChanged,
|
connect(project, &Project::fileListChanged,
|
||||||
@@ -279,7 +281,7 @@ void QtOutputFormatter::openEditor(const QString &fileName, int line, int column
|
|||||||
void QtOutputFormatter::updateProjectFileList()
|
void QtOutputFormatter::updateProjectFileList()
|
||||||
{
|
{
|
||||||
if (d->project)
|
if (d->project)
|
||||||
d->projectFinder.setProjectFiles(d->project.data()->files(Project::SourceFiles));
|
d->projectFinder.setProjectFiles(transform(d->project->files(Project::SourceFiles), &FileName::toString));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace QtSupport
|
} // namespace QtSupport
|
||||||
|
@@ -32,6 +32,8 @@
|
|||||||
|
|
||||||
#include <cplusplus/TranslationUnit.h>
|
#include <cplusplus/TranslationUnit.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
|
|
||||||
namespace Todo {
|
namespace Todo {
|
||||||
@@ -57,7 +59,8 @@ void CppTodoItemsScanner::scannerParamsChanged()
|
|||||||
|
|
||||||
QSet<QString> filesToBeUpdated;
|
QSet<QString> filesToBeUpdated;
|
||||||
foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos())
|
foreach (const CppTools::ProjectInfo &info, modelManager->projectInfos())
|
||||||
filesToBeUpdated.unite(info.project().data()->files(ProjectExplorer::Project::SourceFiles).toSet());
|
filesToBeUpdated.unite(Utils::transform(info.project().data()->files(ProjectExplorer::Project::SourceFiles),
|
||||||
|
&Utils::FileName::toString).toSet());
|
||||||
|
|
||||||
modelManager->updateSourceFiles(filesToBeUpdated);
|
modelManager->updateSourceFiles(filesToBeUpdated);
|
||||||
}
|
}
|
||||||
|
@@ -39,6 +39,8 @@
|
|||||||
#include <projectexplorer/projecttree.h>
|
#include <projectexplorer/projecttree.h>
|
||||||
#include <projectexplorer/session.h>
|
#include <projectexplorer/session.h>
|
||||||
|
|
||||||
|
#include <utils/algorithm.h>
|
||||||
|
|
||||||
#include <QRegExp>
|
#include <QRegExp>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
|
||||||
@@ -120,7 +122,9 @@ void TodoItemsProvider::createScanners()
|
|||||||
void TodoItemsProvider::setItemsListWithinStartupProject()
|
void TodoItemsProvider::setItemsListWithinStartupProject()
|
||||||
{
|
{
|
||||||
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
||||||
QSet<QString> fileNames = QSet<QString>::fromList(m_startupProject->files(Project::SourceFiles));
|
const QSet<QString> fileNames
|
||||||
|
= QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles),
|
||||||
|
&Utils::FileName::toString));
|
||||||
|
|
||||||
QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap();
|
QVariantMap settings = m_startupProject->namedSettings(Constants::SETTINGS_NAME_KEY).toMap();
|
||||||
|
|
||||||
@@ -156,8 +160,9 @@ void TodoItemsProvider::setItemsListWithinSubproject()
|
|||||||
});
|
});
|
||||||
|
|
||||||
// files must be both in the current subproject and the startup-project.
|
// files must be both in the current subproject and the startup-project.
|
||||||
QSet<QString> fileNames = QSet<QString>::fromList(
|
const QSet<QString> fileNames
|
||||||
m_startupProject->files(ProjectExplorer::Project::SourceFiles));
|
= QSet<QString>::fromList(Utils::transform(m_startupProject->files(Project::SourceFiles),
|
||||||
|
&Utils::FileName::toString));
|
||||||
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
QHashIterator<QString, QList<TodoItem> > it(m_itemsHash);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
it.next();
|
it.next();
|
||||||
|
@@ -714,7 +714,8 @@ void MemcheckTool::maybeActiveRunConfigurationChanged()
|
|||||||
|
|
||||||
RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
|
RunWorker *MemcheckTool::createRunWorker(RunControl *runControl)
|
||||||
{
|
{
|
||||||
m_errorModel.setRelevantFrameFinder(makeFrameFinder(runControl->project()->files(Project::AllFiles)));
|
m_errorModel.setRelevantFrameFinder(makeFrameFinder(transform(runControl->project()->files(Project::AllFiles),
|
||||||
|
&FileName::toString)));
|
||||||
|
|
||||||
auto runTool = new MemcheckToolRunner(runControl, runControl->runMode() == MEMCHECK_WITH_GDB_RUN_MODE);
|
auto runTool = new MemcheckToolRunner(runControl, runControl->runMode() == MEMCHECK_WITH_GDB_RUN_MODE);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user