From d5ca63b954407b36c18c70e2ecace7b30694558d Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Tue, 23 Feb 2021 17:09:33 +0200 Subject: Improve code readability by using QLatin1String::arg() NO_CHANGELOG --- src/kconfig_compiler/KConfigXmlParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/kconfig_compiler/KConfigXmlParser.cpp') diff --git a/src/kconfig_compiler/KConfigXmlParser.cpp b/src/kconfig_compiler/KConfigXmlParser.cpp index 7dc1d9f0..9815d1cd 100644 --- a/src/kconfig_compiler/KConfigXmlParser.cpp +++ b/src/kconfig_compiler/KConfigXmlParser.cpp @@ -38,7 +38,7 @@ static void preProcessDefault(QString &defaultValue, defaultValue = literalString(defaultValue); } else if (type == QLatin1String("Url") && !defaultValue.isEmpty()) { // Use fromUserInput in order to support absolute paths and absolute urls, like KDE4's KUrl(QString) did. - defaultValue = QLatin1String("QUrl::fromUserInput( ") + literalString(defaultValue) + QLatin1Char(')'); + defaultValue = QLatin1String("QUrl::fromUserInput( %1)").arg(literalString(defaultValue)); } else if ((type == QLatin1String("UrlList") || type == QLatin1String("StringList") || type == QLatin1String("PathList")) && !defaultValue.isEmpty()) { QTextStream cpp(&code, QIODevice::WriteOnly | QIODevice::Append); if (!code.isEmpty()) { @@ -68,9 +68,9 @@ static void preProcessDefault(QString &defaultValue, static const QRegularExpression colorRe(QRegularExpression::anchoredPattern(QStringLiteral("\\d+,\\s*\\d+,\\s*\\d+(,\\s*\\d+)?"))); if (colorRe.match(defaultValue).hasMatch()) { - defaultValue = QLatin1String("QColor( ") + defaultValue + QLatin1String(" )"); + defaultValue = QLatin1String("QColor( %1 )").arg(defaultValue); } else { - defaultValue = QLatin1String("QColor( \"") + defaultValue + QLatin1String("\" )"); + defaultValue = QLatin1String("QColor( \"%1\" )").arg(defaultValue); } } else if (type == QLatin1String("Enum")) { -- cgit v1.2.1