Hide group menu items if they have no children

Authored by alnikiforov on Feb 14 2020, 3:25 PM.



If there's no data, it looks like it's bugged. Let's hide it in such case.

Similar to: D27403, D27404

Test Plan

Before testing this bug, it may be necessary to remove some applications to reproduce situation when only applications with no documentation are present in a menu group.
On my test machine, I have only 'LibreOffice Math' in 'Science' group, and around 4 applications in 'Development' group, and none of these applications have information about
documentation present at all or in way that khelpcenter can detect and process.

Thus, when I open menu item Application Manuals -> Science or Development, it is completely empty.

With this change all such empty items should be hidden instead.

Diff Detail

R125 KHelpCenter
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
alnikiforov created this revision.Feb 14 2020, 3:25 PM
Restricted Application added a project: Documentation. · View Herald TranscriptFeb 14 2020, 3:25 PM
Restricted Application added a subscriber: kde-doc-english. · View Herald Transcript
alnikiforov requested review of this revision.Feb 14 2020, 3:25 PM

Here's screenshot of empty Science and Development groups being visible before this change is applied:

With this, they'd no longer be visible.

yurchor accepted this revision.Feb 15 2020, 3:33 PM

Thanks. Works as expected.

This revision is now accepted and ready to land.Feb 15 2020, 3:33 PM
This revision was automatically updated to reflect the committed changes.