D29281: Deprecate defunct functions

Friedrich W. H. Kossebau noreply at phabricator.kde.org
Wed Apr 29 19:55:13 BST 2020


kossebau added a comment.


  Looks good, almost :) It's a bit complicated on first use (well, also still ater, but no better solution was found to get version-controlled API deprecation with C++ for now).

INLINE COMMENTS

> abstractrunner.cpp:221
>  
>  void AbstractRunner::createRunOptions(QWidget *parent)
>  {

Given EXCLUDE_DEPRECATED_BEFORE_AND_AT is used with KRunner, you want to also wrap all the implementations of the now deprecated API with the BUILD variant of the macro, so here for example:

  #if KRUNNER_BUILD_DEPRECATED_SINCE(5, 70)
  void AbstractRunner::createRunOptions(QWidget *parent)
  {
      [...]
  }
  #endif

This allows to build KRunner itself without any of the deprecated API actually part of the build.
Test yourself by setting the cmake var EXCLUDE_DEPRECATED_BEFORE_AND_AT=CURRENT  (e.g. edit the var in the cmake cache).

> abstractrunner.h:154
>           * is called, the runner should return true
> +         * @deprecated since 5.70, feature removed since version 5.0
>           */

The text in the API dox can stay "Since 5.0".

The only crititical thing where the number of an older, already released version should not be used is the KRUNNER_ENABLE_DEPRECATED_SINCE macro. Because that reacts to KF_DISABLE_DEPRECATED_BEFORE_AND_AT (or KRUNNER_DISABLE_DEPRECATED_BEFORE_AND_AT if set). And someone using, say KF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x050000 in their projects because they checked their software and it has not used any deprecated API up to that version, and who still uses this newly deprecated API, would suddenly get no longer building software, which especially is annoying with already released code.

So: when retroactively tagging deprecated API, in the API dox text mention the correct version where actual deprecation happened, in the macros the version of the upcoming release where the deprecation macros are first existing for API users. Makes sense?

REPOSITORY
  R308 KRunner

REVISION DETAIL
  https://phabricator.kde.org/D29281

To: alex, #plasma, broulik, davidedmundson, vkrause
Cc: kossebau, kde-frameworks-devel, LeGast00n, cblack, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200429/a4ec7c1a/attachment.html>


More information about the Kde-frameworks-devel mailing list