Use generated DBus interface
Needs RevisionPublic

Authored by broulik on Apr 18 2019, 9:04 AM.

Details

Reviewers
davidedmundson
bruns
Group Reviewers
Frameworks
Summary

Avoids introspection calls when creating the manager or devices.
Also drop codepath for old UPower, according to their git, the interface hasn't changed since 2015 (that's as far back as the history went, I didn't go any further) so I think it's safe to assume everyone uses an upower version that has this.

Test Plan

Unless that special "last non-systemd version" some distros use is older than this?

  • Plugged in my mouse, showed up, plugged it out, disappeared
  • I shall test with my laptop whether the battery property changes are detected properly

Diff Detail

Repository
R245 Solid
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Apr 18 2019, 9:04 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 18 2019, 9:04 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Apr 18 2019, 9:04 AM
apol added a subscriber: apol.May 22 2019, 6:30 PM

UPower already installs the xml files. Wouldn't it be better to use the installed xml instead of providing our own?

src/solid/devices/backends/upower/upowerdevice.cpp
35

unneeded?

davidedmundson requested changes to this revision.Apr 14 2020, 10:26 AM

We copy udisks xml already. I don't think it ends up any better. Otherwise we have a compile time dep on a runtime plugin, which inevitably means we need to make it optional which only introduces more real-world bugs. It also means future devs know what we were compiled against.

Marking as requesting changes for the extra include, but personally I think it's generally good to go.

This revision now requires changes to proceed.Apr 14 2020, 10:26 AM

We copy udisks xml already. I don't think it ends up any better. Otherwise we have a compile time dep on a runtime plugin, which inevitably means we need to make it optional which only introduces more real-world bugs. It also means future devs know what we were compiled against.

Marking as requesting changes for the extra include, but personally I think it's generally good to go.

We are also already copying part of the interface specification. After all, indexOfSignal("DeviceAdded(QDBusObjectPath)") is the same as the corresponding code generated by dbusxml2cpp.

Two more change requests:

  • Please mention support for the deprecated DeviceAdded(string) (upower < 0.99) is removed
  • Please wrap long lines in the summary etc.