psifidotos / applet-window-buttons

Plasma 5 applet in order to show window buttons in your panels
GNU General Public License v2.0
404 stars 55 forks source link

Fix for KDE Plasma 5.18 #82

Closed rodrigopedra closed 4 years ago

rodrigopedra commented 4 years ago

As noted in issues #81 and #80 this applet stopped working when updating to KDE Plasma 5.18 as some dependencies were updated too.

This PR does the following changes:

Applying those fixes allows the project to build and the applet works as expected.

I am running a default installation of KDE Neon 5.18 with the stock Breeze Theme. The applet is added to a Latte-dock panel.

Please do not install from my fork as if this PR is merged I might delete it.

@psifidotos there are many years since I last touched any C++ code and I never worked with Qt/QML before. I guided my fixes from the errors messages when trying to build and used the CLion IDE to help finding the dependencies. If there are any changes you want me to make to this PR, I'll be glad to help.

rodrigopedra commented 4 years ago

Hi @psifidotos

As noted in your comment here: https://github.com/psifidotos/applet-window-buttons/issues/78#issuecomment-580296358

I added some compilation directives (#if) to check for the KDecoration2 library version. I haven't seen it before.

Also let me take the chance to thank you for the great libraries you contributed to the community.

rodrigopedra commented 4 years ago

Hi again,

Inspired by my last commit I added a compilation check for using the deprecated method replacement.

Cleaned the build and installed again and it is working as expected. I hope with these last commits it does not break on previous installations.

enriquezmark36 commented 4 years ago

I'd like to ask something about the KDECORATION2_VERSION_MINOR check.

If the commit regarding the new size() method is what introduced this problem, wouldn't it be better to check for that SOVERSION bump that the commit did or should this check suffice.

Though to be honest, I have no idea if that's even possible or not in CMake. Thanks.

rodrigopedra commented 4 years ago

Hi @enriquezmark36 , from my memories on coding C++ I remember the #if and other macros/directives were checked during compilation/build time, so they would work depending on the .so the user have installed during compilation/build time.

From what I understand, your suggestion would be a dynamic check for the available .so version, as, theoretically, an user could change the installed .so version. I don't know if this is possible, at least I don know how to do it.

enriquezmark36 commented 4 years ago

Thanks for the info, @rodrigopedra . I guess I need to upgrade my system (5.17.90->5.18) once more so that KDECORATION2_VERSION_MINOR will become 18. Right now in my system, it is 17 yet I am having those compilation errors.

rodrigopedra commented 4 years ago

Actually it seems size() was added starting in the 5.18

With the #if I meant to check if the version is greater or equal to that

Thanks for the merge