kwin: prepare for KAction changes

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2024-04-22 02:48:39 +03:00
parent 4170541c02
commit 5fa76ea4e7
4 changed files with 8 additions and 7 deletions

View file

@ -108,7 +108,7 @@ void TrackMouseEffectConfig::defaults()
void TrackMouseEffectConfig::shortcutChanged(const QKeySequence &seq)
{
if (KAction *a = qobject_cast<KAction*>(m_actionCollection->action("TrackMouse")))
a->setGlobalShortcut(KShortcut(seq), KAction::ActiveShortcut, KAction::NoAutoloading);
a->setGlobalShortcut(KShortcut(seq), KAction::ActiveShortcut);
// m_actionCollection->writeSettings();
emit changed(true);
}

View file

@ -270,7 +270,7 @@ void KWinCompositingConfig::alignGuiToCompositingType(int compositingType)
void KWinCompositingConfig::toggleEffectShortcutChanged(const QKeySequence &seq)
{
if (KAction *a = qobject_cast<KAction*>(m_actionCollection->action("Suspend Compositing")))
a->setGlobalShortcut(KShortcut(seq), KAction::ActiveShortcut, KAction::NoAutoloading);
a->setGlobalShortcut(KShortcut(seq), KAction::ActiveShortcut);
m_actionCollection->writeSettings();
}

View file

@ -403,8 +403,8 @@ void KWinDesktopConfig::slotChangeShortcuts(int number)
// Remove any associated global shortcut. Set it to ""
a->setGlobalShortcut(
KShortcut(),
KAction::ActiveShortcut,
KAction::NoAutoloading);
KAction::ActiveShortcut
);
m_ui->messageLabel->hide();
delete a;
} else {
@ -421,7 +421,7 @@ void KWinDesktopConfig::slotChangeShortcuts(int number)
} else {
KShortcut shortcut(shortcutString);
if (!shortcut.primary().isEmpty() || KGlobalAccel::self()->isGlobalShortcutAvailable(shortcut.primary())) {
action->setGlobalShortcut(shortcut, KAction::ActiveShortcut, KAction::NoAutoloading);
action->setGlobalShortcut(shortcut, KAction::ActiveShortcut);
m_ui->messageLabel->setText(i18n("Assigned global Shortcut \"%1\" to Desktop %2", shortcutString, desktop));
m_ui->messageLabel->show();
} else {

View file

@ -869,10 +869,11 @@ void Workspace::clientShortcutUpdated(Client* c)
}
KAction *kaction = qobject_cast<KAction*>(action);
// no autoloading, since it's configured explicitly here and is not meant to be reused
// it's configured explicitly here and is not meant to be reused
// (the key is the window id anyway, which is kind of random)
kaction->setGlobalShortcut(
c->shortcut(), KAction::ActiveShortcut, KAction::NoAutoloading);
c->shortcut(), KAction::ActiveShortcut
);
kaction->setEnabled(true);
} else {
KAction *kaction = qobject_cast<KAction*>(action);