From b566ff96512b6ead8b11a20e23cc87bc80d72e75 Mon Sep 17 00:00:00 2001 From: Elvis Angelaccio Date: Sat, 2 Jul 2016 11:01:47 +0200 Subject: Deprecate authorizeKAction() in favor of authorizeAction() REVIEW: 128023 --- src/core/kauthorized.h | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) (limited to 'src/core/kauthorized.h') diff --git a/src/core/kauthorized.h b/src/core/kauthorized.h index d0988234..584bac1a 100644 --- a/src/core/kauthorized.h +++ b/src/core/kauthorized.h @@ -69,6 +69,33 @@ namespace KAuthorized */ KCONFIGCORE_EXPORT bool authorize(const QString &action); +/** + * Returns whether the user is permitted to perform a certain action. + * + * This behaves like authorize(), except that "action/" is prepended to + * @p action. So if kdeglobals contains + * @verbatim + [KDE Action Restrictions][$i] + action/file_new=false + @endverbatim + * then + * @code + * KAuthorized::authorizeAction("file_new"); + * @endcode + * will return @c false. + * + * KXMLGui-based applications should not normally need to call this + * function, as KActionCollection will do it automatically. + * + * @param action The name of a QAction action. + * @return @c true if the QAction is authorized, @c false + * otherwise. + * @since 5.24 + * + * @see authorize() + */ +KCONFIGCORE_EXPORT bool authorizeAction(const QString &action); + /** * Returns whether the user is permitted to perform a certain action. * @@ -92,8 +119,11 @@ KCONFIGCORE_EXPORT bool authorize(const QString &action); * otherwise. * * @see authorize() + * @deprecated Use authorizeAction() instead. */ -KCONFIGCORE_EXPORT bool authorizeKAction(const QString &action); +#ifndef KDE_NO_DEPRECATED +KCONFIGCORE_DEPRECATED bool authorizeKAction(const QString &action); +#endif /** * Returns whether the user is permitted to use a certain control -- cgit v1.2.1