Commit 0053b091 authored by Ralf Habacker's avatar Ralf Habacker

Fix 'Namespace mismatch of types imported from java import between object and tree view'

Unknown types imported from java files are assigned initial to the global namespace.
If the related type is found later, the namespace will be updated. This update was not
propagated to the tree view.

To propagate the update to the tree view it is required to enable the UMLObject::modified()
signal temporary on changing the package parent.

The signal emitting has been moved down in code to be sure that all other changes are applied.

BUG:386698
FIXED-IN:2.23.80 (KDE Applications 17.11.80)
parent 632759a0
......@@ -286,14 +286,17 @@ UMLObject *createUMLObject(UMLObject::ObjectType type,
}
} else if (parentPkg && !bPutAtGlobalScope) {
UMLPackage *existingPkg = o->umlPackage();
if (existingPkg != umldoc->datatypeFolder()) {
if (existingPkg != parentPkg && existingPkg != umldoc->datatypeFolder()) {
bool l = umldoc->loading();
umldoc->setLoading(false);
if (existingPkg)
existingPkg->removeObject(o);
else
uError() << "createUMLObject(" << name << "): "
<< "o->getUMLPackage() was NULL";
o->setUMLPackage(parentPkg);
parentPkg->addObject(o);
o->setUMLPackage(parentPkg);
umldoc->setLoading(l);
}
}
QString strippedComment = formatComment(comment);
......
......@@ -341,6 +341,16 @@ void UMLListViewItem::updateObject()
if (m_object == 0)
return;
// check if parent has been changed, remap parent if so
UMLListViewItem *oldParent = dynamic_cast<UMLListViewItem*>(parent());
if (oldParent && oldParent->m_object != m_object->umlPackage()) {
UMLListViewItem *newParent = UMLApp::app()->listView()->findUMLObject(m_object->umlPackage());
if (newParent) {
oldParent->removeChild(this);
newParent->addChild(this);
}
}
Uml::Visibility::Enum scope = m_object->visibility();
UMLObject::ObjectType ot = m_object->baseType();
QString modelObjText = m_object->name();
......
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