summaryrefslogtreecommitdiffstats
path: root/util/accessibilityinspector/screenreader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'util/accessibilityinspector/screenreader.cpp')
-rw-r--r--util/accessibilityinspector/screenreader.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/util/accessibilityinspector/screenreader.cpp b/util/accessibilityinspector/screenreader.cpp
index 3a73f21314..7593948b63 100644
--- a/util/accessibilityinspector/screenreader.cpp
+++ b/util/accessibilityinspector/screenreader.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
- ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+ ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -97,30 +97,17 @@ void ScreenReader::processTouchPoint()
int hit = -2;
int guardCounter = 0;
const int guardMax = 40;
- while (hit != 0) {
+ while (currentInterface != 0) {
++guardCounter;
if (guardCounter > guardMax) {
qDebug() << "touchPoint exit recursion overflow";
return; // outside
}
- hit = currentInterface->childAt(m_currentTouchPoint.x(), m_currentTouchPoint.y());
- //qDebug() << "hit" << hit;
- if (hit == -1) {
- return; // outside
- } else if (hit == 0) {
- break; // found it.
- } else {
- QAccessibleInterface *childInterface = 0;
- int child = currentInterface->navigate(QAccessible::Child, hit, &childInterface);
- if (childInterface == 0) {
- return; // navigation error
- }
-
- if (currentInterface != m_rootInterface)
- delete currentInterface;
- currentInterface = childInterface;
- }
+ QAccessibleInterface * hit = currentInterface->childAt(m_currentTouchPoint.x(), m_currentTouchPoint.y());
+ if (!hit)
+ break;
+ currentInterface = hit;
}
m_selectedInterface = currentInterface;