Bug 151492

Summary: Placing a menu item directly under a first-level category in K Menu breaks the menu structure
Product: [openSUSE] SUSE Linux 10.1 Reporter: Forgotten User bwNirt9brK <forgotten_bwNirt9brK>
Component: KDEAssignee: Stephan Binner <stbinner>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Major    
Priority: P3 - Medium CC: suse-beta
Version: Beta 4   
Target Milestone: ---   
Hardware: i686   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: An illustration of the bug
kdebase3 patch - short-menus.diff

Description Forgotten User bwNirt9brK 2006-02-16 13:52:22 UTC
Please see the screenshot I attach to this bug. I have moved AMOR from Games - Amusement to Games. This causes AMOR to be displayed under Games -- that's great, but:

1. the first level items are duplicated with their description appended to their name;

2. the other item under Amusement (here Kodo) is similarly duplicated;

3. the Amusement submenu is not shown.

The above three are obviously not desired behaviour.

Using KDE 3.51-18 on SUSE 10.0 on a Pentium 4 HT.

P.S: Should I have filed this at bugs.kde.org?
Comment 1 Forgotten User bwNirt9brK 2006-02-16 13:53:17 UTC
Created attachment 68835 [details]
An illustration of the bug
Comment 2 Stephan Kulow 2006-02-16 14:25:44 UTC
no, this is most likely broken by a SUSE patch. But it's also very likely already fixed
Comment 3 Lubos Lunak 2006-02-22 16:03:28 UTC
3. is intentional, submenus with one item are replaced with that item
2. is a consequence of 1. and 3.

1. is caused by short-menus.diff, there are two "if ( KickerSettings::reduceMenuDepth()" places, one of them adds the item to slist instead of adding the group to glist, then SuSESortEntries() is called, which it seems to me may again add the group, so eventually the item is once added as an item originating from slist and once added by the second reduceMenuDepth if() originating from SuSESortEntries().

A simple fix is to comment out the slist adding of the item (then the item keeps the menu position of the group, not sure that's intended, but a better fix would be probably much more complicated, I don't understand this code much). Patch attached.
Comment 4 Lubos Lunak 2006-02-22 16:04:31 UTC
Created attachment 69822 [details]
kdebase3 patch - short-menus.diff
Comment 5 Stephan Binner 2006-02-27 17:47:10 UTC
Added the patch - for now, will see if there is a better fix possible.
Comment 6 Stephan Binner 2006-03-01 12:05:34 UTC
Revoked the pending submission of patch #14 - it lets the collapsed menu items disappear from the menu entirely!?
Comment 7 Stephan Binner 2006-03-01 14:05:36 UTC
Breaks not only sorting and duplicates items but also breaks search.
Comment 8 Stephan Binner 2006-03-02 12:22:15 UTC
Submitted better fix as partly discussed with Lubos.