Commit 191e52ef authored by Ralf Habacker's avatar Ralf Habacker
Browse files

Reduce the number of calls to umlPackage() in UMLObject::fullyQualifiedName()...

Reduce the number of calls to umlPackage() in UMLObject::fullyQualifiedName() by making a local copy.

CCBUG:368282
parent 8c6bad8a
......@@ -216,19 +216,20 @@ QString UMLObject::fullyQualifiedName(const QString& separator,
bool includeRoot /* = false */) const
{
QString fqn;
if (umlPackage() && umlPackage() != this) {
UMLPackage *parent = umlPackage();
if (parent && parent != this) {
bool skipPackage = false;
if (!includeRoot) {
UMLDoc *umldoc = UMLApp::app()->document();
if ((umldoc->rootFolderType(umlPackage()) != Uml::ModelType::N_MODELTYPES) ||
(umlPackage() == umldoc->datatypeFolder()))
if ((umldoc->rootFolderType(parent) != Uml::ModelType::N_MODELTYPES) ||
(parent == umldoc->datatypeFolder()))
skipPackage = true;
}
if (!skipPackage) {
QString tempSeparator = separator;
if (tempSeparator.isEmpty())
tempSeparator = UMLApp::app()->activeLanguageScopeSeparator();
fqn = umlParent()->asUMLPackage()->fullyQualifiedName(tempSeparator, includeRoot);
fqn = parent->fullyQualifiedName(tempSeparator, includeRoot);
fqn.append(tempSeparator);
}
}
......
Supports Markdown
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