https://bugs.kde.org/show_bug.cgi?id=410110

Nate Graham <n...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Latest Commit|https://invent.kde.org/mult |https://invent.kde.org/mult
                   |imedia/elisa/commit/904dc9f |imedia/elisa/commit/fd858ca
                   |bdb007b3690dd58d77307679811 |f0e780f74275c56f4083517ef9e
                   |256f3c                      |8056b4
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #37 from Nate Graham <n...@kde.org> ---
Git commit fd858caf0e780f74275c56f4083517ef9e8056b4 by Nate Graham, on behalf
of Olivier Trichet.
Committed on 08/03/2022 at 23:08.
Pushed by ngraham into branch 'master'.

Fix shortcut not working under non English locale

This change wraps calls to QAction::shortcut() done in QML files
to use the portable representation of QKeySequence.

The QKeySequence to QVariant operator return a string
representation using the native format not the portable format.
E.g., the sequence "Space", will be "Espace" under French locale.
The 'shortcut' attribute of QtQuick Action is stored as QVariant.
In qml file, when the QAction::shortcut() value (a QKeySequence)
is affected to a QtQuick Action shortcut, the previous operator is
used and the shortcut value may be bogus depending on translation.

    // A QAction* with the Qt::Key_Space shortcut
    property var playPauseAction: ElisaApplication.action("Play-Pause")
    Action {
        // - playPauseAction.shortcut returns QKeySequence(Qt::Key_Space).
        // - QKeySequence(Qt::Key_Space) is transform into a QVariant that
        //        contains native text "Espace".
        // - this QVariant is affected to shortcut: broken.
        shortcut: playPauseAction.shortcut
        onTriggered: ElisaApplication.audioControl.playPause()
    }
Related: bug 424890

M  +6    -0    src/elisaapplication.cpp
M  +1    -0    src/elisaapplication.h
M  +6    -6    src/qml/ApplicationMenu.qml
M  +8    -8    src/qml/ElisaMainWindow.qml
M  +1    -1    src/qml/MediaPlayerControl.qml
M  +1    -1    src/qml/NativeMenuItemFromAction.qml
M  +7    -7    src/qml/NativeTrayMenu.qml

https://invent.kde.org/multimedia/elisa/commit/fd858caf0e780f74275c56f4083517ef9e8056b4

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to