Bug 421660 - PowerManagementInterface printing incessantly about non-existent service
Summary: PowerManagementInterface printing incessantly about non-existent service
Status: RESOLVED FIXED
Alias: None
Product: Elisa
Classification: Applications
Component: general (other bugs)
Version First Reported In: 20.04.1
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: ---
Assignee: Matthieu Gallien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-17 04:51 UTC by Gabriel Marcano
Modified: 2021-01-14 23:11 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Marcano 2020-05-17 04:51:41 UTC
SUMMARY

Poking around at the code, in src/powermanagementinterface.cpp, in the function PowerManagementInterface::setPreventSleep, I see checks for management the inhibition state for both Plasma and Gnome are always called. On my system, that only has Plasma, this leads to spam on the console whenever music is played, specifically:

PowerManagementInterface::inhibitDBusCallFinishedGnomeWorkspace QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.gnome.SessionManager was not provided by any .service files")


STEPS TO REPRODUCE
1. Have a Linux distro with either Plasma or Gnome installed (not both?)
2. Run Elisa
3. Play a file/music archive

OBSERVED RESULT

PowerManagementInterface::inhibitDBusCallFinishedGnomeWorkspace QDBusError("org.freedesktop.DBus.Error.ServiceUnknown", "The name org.gnome.SessionManager was not provided by any .service files")

is printed in the console.

EXPECTED RESULT

No error messages displayed due to non-existent D-Bus service on a computer without said service installed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Gentoo, Plasma
(available in About System)
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.70.0
Qt Version: 5.14.2

ADDITIONAL INFORMATION

There are a couple ways to fix this-- one is to remove the qDebug statement, or somehow hide it (I'm unfamiliar with verbosity levels in Qt/KDE). Another is to detect the existence of services in PowerManagementInterface initialization, and only call inhibitor functions of the services found.
Comment 1 Nate Graham 2020-06-10 20:48:00 UTC
Patches welcome. :)

https://invent.kde.org/multimedia/elisa/-/merge_requests

https://community.kde.org/Infrastructure/GitLab

Feel free, we don't bite!
Comment 2 Gabriel Marcano 2020-06-10 22:57:58 UTC
I know, I'd love to offer a patch, but due to IP waiver forms I signed with my employer I can't release code without their consent, even if I develop it on my own time :( This is what happens in the US when there are poor worker protections in place, even for a well paid software engineer.

On the plus side, I'll be going back to grad school come August, so I won't be under said contract limitations then. If no one has provided a patch by then, I'll try making one.
Comment 3 Bug Janitor Service 2021-01-10 21:58:49 UTC
A possibly relevant merge request was started @ https://invent.kde.org/multimedia/elisa/-/merge_requests/209
Comment 4 Matthieu Gallien 2021-01-14 23:11:29 UTC
Git commit c2b3d0d312ac20c0aa1a4e7a34a765484c420cc3 by Matthieu Gallien.
Committed on 14/01/2021 at 21:59.
Pushed by mgallien into branch 'release/20.12'.

avoid printing useless logs on console when power management is working

M  +7    -0    src/CMakeLists.txt
M  +6    -4    src/powermanagementinterface.cpp

https://invent.kde.org/multimedia/elisa/commit/c2b3d0d312ac20c0aa1a4e7a34a765484c420cc3