Accessibility: make sure right objects are cached on linux
authorFrederik Gladhorn <frederik.gladhorn@digia.com>
Fri, 19 Oct 2012 09:13:09 +0000 (11:13 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Sat, 27 Oct 2012 18:24:33 +0000 (20:24 +0200)
This patch goes together with 730a5a994ff46055055c58b25bd059373dddb934
and is the second code path that deals with the hash of valid objects.

Change-Id: Ia7b0995cb667cfce5f7697aa61856e44f745a932
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
src/platformsupport/linuxaccessibility/atspiadaptor.cpp

index 79d7325..6926f54 100644 (file)
@@ -1507,7 +1507,7 @@ QString AtSpiAdaptor::pathForObject(QObject *object) const
         qAtspiDebug() << "AtSpiAdaptor::pathForObject: warning: creating path with QAction as object.";
     }
     quintptr uintptr = reinterpret_cast<quintptr>(object);
-    if (!m_handledObjects.contains(uintptr))
+    if (!m_handledObjects.contains(uintptr) || m_handledObjects.value(uintptr) == 0)
         m_handledObjects[uintptr] = QPointer<QObject>(object);
     return QLatin1String(QSPI_OBJECT_PATH_PREFIX) + QString::number(uintptr);
 }