Introduce EXCLUDE_DEPRECATED_BEFORE_AND_AT
ClosedPublic

Authored by kossebau on May 13 2020, 1:08 PM.

Details

Summary

Not all versions of the past will work as value, mainly to be used with
values "0" or "CURRENT". If any new deprecations are done without
having code starting to use older deprecated API, in the future any
versions >= 5.71.0 should work also reliably.

Currently a build with EXCLUDE_DEPRECATED_BEFORE_AND_AT=CURRENT does
not yet work, some API deprecated is still used internally by
code behind non-deprecated API. Building with CURRENT will show by the
failed build which those are.

Test Plan

Builds with values 0, 5.70.0 (with D29707).

Diff Detail

Repository
R241 KIO
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.May 13 2020, 1:08 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptMay 13 2020, 1:08 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
kossebau requested review of this revision.May 13 2020, 1:08 PM

@dfaure So far I had no idea how to introduce a simple variant of the deprecation macros to support just disabling latest. For one would this make things more complex as there would be yet another approach. And things would be also become a bit unreliable on the library consumer side, as any version-less BUILD_DEPRECATED would no longer be bound to a version and thus to a certain set of API.

And as said in the commit message, the current version-based EXCLUDE_DEPRECATED_BEFORE_AND_AT can also be used with KIO, if we simply just give no guarantee that this works with any version, but only with some, with better chances for future versions (if people now make sure things build without deprecated API and do not reintroduce the use of already deprecated API) :)

Using this patch with EXCLUDE_DEPRECATED_BEFORE_AND_AT=CURRENT shows that there are lots of KRun::run* usages in non-deprecated API sadly in KIO :(

meven accepted this revision.May 13 2020, 1:33 PM

Great stuff, this much less cleanup will be needed for KF6 !

src/core/global.cpp
99

Pretty old deprecation ^^

This revision is now accepted and ready to land.May 13 2020, 1:33 PM

there are lots of KRun::run* usages in non-deprecated API sadly in KIO :(

OK, I'll fix that.

This revision was automatically updated to reflect the committed changes.