Skip to content

RFC: Add an option to display favs in rootModel

I needed a way to display favs in rootModel, but I wasn't sure of the best way to do it, so I implemented 3 ways to do this.

  1. This adds an option (showFavorites) to display favorites just like recent apps/files/contacts It adds a setter to KAStatsFavoritesModel description to allow a trick similar to all apps model ("KICKER_FAVORITES_MODEL")
  • Pros: similar to all apps model, somewhat easy to use
  • Cons: This is a bit of a pickle cause there's already systemFavoritesModel, so the natural question is why use the model provided by this option in the first place?
  1. Adds showFavoritesDud which is an empty placeholder but it allows to detect itself("KICKER_FAVORITES_MODEL"), thus allowing consuming side to use a custom page, which you'd want anyway(to allow dragging favs and stuff)
  • Pros: removes redundant model.
  • Cons: another hardcoded description which is not ideal, weird to have placeholders in a model where there were none
  1. The extensible way. Basically it allows qml consumers of the api to set any amount of placeholders with any ID. That way there's no need to hardcode any placeholders and it allows people to have different usecases without modifying the model itself (like adding favs to the list). (btw I called them duds instead of placeholders because it was shorter. They're not literally duds ;) )
  • Pros: removes redundant model, is extensible
  • Cons: weird to have placeholders in a model where there were none

When a method to do this is decided I'll remove the other 2. Please let me know which method should I keep

Here's how it looks with plasma-desktop!190 (closed) (make sure to enable it in options)

image

See also !377 (closed)

Edited by Mikel Johnson

Merge request reports