summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qsoftkeymanager.cpp
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-09-28 09:54:06 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-09-28 10:04:18 (GMT)
commitc912b0234ead0e35a969b5600a61c77b60e18aa6 (patch)
tree402e36ab7fc51708682f248887275aa52825b86d /src/gui/kernel/qsoftkeymanager.cpp
parentf8188b14493eb3d01263be5fef4ea086d3a542a0 (diff)
downloadQt-c912b0234ead0e35a969b5600a61c77b60e18aa6.zip
Qt-c912b0234ead0e35a969b5600a61c77b60e18aa6.tar.gz
Qt-c912b0234ead0e35a969b5600a61c77b60e18aa6.tar.bz2
Make sure the correct soft key is triggered.
In cases where there are both softkey actions as well as "normal" actions, we need to be sure to skip over the none softkey actions since they should not be a part of the softkey framework and the 'index' will be out of sync. Reviewed-by: Sami Merila
Diffstat (limited to 'src/gui/kernel/qsoftkeymanager.cpp')
-rw-r--r--src/gui/kernel/qsoftkeymanager.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/gui/kernel/qsoftkeymanager.cpp b/src/gui/kernel/qsoftkeymanager.cpp
index 45ecb5a..7874622 100644
--- a/src/gui/kernel/qsoftkeymanager.cpp
+++ b/src/gui/kernel/qsoftkeymanager.cpp
@@ -247,9 +247,15 @@ bool QSoftKeyManager::handleCommand(int command)
if (command >= s60CommandStart && QSoftKeyManagerPrivate::softKeySource) {
int index = command - s60CommandStart;
const QList<QAction*>& softKeys = QSoftKeyManagerPrivate::softKeySource->actions();
- if (index < softKeys.count()) {
- softKeys.at(index)->activate(QAction::Trigger);
- return true;
+ for (int i = 0, j = 0; i < softKeys.count(); ++i) {
+ QAction *action = softKeys.at(i);
+ if (action->softKeyRole() != QAction::NoSoftKey) {
+ if (j == index) {
+ action->activate(QAction::Trigger);
+ return true;
+ }
+ j++;
+ }
}
}