Bug 347412 - Kicker ignores menu layout settings
Summary: Kicker ignores menu layout settings
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Application Menu (Kicker) (show other bugs)
Version: 5.3.0
Platform: ROSA RPMs Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-08 09:11 UTC by Pulfer
Modified: 2015-05-12 14:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pulfer 2015-05-08 09:11:28 UTC
Kicker from Plasma 5.3.0 ignores menu layout settings. 

For example, ROSA has this menu layout for Tools:

----------------------
  <Menu>
    <Name>Tools</Name>
    <Directory>mandriva-tools.directory</Directory>
    <Layout>
      <Menuname inline="false">SystemTools</Menuname>
      <Menuname inline="false">Accessibility</Menuname>
      <Menuname inline="false">Emulators</Menuname>
      <Merge type="menus"/>
      <Separator/>
      <Merge type="files"/>
      <Menuname>More</Menuname>
    </Layout>
...
----------------------

But the result (display order) is:
1. Menus
2. More
3. Files

It also doesn't display menu separator (the one from layout; the separator below the Recent* categories is shown).

Kickoff and KMenuEdit display menu layout properly.

Reproducible: Always
Comment 1 Eike Hein 2015-05-08 20:11:04 UTC
Kicker currently intentionally collates alphabetically (partly because sorting in KService is broken).
Comment 2 Pulfer 2015-05-09 02:18:55 UTC
(In reply to Eike Hein from comment #1)
> Kicker currently intentionally collates alphabetically (partly because
> sorting in KService is broken).

Are you sure it's skill broken? Can you please re-check it?

I removed sorting code from Kicker: https://abf.rosalinux.ru/import/plasma5-desktop/blob/rosa2014.1/plasma-desktop-5.3.0-kicker-no-sort.patch

And now menu layout is respected but entries are still alphabetically sorted (and still there's no menu separator in submenus, the only layout-related issue that seems to remain).
Comment 3 Eike Hein 2015-05-09 23:01:30 UTC
Separators are currently not supported.
Comment 4 Pulfer 2015-05-10 02:15:07 UTC
Perhaps manual sorting should be done only in flat mode. Or maybe flat mode should contain submenu headers like:

Utilities:
------------
- [bold]System[/bold]
------------
- kinfocenter
- krdc
- krfb
- ... (other Utilities -> System)
------------
- [bold]Emulators[/bold]
------------
- dosbox
- wine
- ... (other Utilities -> Emulators)
------------
- ark
- kcalc
- konsole
- kwrite
- ... (other Utilities)
Comment 5 Eike Hein 2015-05-10 02:33:31 UTC
I plan to look into the sorting problems, but can't really give a time table right now due to other commitments. It'll likely be a mix of rooting out the problems in KService (which might be as simple as KService not using QCollator and having been ported wrongly from KLocale) and implementing a similar pass in Kicker when in flattened mode.

Separator support might also be implemented at some point (some of the ground work is already there as of 5.3).
Comment 6 Eike Hein 2015-05-11 19:28:02 UTC
I've started to implement this, will probably go in some time this week.
Comment 7 Eike Hein 2015-05-11 20:05:47 UTC
Git commit 8304f377ad865bdd9329c462e8734ea6c2a2ab4a by Eike Hein.
Committed on 11/05/2015 at 20:02.
Pushed by hein into branch 'master'.

Support custom menu layouts and menu separator items.

If menu flattening is enabled and a group actually has subgroups
that get flattened in, separators are ignored and entriees are
collated alphabetically.

Leading or trailing separators are always ignored, and multiple
consecutive separators are collapsed into one.

M  +7    -8    applets/kicker/package/contents/ui/FullRepresentation.qml
M  +8    -8    applets/kicker/package/contents/ui/ItemListDelegate.qml
M  +2    -1    applets/kicker/package/contents/ui/ItemListDialog.qml
M  +4    -4    applets/kicker/package/contents/ui/ItemListView.qml
M  +3    -3    applets/kicker/plugin/abstractentry.h
M  +6    -1    applets/kicker/plugin/abstractmodel.cpp
M  +3    -0    applets/kicker/plugin/abstractmodel.h
M  +1    -1    applets/kicker/plugin/actionlist.h
M  +69   -21   applets/kicker/plugin/appsmodel.cpp
M  +4    -0    applets/kicker/plugin/appsmodel.h
M  +15   -0    applets/kicker/plugin/forwardingmodel.cpp
M  +2    -0    applets/kicker/plugin/forwardingmodel.h
M  +3    -1    applets/kicker/plugin/rootmodel.cpp

http://commits.kde.org/plasma-desktop/8304f377ad865bdd9329c462e8734ea6c2a2ab4a
Comment 8 Eike Hein 2015-05-11 20:06:17 UTC
Git commit 6f5e2d2783452ecba53875be1d66cb73d49d04c6 by Eike Hein.
Committed on 11/05/2015 at 20:05.
Pushed by hein into branch 'master'.

Revert "Remove separator functionality"

This reverts commit 06393d5fa99a8cc45ab6694912ff5cde0f4223f4.

M  +4    -0    kmenuedit.cpp
M  +6    -1    menufile.cpp
M  +7    -0    menuinfo.cpp
M  +8    -0    menuinfo.h
M  +124  -0    treeview.cpp
M  +6    -0    treeview.h

http://commits.kde.org/kmenuedit/6f5e2d2783452ecba53875be1d66cb73d49d04c6
Comment 9 Kai Uwe Broulik 2015-05-11 20:55:07 UTC
So that means we need to restore the separator functionality in KMenuEdit and add it to Kickoff as well?
Comment 10 Eike Hein 2015-05-11 20:58:07 UTC
kmenuedit is done, see comment #8.

Kickoff might get separators (if it makes sense in the design) when it's ported to the Kicker backend; trying to catch up the old Kickoff backend to the Kicker one doesn't really make sense anymore. The functionality delta is really big now and the duplication of effort would be a waste.
Comment 11 Kai Uwe Broulik 2015-05-11 20:59:26 UTC
Sorry, only read the second commit email ;) +1 for the port, Kicker has so many fancy features I'd like in Kickoff
Comment 12 Eike Hein 2015-05-11 21:01:40 UTC
I'm currently still working on refactoring Kicker's favorites system (to get things like contact favorites working, with avatars + status badge ...) and then i'll turn to looking into the port :).
Comment 13 Pulfer 2015-05-12 07:04:55 UTC
(In reply to Eike Hein from comment #7)
> If menu flattening is enabled and a group actually has subgroups
> that get flattened in, separators are ignored and entriees are
> collated alphabetically.
> http://commits.kde.org/plasma-desktop/
> 8304f377ad865bdd9329c462e8734ea6c2a2ab4a

Thanx, I've backported this commit to ROSA's Plasma 5.3.x packages.

The only issue I found so far is a different way of sorting in flat and normal modes. In normal mode Latin names go before Cyrillic names while in flat mode they go after Cyrillic names.
Comment 14 Eike Hein 2015-05-12 12:01:42 UTC
^ That'd be the KService stuff I mentioned then. Only menus that actually get flattened are sorted by Kicker though (i.e. if there's nothing to flatten into a menu, it's still using KService sorting).
Comment 15 Pulfer 2015-05-12 13:05:14 UTC
(In reply to Eike Hein from comment #14)
> ^ That'd be the KService stuff I mentioned then. Only menus that actually
> get flattened are sorted by Kicker though (i.e. if there's nothing to
> flatten into a menu, it's still using KService sorting).

Yes, I understand the code here. But IMHO KService's sorting is preferable, it's more traditional and expected. At least for Latin / Cyrillic case. On the other hand, it's QCollator issue, not Kicker.
Comment 16 Eike Hein 2015-05-12 14:08:23 UTC
^ From a layering POV it's better to use QCollator everywhere though, since then it can be fixed centrally / QCollator is informed by locale (collation rules are very locale-specific even for the same language).