summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusconnection_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbus/qdbusconnection_p.h')
-rw-r--r--src/dbus/qdbusconnection_p.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/src/dbus/qdbusconnection_p.h b/src/dbus/qdbusconnection_p.h
index d323088779..444d4727fd 100644
--- a/src/dbus/qdbusconnection_p.h
+++ b/src/dbus/qdbusconnection_p.h
@@ -59,7 +59,6 @@
#include <QtCore/qatomic.h>
#include <QtCore/qhash.h>
-#include <QtCore/qmutex.h>
#include <QtCore/qobject.h>
#include <QtCore/qpointer.h>
#include <QtCore/qreadwritelock.h>
@@ -149,14 +148,6 @@ public:
{ return name < other; }
inline bool operator<(const QStringRef &other) const
{ return QStringRef(&name) < other; }
-#if defined(Q_CC_MSVC) && _MSC_VER < 1600
- inline bool operator<(const ObjectTreeNode &other) const
- { return name < other.name; }
- friend inline bool operator<(const QString &str, const ObjectTreeNode &obj)
- { return str < obj.name; }
- friend inline bool operator<(const QStringRef &str, const ObjectTreeNode &obj)
- { return str < QStringRef(&obj.name); }
-#endif
inline bool isActive() const
{ return obj || !children.isEmpty(); }
@@ -198,7 +189,6 @@ public:
~QDBusConnectionPrivate();
void createBusService();
- void setDispatchEnabled(bool enable);
void setPeer(DBusConnection *connection, const QDBusErrorInternal &error);
void setConnection(DBusConnection *connection, const QDBusErrorInternal &error);
void setServer(QDBusServer *object, DBusServer *server, const QDBusErrorInternal &error);
@@ -271,10 +261,11 @@ private:
void _q_newConnection(QDBusConnectionPrivate *newConnection);
protected:
- void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE;
+ void timerEvent(QTimerEvent *e) override;
public slots:
// public slots
+ void setDispatchEnabled(bool enable);
void doDispatch();
void socketRead(int);
void socketWrite(int);
@@ -312,9 +303,6 @@ public:
QDBusServer *serverObject;
};
- // the dispatch lock protects everything related to the DBusConnection or DBusServer
- // including the timeouts and watches
- QMutex dispatchLock;
union {
DBusConnection *connection;
DBusServer *server;
@@ -390,7 +378,9 @@ public:
public slots:
void execute()
{
- con->setDispatchEnabled(true);
+ // This call cannot race with something disabling dispatch only because dispatch is
+ // never re-disabled from Qt code on an in-use connection once it has been enabled.
+ QMetaObject::invokeMethod(con, "setDispatchEnabled", Qt::QueuedConnection, Q_ARG(bool, true));
if (!con->ref.deref())
con->deleteLater();
deleteLater();