Convert powerdevil backends to proper plugins
ClosedPublic

Authored by bshah on Aug 8 2016, 8:44 AM.

Details

Summary

This converts the powerdevil backends into proper plugins that are
loaded at runtime instead of just hardcoding upowerbackend. And are also
seperated from the powerdevil kded. This is first step to have other
modules for example, wayland, hwcomposer etc.

Logic for finding and loading backends is mostly inspired from the
kscreen, currently it just loads upower backend because it is only
module available. This logic can be changed when new backends are
introduced in powedevil.

Test Plan

compiles, builds and installs backend module powerdevilupowerbackend.so
into proper plugin path. Also verified with powerdevil kded that it gets
loaded properly.

Diff Detail

Repository
R122 Powerdevil
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah updated this revision to Diff 5731.Aug 8 2016, 8:44 AM
bshah retitled this revision from to Convert powerdevil backends to proper plugins.
bshah updated this object.
bshah edited the test plan for this revision. (Show Details)
bshah added reviewers: Plasma, broulik.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 8 2016, 8:44 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
bshah updated this revision to Diff 5732.Aug 8 2016, 8:49 AM

remove unused stray function loadBackends

broulik accepted this revision.Aug 8 2016, 8:53 AM
broulik edited edge metadata.

Looks good to me.

wayland

Wayland would still use upower but instead of having XRandRBrightness only use sysfs, this needs some more thought on how we could split that in the future, I guess.

daemon/kdedpowerdevil.cpp
83

fileInfos

also call reserve() as you later iterate something and add an already known number of items

84

const QString &paths

94

compare with QLatin1String

111

QPluginLoader *

113–114

Check for interface being null (cast failed) maybe?

This revision is now accepted and ready to land.Aug 8 2016, 8:53 AM
bshah updated this revision to Diff 5734.Aug 8 2016, 9:29 AM
bshah marked 4 inline comments as done.
bshah edited edge metadata.

fixed minor coding style issues and make code failsafe

bshah marked an inline comment as done.Aug 8 2016, 9:30 AM

Fixed issues..

This revision was automatically updated to reflect the committed changes.