diff options
author | David Redondo <kde@david-redondo.de> | 2020-05-22 22:54:17 +0200 |
---|---|---|
committer | David Redondo <kde@david-redondo.de> | 2020-05-23 09:30:05 +0200 |
commit | 24e0799ccc85967d958b1de706186ec154f64226 (patch) | |
tree | 1461a6cf23e816cea8e4c3e3a331ef842df74a23 /autotests/kstandardshortcuttest.cpp | |
parent | 9bbf7cf53f573fa48f4bddd9b632cfba7171914d (diff) | |
download | kconfig-24e0799ccc85967d958b1de706186ec154f64226.tar.gz kconfig-24e0799ccc85967d958b1de706186ec154f64226.tar.bz2 |
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.
Diffstat (limited to 'autotests/kstandardshortcuttest.cpp')
-rw-r--r-- | autotests/kstandardshortcuttest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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<KStandardShortcut::StandardShortcut>(i); + QCOMPARE(id, KStandardShortcut::findByName(KStandardShortcut::name(id))); + } +} |