From 970414569e3cbd6e2d99a3bd38129448a31a8f98 Mon Sep 17 00:00:00 2001 From: Harald Fernengel Date: Sat, 4 Sep 2004 15:09:48 +0000 Subject: =?UTF-8?q?patch=20by=20J=C3=A9r=C3=B4me=20Lodewyck=20=20to=20enable=20integration=20of=20an=20existing?= =?UTF-8?q?=20connection=20into=20the=20Qt=20main=20loop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qt/connection.cpp | 7 +++++++ qt/connection.h | 1 + qt/integrator.cpp | 9 +++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'qt') diff --git a/qt/connection.cpp b/qt/connection.cpp index ba161504..f426d698 100644 --- a/qt/connection.cpp +++ b/qt/connection.cpp @@ -156,6 +156,13 @@ void* Connection::virtual_hook( int, void* ) { } +void Connection::dbus_connection_setup_with_qt_main (DBusConnection *connection) +{ + d->setConnection( connection ); +} + + + ///////////////////////////////////////////////////////// #include "connection.moc" diff --git a/qt/connection.h b/qt/connection.h index ca962b10..7cb922e3 100644 --- a/qt/connection.h +++ b/qt/connection.h @@ -50,6 +50,7 @@ namespace DBusQt { Message borrowMessage(); Message popMessage(); void stealBorrowMessage( const Message& ); + void dbus_connection_setup_with_qt_main (DBusConnection *connection); public slots: void open( const QString& ); diff --git a/qt/integrator.cpp b/qt/integrator.cpp index 5cf72644..fff32b39 100644 --- a/qt/integrator.cpp +++ b/qt/integrator.cpp @@ -162,13 +162,18 @@ Integrator::Integrator( DBusServer *server, QObject *parent ) void Integrator::slotRead( int fd ) { - Q_UNUSED( fd ); + QIntDictIterator it( m_watches ); + for ( ; it.current(); ++it ) + dbus_watch_handle ( it.current()->watch, DBUS_WATCH_READABLE ); + emit readReady(); } void Integrator::slotWrite( int fd ) { - Q_UNUSED( fd ); + QIntDictIterator it( m_watches ); + for ( ; it.current(); ++it ) + dbus_watch_handle ( it.current()->watch, DBUS_WATCH_WRITABLE ); } void Integrator::slotTimeout( DBusTimeout *timeout ) -- cgit v1.2.1