From 044acd9591dbdc706710130742b589eede384e4c Mon Sep 17 00:00:00 2001 From: Michael Jansen Date: Thu, 10 Sep 2009 00:24:41 +0000 Subject: [PATCH] HINT: It's not the right way to call forgetGlobalShortcut just because you want to set a new global shortcut for a action. Have a look at the parameters of setGlobalShortcut() The method is now only called for newly created actions. No need to overwrite existing shortcuts. Step 2 will follow with next commit. svn path=/trunk/KDE/kdebase/workspace/; revision=1021773 --- kcmkwin/kwindesktop/main.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/kcmkwin/kwindesktop/main.cpp b/kcmkwin/kwindesktop/main.cpp index 665ffdbd52..ecdc9a20c3 100644 --- a/kcmkwin/kwindesktop/main.cpp +++ b/kcmkwin/kwindesktop/main.cpp @@ -450,25 +450,17 @@ void KWinDesktopConfig::slotChangeShortcuts( int number ) else { KShortcut shortcut(shortcutString); - if (sender()) - action->forgetGlobalShortcut(); if (KGlobalAccel::self()->isGlobalShortcutAvailable(shortcut.primary())) { action->setGlobalShortcut( shortcut ); - if (sender()) - { - m_ui->messageLabel->setText(i18n( "Assigned global Shortcut \"%1\" to Desktop %2", shortcutString, desktop )); - m_ui->messageLabel->show(); - } + m_ui->messageLabel->setText(i18n( "Assigned global Shortcut \"%1\" to Desktop %2", shortcutString, desktop )); + m_ui->messageLabel->show(); } else { action->setGlobalShortcut( KShortcut(), KAction::ActiveShortcut ); - if (sender()) - { - m_ui->messageLabel->setText(i18n( "Shortcut conflict: Could not set Shortcut %1 for Desktop %2", shortcutString, desktop )); - m_ui->messageLabel->show(); - } + m_ui->messageLabel->setText(i18n( "Shortcut conflict: Could not set Shortcut %1 for Desktop %2", shortcutString, desktop )); + m_ui->messageLabel->show(); } } }