[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin
From:       Michael Jansen <kde () michael-jansen ! biz>
Date:       2008-09-30 20:44:43
Message-ID: 1222807483.187650.5686.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 866436 by mjansen:

- Correct key usage.
- Forget global shortcut

 M  +14 -7     useractions.cpp  


--- trunk/KDE/kdebase/workspace/kwin/useractions.cpp #866435:866436
@@ -410,24 +410,31 @@
 
 void Workspace::clientShortcutUpdated( Client* c )
     {
-    QString key = QString::number( c->window());
+    QString key = QString( "_k_session:%1" ).arg(c->window());
     QAction* action = client_keys->action( key.toLatin1().constData() );
     if( !c->shortcut().isEmpty())
         {
         if( action == NULL ) // new shortcut
             {
-            action = client_keys->addAction(QString("session:clientShortcut %1").arg(key));
-            action->setText(i18n("Activate Window (%1)", c->caption()));
-            connect( action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()));
+            action = client_keys->addAction(QString( key ));
+            action->setText( i18n("Activate Window (%1)", c->caption()) );
+            connect( action, SIGNAL(triggered(bool)), c, SLOT(shortcutActivated()) );
             }
+
+        KAction *kaction = qobject_cast<KAction*>( action );
         // no autoloading, since it's configured explicitly here and is not meant to be reused
         // (the key is the window id anyway, which is kind of random)
-        qobject_cast< KAction* >( action )->setGlobalShortcut(
-            c->shortcut(), KAction::ActiveShortcut, KAction::NoAutoloading );
-        action->setEnabled( true );
+        kaction->setGlobalShortcut(
+                c->shortcut(), KAction::ActiveShortcut, KAction::NoAutoloading );
+        kaction->setEnabled( true );
         }
     else
         {
+        KAction *kaction = qobject_cast<KAction*>( action );
+        if( kaction )
+            {
+            kaction->forgetGlobalShortcut();
+            }
         delete action;
         }
     }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic