forked from qt-creator/qt-creator
Fix function extraction for nested classes
If the function is added to a class inside a class, these must be prepended before the inner class name. Fixes: QTCREATORBUG-7271 Change-Id: I07042cdd4927af3b630c6ab1b5587971754e1199 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -3302,9 +3302,17 @@ public:
|
|||||||
|
|
||||||
// Write class qualification, if any.
|
// Write class qualification, if any.
|
||||||
if (matchingClass) {
|
if (matchingClass) {
|
||||||
const Name *name = rewriteName(matchingClass->name(), &env, control);
|
Class *current = matchingClass;
|
||||||
funcDef.append(printer.prettyName(name));
|
QVector<const Name *> classes{matchingClass->name()};
|
||||||
funcDef.append(QLatin1String("::"));
|
while (current->enclosingScope()->asClass()) {
|
||||||
|
current = current->enclosingScope()->asClass();
|
||||||
|
classes.prepend(current->name());
|
||||||
|
}
|
||||||
|
for (const Name *n : classes) {
|
||||||
|
const Name *name = rewriteName(n, &env, control);
|
||||||
|
funcDef.append(printer.prettyName(name));
|
||||||
|
funcDef.append(QLatin1String("::"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the extracted function itself and its call.
|
// Write the extracted function itself and its call.
|
||||||
|
Reference in New Issue
Block a user