summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMorten Johan Sorvig <morten.sorvig@nokia.com>2012-01-12 10:14:56 +0100
committerQt by Nokia <qt-info@nokia.com>2012-01-17 19:24:29 +0100
commit81e55fede783b3747998c98f2471d773805b9246 (patch)
tree4561f4c8e54f1db2d84a8d9e80606f2897e30a28 /src
parent1656c4780cc6c1d96f47522046f3f53b1eebb95a (diff)
Improve accessibility actions descriptions on Mac
Use built-in descriptions for built-in actions Change-Id: Ic5581e89e4568abcc6c3add126d492345d26d87d Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
index 830e6860b7..ceb60faf41 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.mm
@@ -195,11 +195,12 @@ static QAccessibleInterface *acast(void *ptr)
- (NSString *)accessibilityActionDescription:(NSString *)action {
QAccessibleActionInterface *actionInterface = acast(accessibleInterface)->actionInterface();
- if (actionInterface) {
- QString qtAction = QCocoaAccessible::translateAction(action);
+ QString qtAction = QCocoaAccessible::translateAction(action);
+
+ // Return a description from the action interface if this action is not known to the OS.
+ if (qtAction.isEmpty()) {
QString description = actionInterface->localizedActionDescription(qtAction);
- if (!description.isEmpty())
- return qt_mac_QStringToNSString(description);
+ return qt_mac_QStringToNSString(description);
}
return NSAccessibilityActionDescription(action);