From 393462ae14f6c33d0dc462704c754cf4f6bd41c3 Mon Sep 17 00:00:00 2001 From: "Daniele E. Domenichelli" Date: Mon, 18 Apr 2011 11:21:04 -0500 Subject: QtDBus: Cleaning comments, spacing, etc. Merge-request: 2343 Reviewed-by: Marius Storm-Olsen Reviewed-by: Thiago Macieira --- src/dbus/qdbusconnection.cpp | 4 ++-- src/dbus/qdbusintegrator.cpp | 13 +++++-------- src/dbus/qdbusserver.cpp | 6 +++--- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 4883a4d..a7ee5b9 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -371,7 +371,7 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name) } /*! - Opens a peer-to-peer connection on address \a address and associate with it the + Opens a connection to a private bus on address \a address and associate with it the connection name \a name. Returns a QDBusConnection object associated with that connection. */ QDBusConnection QDBusConnection::connectToBus(const QString &address, @@ -413,7 +413,7 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address, } /*! - Closes the connection of name \a name. + Closes the bus connection of name \a name. Note that if there are still QDBusConnection objects associated with the same connection, the connection will not be closed until diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp index d6fbe80..a1cb209 100644 --- a/src/dbus/qdbusintegrator.cpp +++ b/src/dbus/qdbusintegrator.cpp @@ -377,7 +377,7 @@ static void qDBusUpdateDispatchStatus(DBusConnection *connection, DBusDispatchSt static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, void *data) { - // ### We may want to separate the server from the QDBusConnectionPrivate + // ### We may want to separate the server from the QDBusConnectionPrivate Q_ASSERT(server); Q_UNUSED(server); Q_ASSERT(connection); Q_ASSERT(data); @@ -385,17 +385,14 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v // keep the connection alive q_dbus_connection_ref(connection); QDBusConnectionPrivate *d = new QDBusConnectionPrivate; - - // setConnection does the error handling for us + + // setPeer does the error handling for us QDBusErrorInternal error; d->setPeer(connection, error); QDBusConnection retval = QDBusConnectionPrivate::q(d); d->setBusService(retval); - //d->name = QString::number(reinterpret_cast(d)); - //d->setConnection(d->name, d); - // make QDBusServer emit the newConnection signal QDBusConnectionPrivate *server_d = static_cast(data); server_d->serverConnection(retval); @@ -1630,7 +1627,7 @@ void QDBusConnectionPrivate::setServer(DBusServer *s, const QDBusErrorInternal & this, 0); //qDebug() << "time_functions_set" << time_functions_set; Q_UNUSED(time_functions_set); - + q_dbus_server_set_new_connection_function(server, qDBusNewConnection, this, 0); dbus_bool_t data_set = q_dbus_server_set_data(server, server_slot, this, 0); @@ -1647,7 +1644,7 @@ void QDBusConnectionPrivate::setPeer(DBusConnection *c, const QDBusErrorInternal connection = c; mode = PeerMode; - + q_dbus_connection_set_exit_on_disconnect(connection, false); q_dbus_connection_set_watch_functions(connection, qDBusAddWatch, diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp index 9b61555..1fe80bd 100644 --- a/src/dbus/qdbusserver.cpp +++ b/src/dbus/qdbusserver.cpp @@ -74,7 +74,6 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent) QObject::connect(d, SIGNAL(newServerConnection(QDBusConnection)), this, SIGNAL(newConnection(QDBusConnection))); - // server = q_dbus_server_listen( "unix:tmpdir=/tmp", &error); QDBusErrorInternal error; d->setServer(q_dbus_server_listen(address.toUtf8().constData(), error), error); } @@ -113,11 +112,12 @@ QString QDBusServer::address() const return addr; } + /*! \fn void QDBusServer::newConnection(const QDBusConnection &connection) - This signal is currently not used, but if and when it is - used, \a connection will be the new connection. + This signal is emitted when a new client connection \a connection is + established to the server. */ QT_END_NAMESPACE -- cgit v0.12