| 1 | // SPDX-FileCopyrightText: 2024 Carl Schwan <carl@carlschwan.eu> |
| 2 | // SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 | |
| 4 | #include "actionhelper.h" |
| 5 | |
| 6 | ActionHelper::ActionHelper(QObject *parent) |
| 7 | : QObject(parent) |
| 8 | { |
| 9 | } |
| 10 | |
| 11 | QString ActionHelper::iconName(const QIcon &icon) const |
| 12 | { |
| 13 | return icon.name(); |
| 14 | } |
| 15 | |
| 16 | QList<QKeySequence> ActionHelper::alternateShortcuts(QAction *action) const |
| 17 | { |
| 18 | if (!action || action->shortcuts().length() <= 1) { |
| 19 | return {}; |
| 20 | } else { |
| 21 | return action->shortcuts().mid(pos: 1); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | #include "moc_actionhelper.cpp" |
| 26 | |