summaryrefslogtreecommitdiff
path: root/qt
diff options
context:
space:
mode:
authorHarald Fernengel <harry@kdevelop.org>2004-09-04 15:09:48 +0000
committerJohn Palmieri <johnp@remedyz.boston.redhat.com>2006-06-28 08:15:10 -0400
commitd3f5ce7145626549a1a778ef67334884f67010f6 (patch)
treefca21397e7f4b2b12da1793dd5c359907e1c70a1 /qt
parenta9ca8569807e579d32867eb4b0f6a1ba54951a95 (diff)
patch by Jÿrÿme Lodewyck <lodewyck@clipper.ens.fr> to enable integration
of an existing connection into the Qt main loop
Diffstat (limited to 'qt')
-rw-r--r--qt/connection.cpp7
-rw-r--r--qt/connection.h1
-rw-r--r--qt/integrator.cpp9
3 files changed, 15 insertions, 2 deletions
diff --git a/qt/connection.cpp b/qt/connection.cpp
index ba16150..f426d69 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 ca962b1..7cb922e 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 5cf7264..fff32b3 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<Watch> 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<Watch> it( m_watches );
+ for ( ; it.current(); ++it )
+ dbus_watch_handle ( it.current()->watch, DBUS_WATCH_WRITABLE );
}
void Integrator::slotTimeout( DBusTimeout *timeout )