Bug 386698

Summary: Namespace mismatch of types import from java import between object and tree view
Product: [Applications] umbrello Reporter: Ralf Habacker <ralf.habacker>
Component: importerAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: simonandric5
Priority: NOR    
Version: 2.23.2 (KDE Applications 17.08.2)   
Target Milestone: ---   
Platform: Other   
OS: All   
Latest Commit: Version Fixed In: 2.23.80 (KDE Applications 17.11.80)
Bug Depends on:    
Bug Blocks: 386479    

Description Ralf Habacker 2017-11-09 22:54:54 UTC
How to reproduce ?
1. start umbrello
2. select language "java"
3. import file https://cgit.kde.org/umbrello.git/plain/test/import/java/apackage/Base.java?id=edd187d85cbd92c42a6e4a0ad0a841b2599abfa3
4. import file https://cgit.kde.org/umbrello.git/plain/test/import/java/apackage/Type.java?id=edd187d85cbd92c42a6e4a0ad0a841b2599abfa3
5. Open properties of class Type

What happens ?
The class Type has package path "apackage" but is located at top level in tree view

What is expected ?
Class Type should be located below package "apackage" in tree view
Comment 1 Ralf Habacker 2017-11-11 16:52:24 UTC
Git commit 0053b09126f6cd5057e3cfe8573efd1a184ff675 by Ralf Habacker.
Committed on 11/11/2017 at 16:47.
Pushed by habacker into branch 'master'.

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.
FIXED-IN:2.23.80 (KDE Applications 17.11.80)

M  +5    -2    umbrello/codeimport/import_utils.cpp
M  +10   -0    umbrello/umllistviewitem.cpp

https://commits.kde.org/umbrello/0053b09126f6cd5057e3cfe8573efd1a184ff675
Comment 2 Ralf Habacker 2017-11-12 21:01:09 UTC
Git commit f378d78aff1bf558d076140fc5544afda781a6fc by Ralf Habacker.
Committed on 12/11/2017 at 21:00.
Pushed by habacker into branch 'master'.

Fixup of 0053b0912

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.

M  +6    -3    umbrello/codeimport/import_utils.cpp

https://commits.kde.org/umbrello/f378d78aff1bf558d076140fc5544afda781a6fc