summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2016-09-06 17:11:25 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2016-09-06 17:11:25 (GMT)
commit191e52ef5dc2e9a03b3a6c42a6566c4a82630d66 (patch)
tree44dc0b634f998b1b6a9ec13f50e21633cad6d069
parent8c6bad8a76df59a11bf67ce62e76c3bda0f12007 (diff)
Reduce the number of calls to umlPackage() in UMLObject::fullyQualifiedName() by making a local copy.
CCBUG:368282
-rw-r--r--umbrello/umlmodel/umlobject.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/umbrello/umlmodel/umlobject.cpp b/umbrello/umlmodel/umlobject.cpp
index 79d96f6..4858172 100644
--- a/umbrello/umlmodel/umlobject.cpp
+++ b/umbrello/umlmodel/umlobject.cpp
@@ -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);
}
}