From fb37084b3e7c396cd10bf4d3253fee730320988a Mon Sep 17 00:00:00 2001 From: "Friedrich W. H. Kossebau" Date: Tue, 8 Oct 2019 15:22:49 +0200 Subject: Use ECMGenerateExportHeader to manage deprecated API better Summary: Allows * projects linking to KConfigCore/Gui to hide deprecated API up to a given version or silence deprecation warnings after a given version, using * -DKCONFIGCORE_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKCONFIGCORE_NO_DEPRECATED * -DKCONFIGCORE_DEPRECATED_WARNINGS_SINCE * -DKCONFIGCORE_NO_DEPRECATED_WARNINGS * -DKCONFIGGUI_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKCONFIGGUI_NO_DEPRECATED * -DKCONFIGGUI_DEPRECATED_WARNINGS_SINCE * -DKCONFIGGUI_NO_DEPRECATED_WARNINGS or * -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT * -DKF_NO_DEPRECATED * -DKF_DEPRECATED_WARNINGS_SINCE * -DKF_NO_DEPRECATED_WARNINGS * to build KConfigCore/Gui optionally with deprecated API excluded from the build, using "EXCLUDE_DEPRECATED_BEFORE_AND_AT" cmake argument. Test Plan: Builds with EXCLUDE_DEPRECATED_BEFORE_AND_AT set to 0, 4.0.0, 5.0.0, 5.11.0, 5.24.0, 5.39.0, 5.42.0, CURRENT. Reviewers: #frameworks, mlaurent Reviewed By: mlaurent Subscribers: mlaurent, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D24496 --- src/core/kconfig.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/core/kconfig.h') diff --git a/src/core/kconfig.h b/src/core/kconfig.h index b771b881..db4fb905 100644 --- a/src/core/kconfig.h +++ b/src/core/kconfig.h @@ -324,29 +324,29 @@ public: /// @} /// @{ global +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** - * @deprecated - * * Forces all following write-operations to be performed on @c kdeglobals, * independent of the @c Global flag in writeEntry(). * * @param force true to force writing to kdeglobals * @see forceGlobal + * @deprecated Since 4.0 */ -#ifndef KDE_NO_DEPRECATED - KCONFIGCORE_DEPRECATED void setForceGlobal(bool force); + KCONFIGCORE_DEPRECATED_VERSION(4, 0, "Not recommended") + void setForceGlobal(bool force); #endif + +#if KCONFIGCORE_ENABLE_DEPRECATED_SINCE(4, 0) /** - * @deprecated - * * Returns whether all entries are being written to @c kdeglobals. * * @return @c true if all entries are being written to @c kdeglobals * @see setForceGlobal - * @deprecated + * @deprecated Since 4.0 */ -#ifndef KDE_NO_DEPRECATED - KCONFIGCORE_DEPRECATED bool forceGlobal() const; + KCONFIGCORE_DEPRECATED_VERSION(4, 0, "Not recommended") + bool forceGlobal() const; #endif /// @} -- cgit v1.2.1