branches/KDE/4.0/kdelibs/kdeui

Kevin Ottens ervin at kde.org
Fri Jan 4 22:43:23 CET 2008


SVN commit 757402 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.

We probably want that hotfix in the 4.0.0 tag. Otherwise we're shipping
a desktop where we can't configure the desktop related (kwin, krunner,
plasma) shortcuts and any other global shortcuts.
Dirk, any chance to get that in the release?

CCMAIL: ahartmetz at gmail.com
CCMAIL: release-team at kde.org



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


--- branches/KDE/4.0/kdelibs/kdeui/actions/kaction.h #757401:757402
@@ -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).
--- branches/KDE/4.0/kdelibs/kdeui/shortcuts/kglobalaccel.cpp #757401:757402
@@ -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)


More information about the release-team mailing list