Bug 399274

Summary: Duplicated menu items in khelpcenter
Product: [Applications] khelpcenter Reporter: Pavel <mars>
Component: generalAssignee: Documentation Editorial Team <kde-doc-english>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: 5.7.3   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: knelpcenter bug

Description Pavel 2018-10-01 12:30:39 UTC
Created attachment 115342 [details]
knelpcenter bug

Duplicated menu items in khelpcenter

Summary

Package: khelpcenter version 5.7.3 
KDE Frameworks Version 5.51.0
Qt Version 5.11.1

KDE Plasma Version 5.13.90
Kernel Version 4.15.0-34-generic
OS Type: 64-bit

NAME="KDE neon"
VERSION="Developer Edition"
ID=neon
ID_LIKE="ubuntu debian"
PRETTY_NAME="KDE neon Developer Edition"
VERSION_ID="18.04"
HOME_URL="http://neon.kde.org/"
SUPPORT_URL="http://neon.kde.org/"
BUG_REPORT_URL="http://bugs.kde.org/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

On 2018.09.26, an upgrade was made by command dist-upgrade. 
Incorrect to works the contents index tree in the left half of the application window (TreeWidget) khelpcenter.

STEPS TO REPRODUCE
1. Start khelpcenter (in any way).
2. Choose menu item - "Kinfocenter Modules" -  in the left half of the application window.
3. Choose menu item "Memory" in the right half of the application window.
4. Here it is. Look at the left menu (menu item "Memory" for example. Or menu items Device Viewer, DMA-Channels, IEEE 1394 Devices, Interrupts, IO-Ports, etc.).

OBSERVED RESULT
1. Duplicates of the menu “KinfoCenter” appeared in the sub-items “KinfoCenter” (Device Viewer, DMA-Channels, IEEE 1394 Devices, Interrupts, IO-Ports,  Memory, etc.). These duplicates of the "KinfoCenter" menu are displayed as sub-trees in the standard menu.
For example, in the "Memory" menu (KinfoCenter Modules → click item «Memory» in the contents index tree in the right half of the application window → look at the contents index tree in the left half of the application window).

2. The duplicated menu "KinfoCenter" does not work. Menu items are not expanded when clicked (Original menu "KinfoCenter" works true: Application Manuals → System → Info Center).
Pressing on the duplicated "KinfoCenter" menu items does not result in any result (the corresponding help information is not displayed in the right part of the khelpcenter window).

EXPECTED RESULT
1. Subtrees of the "Memory" item (and also in Device Viewer, DMA-Channels, IEEE 1394 Devices, Interrupts, IO-Ports, etc.) should not appear.
2. The original menu "KinfoCenter" should be located only in the section (Application Manuals) → (System) → (Info Center).
3. It should work correctly:
- all menu items should be displayed,
- subparagraphs should open and disclose subtrees,
- the corresponding help is displayed on the right side of the khelpcenter window.
Comment 1 Luigi Toscano 2018-11-19 00:21:07 UTC
Git commit 3e5549ebe181560d92e803cccfde58ebc3573625 by Luigi Toscano, on behalf of Pavel Mars.
Committed on 19/11/2018 at 00:20.
Pushed by ltoscano into branch 'Applications/18.12'.

Remove duplicate submenus.

Summary:
Signed-off-by: Pavel Mars <mars@basealt.ru>

Remove duplicate submenus.

On the left side of the khelpcenter window is the content ("Contents").
If you open the item "Application Manuals" -> "System" -> "Info Center", the item "Info Center" will generate a tree of additional menu items.

If you open the menu item "KInfoCenter Modules" in the same content and then open the menu items that appear (for example, "Device Viewer", "Memory", "OpenGL" or any other item), the same additional menu item tree will be generated.

This change removes duplication of generated trees.

This is achieved by registering the URLs of the elements of the content tree in a separate container and checking the URL to be opened: if the base address from the URL is registered, then we request the generation of the menu tree from the registered element of the tree, but not from the current one.

Reviewers: yurchor, ltoscano

Reviewed By: yurchor, ltoscano

Subscribers: ltoscano, kde-doc-english

Tags: #documentation

Differential Revision: https://phabricator.kde.org/D16308

M  +35   -1    navigatorappitem.cpp
M  +3    -0    navigatorappitem.h

https://commits.kde.org/khelpcenter/3e5549ebe181560d92e803cccfde58ebc3573625