Commit f378d78a authored by Ralf Habacker's avatar Ralf Habacker

Fixup of 0053b091

Found a better way to update tree view without patching global
document loading state, which may have unwanted side effects.

This approach has been already used in this method.

CCBUG:386698
parent cedf6fa1
......@@ -287,8 +287,6 @@ UMLObject *createUMLObject(UMLObject::ObjectType type,
} else if (parentPkg && !bPutAtGlobalScope) {
UMLPackage *existingPkg = o->umlPackage();
if (existingPkg != parentPkg && existingPkg != umldoc->datatypeFolder()) {
bool l = umldoc->loading();
umldoc->setLoading(false);
if (existingPkg)
existingPkg->removeObject(o);
else
......@@ -296,7 +294,12 @@ UMLObject *createUMLObject(UMLObject::ObjectType type,
<< "o->getUMLPackage() was NULL";
parentPkg->addObject(o);
o->setUMLPackage(parentPkg);
umldoc->setLoading(l);
// setUMLPackage() triggers tree view item update if not loading by default
if (umldoc->loading()) {
UMLListViewItem *item = UMLApp::app()->listView()->findUMLObject(o);
if (item)
item->updateObject();
}
}
}
QString strippedComment = formatComment(comment);
......
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