diff options
author | Liang Qi <liang.qi@qt.io> | 2016-09-21 10:23:29 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2016-09-21 11:57:52 +0200 |
commit | 7555a925816e3244073803f0adc4d44640f5ac1d (patch) | |
tree | f6f11015ae7387b50eaa76aa2c80ff273093b188 /src/dbus/qdbusintegrator.cpp | |
parent | 31c251765db45a068f1268027e5dd600151af1e5 (diff) | |
parent | 8d64d1e0c3f7ebcee859e8b5f40aa27a8df86351 (diff) |
Merge remote-tracking branch 'origin/5.7' into 5.8
5971b88e is not needed in new configure.
This merge also reverts "fix QMAKE_DEFAULT_*DIRS resolution with
apple SDK", 2c9d15d7, because it breaks iOS build with new
configure system.
Conflicts:
mkspecs/features/default_pre.prf
mkspecs/features/mac/toolchain.prf
mkspecs/features/toolchain.prf
src/dbus/qdbusconnection.cpp
src/plugins/sqldrivers/mysql/qsql_mysql.cpp
src/sql/drivers/mysql/qsql_mysql.cpp
src/widgets/widgets/qmenubar.cpp
src/widgets/widgets/qmenubar_p.h
tools/configure/configureapp.cpp
tools/configure/environment.cpp
tools/configure/environment.h
Change-Id: I995533dd334211ebd25912db05b639d6f908aaec
Diffstat (limited to 'src/dbus/qdbusintegrator.cpp')
-rw-r--r-- | src/dbus/qdbusintegrator.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index 21bc3c8ac2..c63fb05e74 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -315,9 +315,21 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v // setPeer does the error handling for us QDBusErrorInternal error; newConnection->setPeer(connection, error); + newConnection->setDispatchEnabled(false); // this is a queued connection and will resume in the QDBusServer's thread emit serverConnection->newServerConnection(newConnection); + + // we've disabled dispatching of events, so now we post an event to the + // QDBusServer's thread in order to enable it after the + // QDBusServer::newConnection() signal has been received by the + // application's code + newConnection->ref.ref(); + QReadLocker serverLock(&serverConnection->lock); + QDBusConnectionDispatchEnabler *o = new QDBusConnectionDispatchEnabler(newConnection); + QTimer::singleShot(0, o, SLOT(execute())); + if (serverConnection->serverObject) + o->moveToThread(serverConnection->serverObject->thread()); } void QDBusConnectionPrivate::_q_newConnection(QDBusConnectionPrivate *newConnection) @@ -1250,6 +1262,7 @@ void QDBusConnectionPrivate::relaySignal(QObject *obj, const QMetaObject *mo, in break; } + checkThread(); QDBusReadLocker locker(RelaySignalAction, this); QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/"), interface, QLatin1String(memberName)); @@ -2358,12 +2371,9 @@ void QDBusConnectionPrivate::registerObject(const ObjectTreeNode *node) connector->connectAllSignals(node->obj); } - // disconnect and reconnect to avoid duplicates - connector->disconnect(SIGNAL(relaySignal(QObject*,const QMetaObject*,int,QVariantList)), - this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList))); connect(connector, SIGNAL(relaySignal(QObject*,const QMetaObject*,int,QVariantList)), this, SLOT(relaySignal(QObject*,const QMetaObject*,int,QVariantList)), - Qt::DirectConnection); + Qt::ConnectionType(Qt::QueuedConnection | Qt::UniqueConnection)); } } |