Bug 308292

Summary: initial config creation is bogus
Product: [Frameworks and Libraries] solid Reporter: Harald Sitter <sitter>
Component: powermanagement-daemonAssignee: Dario Freddi <drf>
Status: RESOLVED FIXED    
Severity: major CC: afiestas
Priority: NOR    
Version: 4.9.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

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 !