Commit e94990f1 authored by Friedemann Kleint's avatar Friedemann Kleint

Code model: Fix endless loop in AbstractEditorSupport::functionAt

used by CDB debugger tooltip (introduced by
 A 354b9712).
Reviewed-by: default avatarChristian Kamm <christian.d.kamm@nokia.com>
Rubber-stamped-by: dt
parent fa7d22e3
......@@ -73,17 +73,14 @@ QString AbstractEditorSupport::functionAt(const CppModelManagerInterface *modelM
const CPlusPlus::Overview o;
QString rc = o.prettyName(function->name());
// Prepend namespace "Foo::Foo::foo()" up to empty root namespace
for (const CPlusPlus::Symbol *owner = function; ; ) {
if (const CPlusPlus::Scope *nameSpace = owner->enclosingNamespace()) {
const QString name = o.prettyName(nameSpace->name());
if (name.isEmpty()) {
break;
} else {
rc.prepend(QLatin1String("::"));
rc.prepend(name);
}
} else {
for (const CPlusPlus::Symbol *owner = function->enclosingNamespace();
owner; owner = owner->enclosingNamespace()) {
const QString name = o.prettyName(owner->name());
if (name.isEmpty()) {
break;
} else {
rc.prepend(QLatin1String("::"));
rc.prepend(name);
}
}
return rc;
......
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