Display sub categories when searching
ClosedPublic

Authored by mart on Dec 15 2019, 5:11 PM.

Details

Summary

when searching, show categories *and* subcategories indented
under categories, making it way less confusing

when the user clicks at a search result the proper
category and subcategory will open

Also when clicking on most used, the proper
category/subcategory will get open on the
sidebar

BUG: 400303
BUG: 398619
FIXED-IN: 5.18.0

Test Plan


Also old views icons and tree still work as usual

Diff Detail

Repository
R124 System Settings
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Dec 15 2019, 5:11 PM
Restricted Application added a project: Plasma. · View Herald TranscriptDec 15 2019, 5:11 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
mart requested review of this revision.Dec 15 2019, 5:11 PM
mart edited the test plan for this revision. (Show Details)Dec 15 2019, 5:13 PM
mart added a reviewer: VDG.Dec 15 2019, 5:20 PM
ngraham edited the summary of this revision. (Show Details)Dec 15 2019, 5:26 PM
mart updated this revision to Diff 71614.Dec 15 2019, 5:46 PM
  • hide subcategory column when going back to start page
alexde retitled this revision from Display sub categories when serching to Display sub categories when searching.Dec 15 2019, 5:49 PM
davidedmundson added inline comments.
core/MenuModel.cpp
101

More comments are needed throughout.

You forgot why we went to the second level of heirachy only 10 minutes after coding it when I asked :P

111

can be deleted

sidebar/SidebarMode.cpp
264–266

calling an int categoryRow makes sense, as the int refers to the row.

Calling an index CategoryRow doesn't.

399–401

please check validity, otherwise model is null and we'll crash.

also ..why make it const, only to cast it?

mart updated this revision to Diff 71775.Dec 18 2019, 12:13 PM
mart marked 3 inline comments as done.
  • adress comments
  • fix clicking againthe same category
mart added inline comments.Dec 18 2019, 12:14 PM
sidebar/SidebarMode.cpp
399–401

QModelIndex::index() is always const?

mart updated this revision to Diff 71776.Dec 18 2019, 12:17 PM
  • get rid of the const cast
mart marked 2 inline comments as done.Dec 18 2019, 12:18 PM
mart added inline comments.
sidebar/SidebarMode.cpp
399–401

got rif of the cast

Nice!

Somehow this has regressed the text color for the selected item:

It used to be white before this patch.

mart added a comment.Dec 18 2019, 3:46 PM

Nice!

Somehow this has regressed the text color for the selected item:

It used to be white before this patch.

ah, right, i had to redo the delegate.. a moment..

mart updated this revision to Diff 71799.Dec 18 2019, 3:51 PM
  • white text when selected
  • lways load the module when in search mode
mart added a comment.Dec 18 2019, 3:51 PM

Nice!

Somehow this has regressed the text color for the selected item:

It used to be white before this patch.

new revision should be fine now

ngraham accepted this revision as: VDG.Dec 18 2019, 4:27 PM
ngraham added inline comments.Dec 18 2019, 4:30 PM
core/MenuModel.cpp
24–25

Remove

sidebar/package/contents/ui/CategoriesPage.qml
149

Remove

mart updated this revision to Diff 71803.Dec 18 2019, 4:43 PM
  • Pleased code enter the commit message for your changes. Lines starting
mart marked 2 inline comments as done.Dec 18 2019, 5:10 PM
mart updated this revision to Diff 71876.Dec 20 2019, 10:47 AM
  • don't accept invalid index as root
  • select proper category when not in search more
mart edited the test plan for this revision. (Show Details)Dec 20 2019, 10:50 AM
mart updated this revision to Diff 71880.Dec 20 2019, 11:22 AM
  • switch column when there are two
mart updated this revision to Diff 71881.Dec 20 2019, 11:33 AM
  • remove trailing space
davidedmundson accepted this revision.Dec 20 2019, 12:06 PM
davidedmundson added inline comments.
core/MenuModel.cpp
49

In other models we tend to drop the suffix "Role" from the rolename

i.e Qt::DisplayRole -> "display"

but it's not super important.

124

I find it un-intuitive that they effectively start at 1, not 0.

The hidden root object is 0, but that can't be accessed via an index.

It took me a while to understand why the delegate spacing logic had depth-2

This revision is now accepted and ready to land.Dec 20 2019, 12:06 PM
mart updated this revision to Diff 71889.Dec 20 2019, 1:32 PM
  • root categories are 0 depth
mart added inline comments.Dec 20 2019, 1:33 PM
core/MenuModel.cpp
49

I followed what it was doing previously, MenuItemRols->MenuItem would clash with the class MenuItem

This revision was automatically updated to reflect the committed changes.