kwin/kconf_update/kwin-6.0-delete-desktop-switching-shortcuts.cpp
Nicolas Fella afa450b97a Set componentDisplayName for shortcut migration
Otherwise the binary name is used as display name, causing all kwin
shortcuts to be registered under kwin-6.0-delete-desktop-switching-shortcuts
2024-02-20 11:22:11 +00:00

34 lines
996 B
C++

/*
SPDX-FileCopyrightText: 2023 Marco Martin <mart@kde.org>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <KGlobalAccel>
#include <QAction>
#include <QGuiApplication>
#include <QStandardPaths>
int main(int argc, char **argv)
{
QGuiApplication app(argc, argv);
const QStringList actionNames{
QStringLiteral("Walk Through Desktops"),
QStringLiteral("Walk Through Desktops (Reverse)"),
QStringLiteral("Walk Through Desktop List"),
QStringLiteral("Walk Through Desktop List (Reverse)"),
};
for (const QString &actionName : actionNames) {
QAction action;
action.setObjectName(actionName);
action.setProperty("componentName", QStringLiteral("kwin"));
action.setProperty("componentDisplayName", QStringLiteral("KWin"));
KGlobalAccel::self()->setShortcut(&action, {QKeySequence()}, KGlobalAccel::NoAutoloading);
KGlobalAccel::self()->removeAllShortcuts(&action);
}
return 0;
}