Move code to send signals and set priority of processes to a dedicated object

Authored by ahiemstra on Aug 29 2019, 1:27 PM.



This pulls the code out of KSysGuardProcessList and introduces it in a
new class called ProcessController. This should help make that code more
reusable and allow it to eventually be exposed to QML.

Test Plan

Start ksysguard, try to send signals to processes and set priorities, including
root-owned processes. Everything should still work.

Diff Detail

R111 KSysguard Library
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
ahiemstra created this revision.Aug 29 2019, 1:27 PM
Restricted Application added a project: Plasma. · View Herald TranscriptAug 29 2019, 1:27 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ahiemstra requested review of this revision.Aug 29 2019, 1:27 PM


Looks nice and simplifies this old mega class


Eww, it would be better if we could make this a qwindow, but I see you're limited by current KAuth


If we're invoking this from QML any call that spawns an event loop has the potential to crash.

box = new KMessageBox()

would probably help

ahiemstra added inline comments.Aug 29 2019, 5:11 PM

Agreed. I did look at what would be needed to do that, but the entire widget thing is embedded pretty deeply in KAuth. Luckily, for QML we can probably just leave this out. We won't get window modality, but that's the only drawback. I added this mostly so we don't have any regressions in the current UI.


That's why the ProcessController does not have this code - my intention was to have the UI bits handled completely by QML, so you end up creating an instance of ProcessController, then just call sendSignal or whatever and get a result back, then QML can handle that result. This code is the ProcessList widget that we shouldn't be using in QML anyway.

davidedmundson accepted this revision.Aug 30 2019, 10:19 AM
This revision is now accepted and ready to land.Aug 30 2019, 10:19 AM
This revision was automatically updated to reflect the committed changes.