[Bug?] batterymonitor applet cannot detect TLP

Hi~ :wave:
I upgraded to Plasma 6.2.3 today. :sparkles:
I notice a MR seems break TLP detection feature.

After some digging, I notice a changed function.
Function isTlpInstalled() is replaced by setTlpInstalled(bool installed)
but READ function binding of property isTlpInstalled remained default as shown below.

Q_PROPERTY(bool isTlpInstalled READ default NOTIFY isTlpInstallChanged BINDABLE bindableIsTlpInstalled)

Is this Okay? I’m a C beginner, not know Cpp well.
I’m guessing “READ default” mean reading from the function with the same name as property.

then there is a missing function

bool PowerProfilesControl::isTlpInstalled()
{
    return m_isTlpInstalled;
}

to make it work.

After looking into diff, Maybe MĂ©ven reuse that function and forgot this. :joy:
(BTW, really appreciate his effort to make powerdevil better. :heart: )

Is my guessing right? :face_with_monocle:
If I’m guessing right, then I will have the courage to learn some C++. :wink: :smiling_face:
@meven

That’s @jpetso that deserves most of the credit :slight_smile: not me @meven .

This wouldn’t compile if the function was not present in the first place.
The function is generated by macro Q_OBJECT_BINDABLE_PROPERTY_WITH_ARGS in the header code.

Please report a bug.
Sorry I broke that, I missed it, it shouldn’t have but…
Found the bug origin.

It’s absolutely fine, you deserve praise. Your code accomplishes what jpetso’s code was meant to do. This is just a minor issue. That tlp detection is just to dismiss the alert user ppd not installed.
Not to mention, I also learned some knowledge in the process.

I’m not sure this is a bug or my misconfiguration. So I post here waiting someone to reproduce it. And feeling a bit apprehensive about using Bugzilla.
LOL

Found the bug origin.

I tell you this is a bug.

I don’t understand this. Sure it is dated and clunky but very much functional and essential.
You spent some time looking at code and form filing is scary to you :face_with_raised_eyebrow:

I may have a MR opened but this won’t let others know it is already reported and which versions it affects.

I just encourage you, it is up to everybody to do their part or not.

You are right. Everthing need one step first. I prefer ask for help here maybe because I can modify the comment because of my poor English lol.
filled:495918 – batterymonitor applet cannot detect TLP

2 Likes