diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/kconfig_compiler/kconfig_compiler.cpp | 19 | 
1 files changed, 15 insertions, 4 deletions
| diff --git a/src/kconfig_compiler/kconfig_compiler.cpp b/src/kconfig_compiler/kconfig_compiler.cpp index 50c54f8f..d278414e 100644 --- a/src/kconfig_compiler/kconfig_compiler.cpp +++ b/src/kconfig_compiler/kconfig_compiler.cpp @@ -490,19 +490,30 @@ QString paramString(const QString &group, const QList<Param> ¶meters)      QString paramString = group;      QString arguments;      int i = 1; +    bool firstArg = true;      for (const auto ¶m : parameters) {          const QString paramName = param.name;          const QString str = QLatin1String{"$("} + paramName + QLatin1Char{')'};          if (paramString.contains(str)) {              const QString tmp = QStringLiteral("%%1").arg(i++);              paramString.replace(str, tmp); -            // TODO: change the code here to get C++ code generated by KConfig to use -            // QString::arg(QString, QString, QString) instead of QString().arg().arg() -            arguments += QLatin1String{".arg( mParam"} + paramName + QLatin1String{" )"}; + +            if (firstArg) { +                arguments += QLatin1String{".arg( "}; +                firstArg = false; +            } + +            arguments += QLatin1String{"mParam"} + paramName + QLatin1String{", "};          }      } -    if (arguments.isEmpty()) { +    if (!arguments.isEmpty()) { +        // Remove the last ", " +        arguments.chop(2); + +        // Close the ".arg( " +        arguments += QLatin1String{" )"}; +    } else {          return QLatin1String{"QStringLiteral( \""} + group + QLatin1String{"\" )"};      } | 
