Use ECMGenerateExportHeader to manage deprecated API better
ClosedPublic

Authored by kossebau on Oct 15 2019, 1:01 PM.

Details

Summary

Allows

  • projects linking to KWayland to hide deprecated API up to a given version or silence deprecation warnings after a given version, using
    • -DKWAYLAND_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKWAYLAND_NO_DEPRECATED
    • -DKWAYLAND_DEPRECATED_WARNINGS_SINCE
    • -DKWAYLAND_NO_DEPRECATED_WARNINGS

      or
    • -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT
    • -DKF_NO_DEPRECATED
    • -DKF_DEPRECATED_WARNINGS_SINCE
    • -DKF_NO_DEPRECATED_WARNINGS

No support for "EXCLUDE_DEPRECATED_BEFORE_AND_AT", needs to be done by
someone with detailed knowledge about disabling implementation, if wanted.

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Oct 15 2019, 1:01 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptOct 15 2019, 1:01 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.Oct 15 2019, 1:01 PM
zzag added a subscriber: zzag.Oct 16 2019, 8:33 AM
zzag added inline comments.
src/server/plasmawindowmanagement_interface.cpp
741

Hmm, PlasmaWindowInterface::setVirtualDesktop is wrapped in KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE in the header file.

Is there a reason not to use KWAYLANDSERVER_BUILD_DEPRECATED_SINCE here?

zzag edited reviewers, added: KWin; removed: Plasma.Oct 16 2019, 8:35 AM
kossebau added inline comments.Oct 16 2019, 2:00 PM
src/server/plasmawindowmanagement_interface.cpp
741

KWAYLANDSERVER_BUILD_DEPRECATED_SINCE are not available yet, cmp the comment in the commit message:
"No support for "EXCLUDE_DEPRECATED_BEFORE_AND_AT", needs to be done by
someone with detailed knowledge about disabling implementation, if wanted."

I tried to add it, but too much API got deprecated yet still kept being used internally. So a version-levelled disabling of implementation is not yet possible, first needs more cleanup of the internal usages.

@zzag Hi. Any chance you can have time to review this today/the WE? One of the last ECMGenerateExportHeader patches.

I would be happy if we could have all in ASAP so we can enable the KF_* macros and test them in git master for two weeks before 5.64 gets tagged for release.

Reviewed myself once more and will be pushing now, given this is fairly straightforward after all, so the KF_* flags can be enabled next.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 20 2019, 1:25 AM
This revision was automatically updated to reflect the committed changes.
romangg added a subscriber: romangg.EditedOct 20 2019, 6:16 PM

It's ok that you pushed. Can you give a link to your preferred resource for me to read up on ECMGenerateExportHeader? Not too comprehensive if possible.

kossebau added a comment.EditedOct 20 2019, 6:40 PM

It's ok that you pushed. Can you give a link to your preferred resource for me to read up on ECMGenerateExportHeader? Not too comprehensive if possible.

For one there are the API docs at https://api.kde.org/ecm/module/ECMGenerateExportHeader.html

For the bigger picture, please see T11490 (also cmp. https://mail.kde.org/pipermail/kde-frameworks-devel/2019-October/094708.html)

Edit: and now that all patches have landed, a summary email should arrive tonight/tomorrow in main KDE mailinglists, currently still in draft.

Edit 2; ah, missed the "Not too comprehensive". Well, it's complicated, but the linked email to frameworks-devel might be most "not too comprehensive" ;)

zzag added a comment.Oct 21 2019, 9:09 AM

@zzag Hi. Any chance you can have time to review this today/the WE? One of the last ECMGenerateExportHeader patches.

Hi, sorry for the late response. Yes, I think this change is/was good to go.