QmlDesigner: Fix multi-arg warning

Change-Id: Ic88706b92001a60d56f901684d7a08dab9f26c3d
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Burak Hancerli <burak.hancerli@qt.io>
This commit is contained in:
Aleksei German
2023-06-27 12:51:18 +02:00
parent d7a60e4118
commit cbe6d53fa7

View File

@@ -290,14 +290,14 @@ bool QmlBuildSystem::setFileSettingInProjectFile(const QString &setting,
const QString relativePath = mainFilePath.relativeChildPath(projectDir).path(); const QString relativePath = mainFilePath.relativeChildPath(projectDir).path();
if (fileContent.indexOf(settingQmlCode) < 0) { if (fileContent.indexOf(settingQmlCode) < 0) {
QString addedText = QString("\n %1 \"%2\"\n").arg(settingQmlCode).arg(relativePath); QString addedText = QString("\n %1 \"%2\"\n").arg(settingQmlCode, relativePath);
auto index = fileContent.lastIndexOf("}"); auto index = fileContent.lastIndexOf("}");
fileContent.insert(index, addedText); fileContent.insert(index, addedText);
} else { } else {
QString originalFileName = oldFile; QString originalFileName = oldFile;
originalFileName.replace(".", "\\."); originalFileName.replace(".", "\\.");
const QRegularExpression expression( const QRegularExpression expression(
QString("%1\\s*\"(%2)\"").arg(settingQmlCode).arg(originalFileName)); QString("%1\\s*\"(%2)\"").arg(settingQmlCode, originalFileName));
const QRegularExpressionMatch match = expression.match(fileContent); const QRegularExpressionMatch match = expression.match(fileContent);