Library support for per-activity pinned tasks
ClosedPublic

Authored by ivan on Oct 10 2016, 2:00 PM.

Details

Summary
  • The URL in the configuration file now contains also the list of activities it should be shown in
  • The configuration format is backwards compatible
  • Added API to differentiate between the shown launchers (for the current activity), and all configured launchers
  • Supports reordering of the launchers
Test Plan
  • It needs the ivan/per-activity-launchers branch of plasma-workspace because of the API changes. At the moment, the plasmarc file needs to be manually changed for a launcher to be in a specific activity or a set of activities
  • Testing done with automatic and manual tasks ordering
  • Configuration transition works
  • Apropriate launchers are loaded for each activity

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ivan updated this revision to Diff 7262.Oct 10 2016, 2:00 PM
ivan retitled this revision from to Library support for per-activity pinned tasks.
ivan updated this object.
ivan edited the test plan for this revision. (Show Details)
ivan added reviewers: Plasma, hein.
Restricted Application added a project: Plasma. · View Herald TranscriptOct 10 2016, 2:00 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein edited edge metadata.Oct 10 2016, 2:28 PM

Here's a few spontaneous thoughts ... not really meant as an in-depth review:

  • This is like a step 1, right? It appears the requestAdd/Remove APIs currently add/remove to all activities, so there's no way yet for users to make per-activity launchers?
  • I'm a bit surprised that the code doesn't use the existing machinery to filter the launcher list by activity ... couldn't LauncherTasksModel just implement AbstractTasksModel::AdditionalRoles::Activities for launcher tasks and rely on TaskFilterProxyModel doing the rest, just like it works for window tasks? The "shownLauncherList" stuff seems to reinvent the wheel at the lower level, when the overall approach in the libtaskmanager codebase is to have a pyramid of dumb list source models that get increasingly filtered/mangled. Or did you try this and it ran into trouble with the ordering ...?
  • Note that there shouldn't be any magic that only makes sense in concert with the specific TM applet, the libtaskmanager API should make sense to someone coming at it cold and obey its users. It has users outside of the TM applet.
ivan added a comment.Oct 10 2016, 3:42 PM

This is like a step 1, right? It appears the requestAdd/Remove APIs
currently add/remove to all activities

This is the first step that actually worked. Yes, the add/remove API will get a requestAdd/RemoveTo/FromCurrentActivity.

I'm a bit surprised that the code doesn't use the existing machinery to
filter the launcher list by activity ... couldn't LauncherTasksModel just implement

This happens when someone goes into this blind. I'll see how to make it work with the current filtering mechanism.

Note that there shouldn't be any magic that only makes sense in concert
with the specific TM applet, the libtaskmanager

There is nothing really magic here. Namely, the old API returned urls "serialized" as strings - it still returns serialized data. I don't see a way around this approach (I've tried having it separated, but then you have the problem of what is saved where, and how it should be synced) since the data model expects the client to provide the serialized data instead of providing, for example, a config group or some kind of ID for the model to have a full control of the storage.

ivan updated this revision to Diff 7276.Oct 10 2016, 5:44 PM
ivan edited edge metadata.
  • Library support for per-activity pinned tasks
  • Filtering now checks for the null activity
  • Exporting activities list through data member function
  • When a launcher is on all activities, the list is now empty
  • Relying on the filter model to do the filtering
  • Removed debugging output
ivan updated this revision to Diff 7277.Oct 10 2016, 6:02 PM
  • Validating the list of activities specified for a launcher
  • Nicer handling of duplicate urls
hein added a comment.Oct 11 2016, 9:47 AM

Yeah this looks cleaner now :)

hein accepted this revision.Oct 18 2016, 6:32 PM
hein edited edge metadata.
This revision is now accepted and ready to land.Oct 18 2016, 6:32 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.