From 0bbc5b80cdfb56e693258c1eeccadaae9e3d6546 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 30 Apr 2014 22:30:12 +0200 Subject: [PATCH 04/12] Change dbus timeouts to return much faster The sync usage of DBus is probably the worst design mistake in this library, mititage it a bit. --- src/qaccessibilityclient/registry_p.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qaccessibilityclient/registry_p.cpp b/src/qaccessibilityclient/registry_p.cpp index d28bfb0..584685b 100644 --- a/src/qaccessibilityclient/registry_p.cpp +++ b/src/qaccessibilityclient/registry_p.cpp @@ -543,7 +543,7 @@ QList RegistryPrivate::children(const AccessibleObject &object QDBusMessage message = QDBusMessage::createMethodCall ( object.d->service, object.d->path, QLatin1String("org.a11y.atspi.Accessible"), QLatin1String("GetChildren")); - QDBusReply reply = conn.connection().call(message); + QDBusReply reply = conn.connection().call(message, QDBus::Block, 500); if (!reply.isValid()) { qWarning() << "Could not access children." << reply.error().message(); return accs; @@ -1163,7 +1163,7 @@ QString RegistryPrivate::imageDescription(const AccessibleObject &object) const QString RegistryPrivate::imageLocale(const AccessibleObject &object) const { QDBusMessage message = QDBusMessage::createMethodCall(object.d->service, object.d->path, QLatin1String("org.a11y.atspi.Image"), QLatin1String("ImageLocale")); - QDBusReply reply = conn.connection().call(message); + QDBusReply reply = conn.connection().call(message, QDBus::Block, 500); if (!reply.isValid()) { qWarning() << "Could not access imageLocale." << reply.error().message(); return QString(); @@ -1191,7 +1191,7 @@ QVector< QSharedPointer > RegistryPrivate::actions(const AccessibleObje QDBusMessage message = QDBusMessage::createMethodCall ( object.d->service, object.d->path, QLatin1String("org.a11y.atspi.Action"), QLatin1String("GetActions")); - QDBusReply reply = conn.connection().call(message); + QDBusReply reply = conn.connection().call(message, QDBus::Block, 500); if (!reply.isValid()) { qWarning() << "Could not access actions." << reply.error().message(); return QVector< QSharedPointer >(); @@ -1230,7 +1230,7 @@ void RegistryPrivate::actionTriggered(const QString &action) args << index; message.setArguments(args); - QDBusReply reply = conn.connection().call(message); + QDBusReply reply = conn.connection().call(message, QDBus::Block, 500); if (!reply.isValid()) { qWarning() << "Could not execute action=" << action << reply.error().message(); return; @@ -1253,7 +1253,7 @@ QVariant RegistryPrivate::getProperty(const QString &service, const QString &pat service, path, QLatin1String("org.freedesktop.DBus.Properties"), QLatin1String("Get")); message.setArguments(args); - QDBusMessage reply = conn.connection().call(message); + QDBusMessage reply = conn.connection().call(message, QDBus::Block, 500); if (reply.arguments().isEmpty()) return QVariant(); -- 2.9.4