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

List:       kde-commits
Subject:    KDE/kdelibs/kdeui
From:       Kevin Ottens <ervin () kde ! org>
Date:       2008-01-04 21:40:31
Message-ID: 1199482831.204395.3410.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 757400 by ervin:

Reverting commit 757034 which was completely preventing to configure any
global shortcut. This issue will obviously require more investigation...

OK'd by Tom Albers.

CCMAIL: ahartmetz@gmail.com



 M  +1 -11     actions/kaction.h  
 M  +8 -16     shortcuts/kglobalaccel.cpp  


--- trunk/KDE/kdelibs/kdeui/actions/kaction.h #757399:757400
@@ -341,7 +341,7 @@
      * Unlike regular shortcuts, the application's window does not need focus
      * for them to be activated.
      *
-     * When an action is assigned
+     * When an action, identified by main component name and text(), is assigned
      * a global shortcut for the first time on a KDE installation the assignment will
      * be saved. The shortcut will then be restored every time the action's 
      * globalShortcutAllowed flag becomes true.
@@ -353,16 +353,6 @@
      * setGlobalShortcut(KShortcut(), KAction::ActiveShortcut | KAction::DefaultShortcut,
      *                   KAction::NoAutoloading)
      * \endcode
-     * Note that actions will be recognized by their objectName() internally.
-     * In case of an empty objectName() text() will be used as a fallback.
-     * This fallback should be avoided if possible because it breaks
-     * when the application language is changed.
-     * Inserting an action into a KActionCollection with
-     * QAction *KActionCollection::addAction(const QString &name, QAction *action) or
-     * KAction *KActionCollection::addAction(const QString &name, KAction *action)
-     * will set the objectName() to @p name so you don't have to explicitly set an
-     * objectName after you have already done that.
-
      * \param shortcut global shortcut(s) to assign
      * \param type the type of shortcut to be set, whether the active shortcut, the default shortcut,
      *             or both (the default).
--- trunk/KDE/kdelibs/kdeui/shortcuts/kglobalaccel.cpp #757399:757400
@@ -144,15 +144,11 @@
     if (oldEnabled == newEnabled)
         return;
 
-    QString actionName(action->objectName());
-    if (actionName.isEmpty()) {
-        if (action->text().isEmpty()) {
-            return;
-        }
-        actionName = action->text();    //### breaks badly on change of language
-    }
+    if (action->text().isEmpty())
+        return;
     QStringList actionId(mainComponentName);
-    actionId.append(actionName);
+    actionId.append(action->text());
+    //TODO: what about i18ned names?
 
     if (!oldEnabled && newEnabled) {
         uint setterFlags = KdedGlobalAccel::SetPresent;
@@ -184,15 +180,11 @@
     if (!action)
         return;
 
-    QString actionName(action->objectName());
-    if (actionName.isEmpty()) {
-        if (action->text().isEmpty()) {
-            return;
-        }
-        actionName = action->text();    //### breaks badly on change of language
-    }
+    if (action->text().isEmpty())
+        return;
     QStringList actionId(mainComponentName);
-    actionId.append(actionName);
+    actionId.append(action->text());
+    //TODO: what about i18ned names?
 
     uint setterFlags = 0;
     if (flags & KAction::NoAutoloading)
[prev in list] [next in list] [prev in thread] [next in thread] 

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