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
This commit is contained in:
Michael Jansen 2009-09-10 00:24:41 +00:00
parent f37efe22c9
commit 044acd9591

View file

@ -450,25 +450,17 @@ void KWinDesktopConfig::slotChangeShortcuts( int number )
else else
{ {
KShortcut shortcut(shortcutString); KShortcut shortcut(shortcutString);
if (sender())
action->forgetGlobalShortcut();
if (KGlobalAccel::self()->isGlobalShortcutAvailable(shortcut.primary())) if (KGlobalAccel::self()->isGlobalShortcutAvailable(shortcut.primary()))
{ {
action->setGlobalShortcut( shortcut ); 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 else
{ {
action->setGlobalShortcut( KShortcut(), KAction::ActiveShortcut ); 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();
}
} }
} }
} }