Add ksysguard plugin for taskmanager integration
AcceptedPublic

Authored by davidedmundson on Aug 22 2019, 4:47 PM.

Details

Reviewers
broulik
Group Reviewers
Plasma
Summary

Currently this is all hardcoded in ProcessModel. By moving it into a
plugin we can make that model half the size.

Code is ported to use libTM instead of KWindowSystem for a few reasons:

  • It works on wayland (assuming we have the extra permissions set)
  • We get to make use of the more complex advanced mapping in libTM
  • It has fixed code to get the right PID for a window so apps in a PID

namespace have the icon in the right place (currently broken in
ksysguard)

Requires some tiny mods in ProcessModel to map the decoration role.

Introduces a p-w dependency in ksysguard, but not the lib so there's no
lib.

Test Plan

Opened ksysguard, data matched the old ksysguard, except for my flatpak
app which now had the icon on the correct process not some random kernel
process

Diff Detail

Repository
R106 KSysguard
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 15485
Build 15503: arc lint + arc unit
davidedmundson created this revision.Aug 22 2019, 4:47 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 22 2019, 4:47 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Aug 22 2019, 4:47 PM
davidedmundson edited the summary of this revision. (Show Details)Aug 22 2019, 4:52 PM
broulik added inline comments.
plugins/process/taskmanager/taskmanager.cpp
23

Unused

58

attachPidToTMIndex already checks for IsWindow unless you want to save a pointless AppPid call

72

rowCount() - 1 because you go i <= last

77

Roles can potentially be empty indicating all roles are dirty?
Also, what about DecorationRole, in case it's window pixmap.

83

rowCount() - 1

99

This role is a QIcon, potentially created from the window pixmap in case window mapping failed.
Or is that what the "tiny mods in ProcessModel" is about?

plugins/process/taskmanager/taskmanager.h
24

Unused, forward-declare

hein added a subscriber: hein.Aug 22 2019, 5:05 PM

Do you really need a TasksModel, or is a WindowTasksModel enough?

plugins/process/taskmanager/taskmanager.cpp
99

Yeah, and I need to map it to there decoration role on a different row.
Kinda messy and against the spirit of plugins, but it still helps the code

davidedmundson marked 8 inline comments as done.Aug 23 2019, 12:02 PM
broulik accepted this revision.Aug 30 2019, 12:40 PM
This revision is now accepted and ready to land.Aug 30 2019, 12:40 PM