summaryrefslogtreecommitdiffstats
path: root/qt/connection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt/connection.cpp')
-rw-r--r--qt/connection.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/qt/connection.cpp b/qt/connection.cpp
index 830987d6..72b67ac9 100644
--- a/qt/connection.cpp
+++ b/qt/connection.cpp
@@ -38,9 +38,6 @@ struct Connection::Private
Connection::Connection( const QString& host )
{
d = new Private;
- d->integrator = new Integrator( this );
- connect( d->integrator, SIGNAL(readReady()),
- SLOT(dispatchRead()) );
if ( !host.isEmpty() )
init( host );
@@ -50,6 +47,9 @@ void Connection::init( const QString& host )
{
dbus_error_init( &d->error );
d->connection = dbus_connection_open( host.ascii(), &d->error );
+ d->integrator = new Integrator( d->connection, this );
+ connect( d->integrator, SIGNAL(readReady()),
+ SLOT(dispatchRead()) );
//dbus_connection_allocate_data_slot( &d->connectionSlot );
//dbus_connection_set_data( d->connection, d->connectionSlot, 0, 0 );
}
@@ -90,6 +90,16 @@ DBusConnection* Connection::connection() const
return d->connection;
}
+Connection::Connection( DBusConnection *connection, QObject *parent )
+ : QObject( parent )
+{
+ d = new Private;
+ d->connection = connection;
+ d->integrator = new Integrator( d->connection, this );
+ connect( d->integrator, SIGNAL(readReady()),
+ SLOT(dispatchRead()) );
+}
+
/////////////////////////////////////////////////////////
#include "connection.moc"