Bug 415992 - When creating a composition using the toolbar, two relationships are created
Summary: When creating a composition using the toolbar, two relationships are created
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 2.30.0 (KDE Applications 19.12.0)
Platform: Other Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-08 08:30 UTC by Hamid Sahraiee
Modified: 2020-01-09 16:46 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.30.2 (KDE Applications 19.12.2)


Attachments
Screenshot showing what is broken (45.60 KB, image/png)
2020-01-08 12:00 UTC, Ralf Habacker
Details
Screenshot showing what is broken (update) (46.02 KB, image/png)
2020-01-08 12:01 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hamid Sahraiee 2020-01-08 08:30:06 UTC
SUMMARY
when I try to rename a variable in the Tree View that auto generated by the Composition tool, it create another Association link.

STEPS TO REPRODUCE
1. Create two class C1 and C2 and drag them into the class diagram
2. Choose Composition tool from toolbar
3. Drag it from C1 to C2, a new variable will be appear with the default name
4. go to the Tree view and find that variable and rename it.


OBSERVED RESULT
 another association will be create [therefore there is two association] and rename both of them. can be checked in the class Properties/Associations

EXPECTED RESULT
 just rename the existing association variable. 

SOFTWARE/OS VERSIONS
Windows: Win 10 64bit / 1903
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
I Suggest the default variable name that is generated in the composition association be the target class name that starts with "_".

Excuse me for my bad English
thanks a lot.
Comment 1 Ralf Habacker 2020-01-08 10:03:46 UTC
Thanks reportin
Comment 2 Ralf Habacker 2020-01-08 11:26:37 UTC
(In reply to Ralf Habacker from comment #1)
> Thanks reportin
sed s,Thanks reportin,thanks for reporting,g'
Comment 3 Ralf Habacker 2020-01-08 12:00:23 UTC
Created attachment 124969 [details]
Screenshot showing what is broken

I have attached a screenshot that contains use cases for the visual representation of compositions (and related aggregations). Did I forget anything ?
Comment 4 Ralf Habacker 2020-01-08 12:01:49 UTC
Created attachment 124970 [details]
Screenshot showing what is broken (update)
Comment 5 Ralf Habacker 2020-01-08 15:40:26 UTC
> 3. Drag it from C1 to C2, a new variable will be appear with the default name
In this step the duplicated association is created
Comment 6 Ralf Habacker 2020-01-08 15:43:51 UTC
Git commit afaca964b8807e4c824b9149bc725a5b5879571a by Ralf Habacker.
Committed on 08/01/2020 at 15:43.
Pushed by habacker into branch 'release/19.12'.

Fix 'Duplicate Composition Association when rename it's variable in the tree View'

When connecting two classes by means of a 'composition',
a relationship was previously created twice. Once in
ToolBarStateAssociation::setSecondWidget() and the second
time in UMLWidget::updateWidget(), which is triggered by
the 'modified' signal when calling UMLClassifier::addAttribute().
FIXED-IN:2.30.2 (KDE Applications 19.12.2)

M  +9    -3    umbrello/toolbarstateassociation.cpp

https://invent.kde.org/kde/umbrello/commit/afaca964b8807e4c824b9149bc725a5b5879571a
Comment 7 Ralf Habacker 2020-01-08 16:02:52 UTC
Comment on attachment 124970 [details]
Screenshot showing what is broken (update)

The attribute change issue is tracked with bug 416006.
Comment 8 Hamid Sahraiee 2020-01-08 17:25:13 UTC
Thanks a lot ;)
Comment 9 Ralf Habacker 2020-01-09 16:46:51 UTC
You may download an umbrello snapshot for Windows with this patch applied from https://umbrello.kde.org/snapshots.php