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. --- autotests/kstandardshortcuttest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'autotests/kstandardshortcuttest.cpp') diff --git a/autotests/kstandardshortcuttest.cpp b/autotests/kstandardshortcuttest.cpp index 53a724f9..8c4df027 100644 --- a/autotests/kstandardshortcuttest.cpp +++ b/autotests/kstandardshortcuttest.cpp @@ -44,3 +44,10 @@ void KStandardShortcutTest::testFindStdAccel() QCOMPARE(KStandardShortcut::find(QString("Ctrl+Shift+Alt+G")), KStandardShortcut::AccelNone); } +void KStandardShortcutTest::testFindByName() +{ + for (int i = KStandardShortcut::AccelNone + 1; i < KStandardShortcut::StandardShortcutCount; ++i) { + const auto id = static_cast(i); + QCOMPARE(id, KStandardShortcut::findByName(KStandardShortcut::name(id))); + } +} -- cgit v1.2.1