Bug 430593 - It shall be possible to nest folders in packages
Summary: It shall be possible to nest folders in packages
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-19 18:53 UTC by Oliver Kellogg
Modified: 2021-02-11 23:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 2.33.80 (KDE releases 21.03.80)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Kellogg 2020-12-19 18:53:16 UTC
SUMMARY

It shall be possible to nest folders in packages

STEPS TO REPRODUCE
1. Start Umbrello.
2. In the listview right click on Logical View and select New -> Package...
3. In Logical View right click on the new_package and select New.

OBSERVED RESULT

The items offered for creation inside Package do not include Folder.

EXPECTED RESULT

The items offered for creation inside Package shall include Folder.

SOFTWARE/OS VERSIONS
Umbrello: git master @ ea603204
Linux: openSuSE Tumbleweed 20201129
KDE Plasma Version: 5.20.3
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2
Comment 1 Oliver Kellogg 2020-12-19 19:41:10 UTC
Git commit afe54199882d78ced2a04d520122a573b72151e9 by Oliver Kellogg.
Committed on 19/12/2020 at 19:40.
Pushed by okellogg into branch 'master'.

Address 'It shall be possible to nest folders in packages' :

umbrello/model_utils.cpp
- In function typeIsAllowedInType case childType lvt_Logical_Folder,
  return true if parentType is lvt_Package.

umbrello/menus/listpopupmenu.{h,cpp}
- At functions
  - insertContainerItems(bool folderAndDiagrams, bool packages)
  - insertContainerItems(KMenu*, bool folderAndDiagrams, bool packages)
  split the single argument folderAndDiagrams into two separate
  arguments, `bool folders' and `bool diagrams'.

umbrello/menus/listpopupmenu.cpp
- In function insert(const MenuType, KMenu*) improve readability by
  - defining macro functions which factor the repeated code;
  - aligning the switch cases in quasi tabular form.

umbrello/menus/umllistviewpopupmenu.cpp
- In constructor with arguments QWidget*, UMLListViewItem*, in body of
  switch(type),
  - adjust code to changed signature of ListPopupMenu function
    insertContainerItems;
  - in case UMLListViewItem::lvt_Package call insertContainerItems with
    argument `folders' set to true.

umbrello/umllistview.cpp
- In function moveObject body of switch (srcType) handling of diagram
  types and lvt_Logical_Folder, admit case newParentType lvt_Package to
  execution of the move.

M  +147  -143  umbrello/menus/listpopupmenu.cpp
M  +2    -2    umbrello/menus/listpopupmenu.h
M  +5    -5    umbrello/menus/umllistviewpopupmenu.cpp
M  +3    -2    umbrello/model_utils.cpp
M  +2    -1    umbrello/umllistview.cpp

https://invent.kde.org/sdk/umbrello/commit/afe54199882d78ced2a04d520122a573b72151e9