Bug 308292 - initial config creation is bogus
Summary: initial config creation is bogus
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Frameworks and Libraries
Component: powermanagement-daemon (show other bugs)
Version: 4.9.2
Platform: Ubuntu Linux
: NOR major
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-12 12:56 UTC by Harald Sitter
Modified: 2013-03-12 13:03 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Sitter 2012-10-12 12:56:28 UTC
In powerdevilprofilegenerator.cpp we can find the following

        QSet< Solid::PowerManagement::SleepState > methods = Solid::PowerManagement::supportedSleepStates();

       //...

        KConfigGroup handleButtonEvents(&acProfile, "HandleButtonEvents");
        handleButtonEvents.writeEntry< uint >("powerButtonAction", LogoutDialogMode);
        if (methods.contains(Solid::PowerManagement::SuspendState)) {
            handleButtonEvents.writeEntry< uint >("lidAction", ToRamMode);
        } else {
            handleButtonEvents.writeEntry< uint >("lidAction", TurnOffScreenMode);
        }

Now on Kubuntu 12.10 the contains() query is always false thus the lidaction is turn off screen. However it should not be false because...

me@novalis:~$ qdbus org.freedesktop.PowerManagement /org/freedesktop/PowerManagement org.freedesktop.PowerManagement.CanSuspend
true

solid::powermanagement uses the same dbus interface to get its information, so one gets to wonder why it works for me and not for solid.... turns out that this interface is provided by the very same daemon that creates the config (why that does not sound dangerous at all :S). My assumption at present is that either the initialization order is wrong (i.e. the config is created before the interface) or the upower code is bogus (race condition in init or something).


Reproducible: Always
Comment 1 Alex Fiestas 2013-03-12 13:03:45 UTC
I fixed this, in 4.10 for sure and also in 4.9, perhaps in 4.9.4

Thanks for reporting !