Merge "Merge remote-tracking branch 'origin/4.6'"

This commit is contained in:
Eike Ziller
2018-03-16 10:29:37 +00:00
committed by The Qt Project
60 changed files with 2532 additions and 1337 deletions

View File

@@ -236,7 +236,8 @@ QmakePriFile::~QmakePriFile()
void QmakePriFile::scheduleUpdate()
{
QtSupport::ProFileCacheManager::instance()->discardFile(filePath().toString());
QtSupport::ProFileCacheManager::instance()->discardFile(
filePath().toString(), m_project->qmakeVfs());
m_qmakeProFile->scheduleUpdate(QmakeProFile::ParseLater);
}
@@ -291,11 +292,11 @@ static QStringList fileListForVar(
}
void QmakePriFile::extractSources(
QHash<const ProFile *, QmakePriFileEvalResult *> proToResult, QmakePriFileEvalResult *fallback,
QHash<int, QmakePriFileEvalResult *> proToResult, QmakePriFileEvalResult *fallback,
QVector<ProFileEvaluator::SourceFile> sourceFiles, FileType type)
{
foreach (const ProFileEvaluator::SourceFile &source, sourceFiles) {
QmakePriFileEvalResult *result = proToResult.value(source.proFile);
auto *result = proToResult.value(source.proFileId);
if (!result)
result = fallback;
result->foundFiles[type].insert(FileName::fromString(source.fileName));
@@ -303,12 +304,12 @@ void QmakePriFile::extractSources(
}
void QmakePriFile::extractInstalls(
QHash<const ProFile *, QmakePriFileEvalResult *> proToResult, QmakePriFileEvalResult *fallback,
QHash<int, QmakePriFileEvalResult *> proToResult, QmakePriFileEvalResult *fallback,
const InstallsList &installList)
{
for (const InstallsItem &item : installList.items) {
for (const ProFileEvaluator::SourceFile &source : item.files) {
auto *result = proToResult.value(source.proFile);
auto *result = proToResult.value(source.proFileId);
if (!result)
result = fallback;
result->folders.insert(FileName::fromString(source.fileName));
@@ -620,7 +621,8 @@ bool QmakePriFile::saveModifiedEditors()
return false;
// force instant reload of ourselves
QtSupport::ProFileCacheManager::instance()->discardFile(filePath().toString());
QtSupport::ProFileCacheManager::instance()->discardFile(
filePath().toString(), m_project->qmakeVfs());
QmakeProject::notifyChanged(filePath());
return true;
}
@@ -700,7 +702,7 @@ QPair<ProFile *, QStringList> QmakePriFile::readProFile(const QString &file)
QMakeVfs vfs;
QtSupport::ProMessageHandler handler;
QMakeParser parser(nullptr, &vfs, &handler);
includeFile = parser.parsedProBlock(QStringRef(&contents), file, 1);
includeFile = parser.parsedProBlock(QStringRef(&contents), 0, file, 1);
}
return qMakePair(includeFile, lines);
}
@@ -737,7 +739,7 @@ bool QmakePriFile::renameFile(const QString &oldName,
QMakeParser parser(nullptr, nullptr, nullptr);
QString contents = lines.join(QLatin1Char('\n'));
includeFile = parser.parsedProBlock(QStringRef(&contents),
filePath().toString(), 1, QMakeParser::FullGrammar);
0, filePath().toString(), 1, QMakeParser::FullGrammar);
QTC_ASSERT(includeFile, return false); // The file should still be valid after what we did.
ProWriter::addFiles(includeFile, &lines,
@@ -1293,7 +1295,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
result->includedFiles.proFile = pro;
result->includedFiles.name = input.projectFilePath;
QHash<const ProFile *, QmakePriFileEvalResult *> proToResult;
QHash<int, QmakePriFileEvalResult *> proToResult;
result->projectType
= proFileTemplateTypeToProjectType(
@@ -1331,7 +1333,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
childTree->proFile = child;
childTree->name = childName;
current->children.insert(childName, childTree);
proToResult[child] = &childTree->result;
proToResult[child->id()] = &childTree->result;
}
}
toBuild.append(current->children.values());
@@ -1367,7 +1369,7 @@ QmakeEvalResult *QmakeProFile::evaluate(const QmakeEvalInput &input)
childTree->proFile = child;
childTree->name = childName;
current->children.insert(childName, childTree);
proToResult[child] = &childTree->result;
proToResult[child->id()] = &childTree->result;
}
}
toBuild.append(current->children.values());