diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp index cb3cee3d6b..3d9dff891d 100644 --- a/src/dbus/qdbusserver.cpp +++ b/src/dbus/qdbusserver.cpp @@ -51,27 +51,15 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent) localhost (elsewhere). */ QDBusServer::QDBusServer(QObject *parent) - : QObject(parent), d(nullptr) -{ + : QDBusServer( #ifdef Q_OS_UNIX - // Use Unix sockets on Unix systems only - const QString address = QStringLiteral("unix:tmpdir=/tmp"); + // Use Unix sockets on Unix systems only + QStringLiteral("unix:tmpdir=/tmp"), #else - const QString address = QStringLiteral("tcp:"); + QStringLiteral("tcp:"), #endif - - if (!qdbus_loadLibDBus()) - return; - - QDBusConnectionManager *instance = QDBusConnectionManager::instance(); - if (!instance) - return; - - instance->createServer(address, this); - Q_ASSERT(d != nullptr); - - QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)), - this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection); + parent) +{ } /*!