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

This commit is contained in:
The Qt Project
2024-01-19 09:02:32 +00:00
2 changed files with 6 additions and 5 deletions

View File

@@ -275,10 +275,9 @@ static QString newFilesForFunction(const std::string &cmakeFunction,
static std::optional<Link> cmakeFileForBuildKey(const QString &buildKey, static std::optional<Link> cmakeFileForBuildKey(const QString &buildKey,
const QList<CMakeBuildTarget> &targets) const QList<CMakeBuildTarget> &targets)
{ {
auto target = Utils::findOrDefault(targets, auto target = Utils::findOrDefault(targets, [buildKey](const CMakeBuildTarget &target) {
[buildKey](const CMakeBuildTarget &target) { return target.title == buildKey;
return target.title == buildKey; });
});
if (target.backtrace.isEmpty()) { if (target.backtrace.isEmpty()) {
qCCritical(cmakeBuildSystemLog) << "target.backtrace for" << buildKey << "is empty." qCCritical(cmakeBuildSystemLog) << "target.backtrace for" << buildKey << "is empty."
<< "The location where to add the files is unknown."; << "The location where to add the files is unknown.";
@@ -658,7 +657,7 @@ bool CMakeBuildSystem::addSrcFiles(Node *context, const FilePaths &filePaths, Fi
return false; return false;
} }
const std::string target_name = targetName.toStdString(); const std::string target_name = function->Arguments().front().Value;
auto qtAddModule = [target_name](const auto &func) { auto qtAddModule = [target_name](const auto &func) {
return (func.LowerCaseName() == "qt_add_qml_module" return (func.LowerCaseName() == "qt_add_qml_module"
|| func.LowerCaseName() == "qt6_add_qml_module") || func.LowerCaseName() == "qt6_add_qml_module")

View File

@@ -863,6 +863,8 @@ ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targetOffse
const QStringView docView = QStringView(content); const QStringView docView = QStringView(content);
for (auto it = renamedTargetParameters.cbegin(); for (auto it = renamedTargetParameters.cbegin();
it != renamedTargetParameters.cend(); ++it) { it != renamedTargetParameters.cend(); ++it) {
if (!it.key()->name())
continue;
const QString paramName = Overview().prettyName(it.key()->name()); const QString paramName = Overview().prettyName(it.key()->name());
for (const Token &tok : functionComments) { for (const Token &tok : functionComments) {
const TranslationUnit * const tu = targetFile->cppDocument()->translationUnit(); const TranslationUnit * const tu = targetFile->cppDocument()->translationUnit();