[WIP] Rewrite kworkspace logout, shutdown and suspend API

Authored by davidedmundson on Feb 6 2019, 1:30 PM.

Description

[WIP] Rewrite kworkspace logout, shutdown and suspend API

Summary:
The old code path is old and even sometimes uses the ICE protocol to
start a logout from ksmserver. It's quite archaic and unreadable,
KDisplayManager is even worse.

The new code consists of two parts.

A QML friendly front end QObject that we can register in a plugin that
can trigger actions such as prompting a logout or suspending the system
and a singleton that talks to the relevant backend.

Backends are:

  • Any logind interface
  • Consolekit2
  • Consolekit0.4 + UPower

New API loading is also entirely asyncronous.

There are some behavioural changes:

  • Creating a logout prompt is called directly instead of going via

ksmserver. The prompt then calls into ksmserver when accepted

  • Suspend is called directly instead of going via powerdevil through

some kdelibs4support solid code.

All DBus calls use generated XML files, instead of big QDBusMessage
commands. It's a bit overkill in terms of what we generate, but that's
ready for moving SessionModel in here and killing KDisplayManager.

Patch looks huge because of all the XML files, but is otherwise very
simple.

This is intended to be an API break, which is fine as kworkspace is only
to be used by plasma. The relevant DataSource will remain compatiable.

WIP: As I need to port all the calling code, and I want to port
SessionsModel (probably in a different patch)

Test Plan:
Ran sessionstest on my logind machine
I do need other people to test their setups.
Especially a BSD person with CK1

Reviewers: Plasma

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D19389