Commit 95117681 authored by Jarek Kobus's avatar Jarek Kobus
Browse files

Fixes: Provide arg name in "Go to slot" when arg is missing

Task:     QTCREATORBUG-1721
RevBy:    Friedemann Kleint <qtc-committer@nokia.com>
parent d1089afc
......@@ -372,8 +372,18 @@ static QString addParameterNames(const QString &functionSignature, const QString
functionName += QLatin1String(", ");
functionName += arguments.at(i);
if (i < pCount) {
functionName += QLatin1Char(' ');
functionName += parameterNames.at(i);
// prepare parameterName
QString parameterName = parameterNames.at(i);
if (parameterName.isEmpty()) {
const QString generatedName = QLatin1String("arg") + QString::number(i + 1);
if (!parameterNames.contains(generatedName))
parameterName = generatedName;
}
// add parameterName if not empty
if (!parameterName.isEmpty()) {
functionName += QLatin1Char(' ');
functionName += parameterName;
}
}
}
functionName += QLatin1Char(')');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment