forked from qt-creator/qt-creator
Code model: Fix endless loop in AbstractEditorSupport::functionAt
used by CDB debugger tooltip (introduced by
A 354b9712e4).
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
Rubber-stamped-by: dt
This commit is contained in:
@@ -73,18 +73,15 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
|
|||||||
const CPlusPlus::Overview o;
|
const CPlusPlus::Overview o;
|
||||||
QString rc = o.prettyName(function->name());
|
QString rc = o.prettyName(function->name());
|
||||||
// Prepend namespace "Foo::Foo::foo()" up to empty root namespace
|
// Prepend namespace "Foo::Foo::foo()" up to empty root namespace
|
||||||
for (const CPlusPlus::Symbol *owner = function; ; ) {
|
for (const CPlusPlus::Symbol *owner = function->enclosingNamespace();
|
||||||
if (const CPlusPlus::Scope *nameSpace = owner->enclosingNamespace()) {
|
owner; owner = owner->enclosingNamespace()) {
|
||||||
const QString name = o.prettyName(nameSpace->name());
|
const QString name = o.prettyName(owner->name());
|
||||||
if (name.isEmpty()) {
|
if (name.isEmpty()) {
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
rc.prepend(QLatin1String("::"));
|
rc.prepend(QLatin1String("::"));
|
||||||
rc.prepend(name);
|
rc.prepend(name);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user