qdbusxml2cpp: Modify return values

Addressing a comment from the review of QTBUG-98434. Instead of
creating a QL1SV from the concatenation, create the QL1SV first and
concatenate after, using QStringBuilder.

Task-number: QTBUG-103100
Change-Id: Ic082da410db15dd9e2c341711c24150d7a0dc0c2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Mate Barany 2022-09-20 18:11:23 +02:00 committed by Marc Mutz
parent 10f4eb0e58
commit 84ae970c6d

View File

@ -268,7 +268,7 @@ static QByteArray qtTypeName(const QString &where, const QString &signature,
static QString nonConstRefArg(const QByteArray &arg)
{
return QLatin1StringView(arg + " &");
return QLatin1StringView(arg) + " &"_L1;
}
static QString templateArg(const QByteArray &arg)
@ -276,13 +276,13 @@ static QString templateArg(const QByteArray &arg)
if (!arg.endsWith('>'))
return QLatin1StringView(arg);
return QLatin1StringView(arg + ' ');
return QLatin1StringView(arg) + " "_L1;
}
static QString constRefArg(const QByteArray &arg)
{
if (!arg.startsWith('Q'))
return QLatin1StringView(arg + ' ');
return QLatin1StringView(arg) + " "_L1;
else
return "const %1 &"_L1.arg(QLatin1StringView(arg));
}