QDBusServer: Remove private slot
Use QMetaObject::invokeMethod() to schedule call to QDBusConnectionPrivate::_q_newConnectioni() instead. This also gets rid of a by name signal/slot connection. Change-Id: I8725c4e3815c5580c5561bdddda0ab722b06346e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
f87d214000
commit
d865e3ef1d
|
|
@ -214,6 +214,8 @@ public:
|
|||
|
||||
void enableDispatchDelayed(QObject *context);
|
||||
|
||||
void _q_newConnection(QDBusConnectionPrivate *newConnection);
|
||||
|
||||
private:
|
||||
void checkThread();
|
||||
bool handleError(const QDBusErrorInternal &error);
|
||||
|
|
@ -241,8 +243,6 @@ private:
|
|||
|
||||
void watchForDBusDisconnection();
|
||||
|
||||
void _q_newConnection(QDBusConnectionPrivate *newConnection);
|
||||
|
||||
void handleAuthentication();
|
||||
|
||||
bool addSignalHook(const QString &key, const SignalHook &hook);
|
||||
|
|
@ -275,7 +275,6 @@ signals:
|
|||
void messageNeedsSending(QDBusPendingCallPrivate *pcall, void *msg, int timeout = -1);
|
||||
void serviceOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner);
|
||||
void callWithCallbackFailed(const QDBusError &error, const QDBusMessage &message);
|
||||
void newServerConnection(QDBusConnectionPrivate *newConnection);
|
||||
|
||||
public:
|
||||
QAtomicInt ref;
|
||||
|
|
|
|||
|
|
@ -316,7 +316,8 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
|
|||
newConnection->setDispatchEnabled(false);
|
||||
|
||||
// this is a queued connection and will resume in the QDBusServer's thread
|
||||
emit serverConnection->newServerConnection(newConnection);
|
||||
QMetaObject::invokeMethod(serverConnection, &QDBusConnectionPrivate::_q_newConnection,
|
||||
Qt::QueuedConnection, 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
|
||||
|
|
|
|||
|
|
@ -40,9 +40,6 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
|||
|
||||
instance->createServer(address, this);
|
||||
Q_ASSERT(d != nullptr);
|
||||
|
||||
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
|
||||
this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ Q_SIGNALS:
|
|||
|
||||
private:
|
||||
Q_DISABLE_COPY(QDBusServer)
|
||||
Q_PRIVATE_SLOT(d, void _q_newConnection(QDBusConnectionPrivate*))
|
||||
QDBusConnectionPrivate *d;
|
||||
friend class QDBusConnectionPrivate;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue