mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-23 18:32:50 +00:00
kwin: KWin::Workspace::clientShortcutUpdated() optimization
KActionCollection::action() method takes QString as argument thus the conversion to latin1 and then to char array would generate code path such that QString would have to be constructed again.. Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
5ce06c488b
commit
cca70e0412
1 changed files with 3 additions and 3 deletions
|
@ -874,11 +874,11 @@ void Workspace::setupWindowShortcutDone(bool ok)
|
|||
|
||||
void Workspace::clientShortcutUpdated(Client* c)
|
||||
{
|
||||
QString key = QString("_k_session:%1").arg(c->window());
|
||||
QAction* action = client_keys->action(key.toLatin1().constData());
|
||||
QString key = QString::fromLatin1("_k_session:%1").arg(c->window());
|
||||
QAction* action = client_keys->action(key);
|
||||
if (!c->shortcut().isEmpty()) {
|
||||
if (action == NULL) { // new shortcut
|
||||
action = client_keys->addAction(QString(key));
|
||||
action = client_keys->addAction(key);
|
||||
action->setText(i18n("Activate Window (%1)", c->caption()));
|
||||
connect(action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue