From 24e0799ccc85967d958b1de706186ec154f64226 Mon Sep 17 00:00:00 2001 From: David Redondo Date: Fri, 22 May 2020 22:54:17 +0200 Subject: Add KStandardShortcut::findByName(const QString&) and deprecate find(const char*) KStandardShortcut::name returns a QString, this makes the api symmetric and more straightforward to use. --- src/gui/kstandardshortcut.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/gui/kstandardshortcut.h') diff --git a/src/gui/kstandardshortcut.h b/src/gui/kstandardshortcut.h index 69feee61..cda9fe96 100644 --- a/src/gui/kstandardshortcut.h +++ b/src/gui/kstandardshortcut.h @@ -186,6 +186,7 @@ KCONFIGGUI_EXPORT QString whatsThis(StandardShortcut id); */ KCONFIGGUI_EXPORT StandardShortcut find(const QKeySequence &keySeq); +#if KCONFIGGUI_ENABLE_DEPRECATED_SINCE(5, 71) /** * Return the StandardShortcut id of the standard accel action which * has \a keyName as its name, or AccelNone if none of them do. @@ -193,8 +194,21 @@ KCONFIGGUI_EXPORT StandardShortcut find(const QKeySequence &keySeq); * @param keyName the key sequence to search * @return the id of the standard accelerator, or AccelNone if there * is none + * @deprecated since 5.71, use findByName(const QString &name) instead */ +KCONFIGGUI_DEPRECATED_VERSION(5, 71, "Use findByName(const QString &name) instead") KCONFIGGUI_EXPORT StandardShortcut find(const char *keyName); +#endif + +/** + * Return the StandardShortcut id of the standard accelerator action which + * has \p name as its name, or AccelNone if none of them do. + * @param name the name as returned by name(StandardShortcut id) + * @return the id of the standard accelerator with the given name or AccelNone + * if there is no such accelerator + * @since 5.71 + */ +KCONFIGGUI_EXPORT StandardShortcut findByName(const QString &name); /** * Returns the hardcoded default shortcut for @p id. -- cgit v1.2.1