From 69a1fce88bb5f733895cc21758fd398bd650b7a6 Mon Sep 17 00:00:00 2001 From: Aaron McCarthy Date: Fri, 5 Nov 2010 10:01:24 +1000 Subject: Fix synchronous dispatch in ICD in non-main threads. ICD DBus signals always come in via the main thread. During synchronous dispatch these signals were not being emitted when expected because no event loop is running in the destination thread. Fixed by added a call to QCoreApplication::sendPostedEvents(object, QEvent::MetaCall) in the synchronous dispatch loop. Task-number: QTBUG-15004 --- src/plugins/bearer/icd/maemo_icd.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/bearer/icd/maemo_icd.cpp b/src/plugins/bearer/icd/maemo_icd.cpp index 4f879e3..57ab0a8 100644 --- a/src/plugins/bearer/icd/maemo_icd.cpp +++ b/src/plugins/bearer/icd/maemo_icd.cpp @@ -508,6 +508,7 @@ uint IcdPrivate::state(QList& state_results) mInterface.clear(); while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) { mDBus->synchronousDispatch(1000); + QCoreApplication::sendPostedEvents(icd, QEvent::MetaCall); } if (time(0)>(started+timeout_secs)) { @@ -685,6 +686,7 @@ uint IcdPrivate::addrinfo(QList& addr_results) mInterface.clear(); while ((time(0)<=(started+timeout_secs)) && mInterface.isEmpty()) { mDBus->synchronousDispatch(1000); + QCoreApplication::sendPostedEvents(icd, QEvent::MetaCall); } if (time(0)>(started+timeout_secs)) { -- cgit v0.12