|
|
|
@ -53,7 +53,7 @@ static dbus_bool_t qDBusAddTimeout(DBusTimeout *timeout, void *data)
|
|
|
|
|
Q_ASSERT(timeout);
|
|
|
|
|
Q_ASSERT(data);
|
|
|
|
|
|
|
|
|
|
// qDebug("addTimeout %d", dbus_timeout_get_interval(timeout));
|
|
|
|
|
// tqDebug("addTimeout %d", dbus_timeout_get_interval(timeout));
|
|
|
|
|
|
|
|
|
|
TQT_DBusConnectionPrivate *d = static_cast<TQT_DBusConnectionPrivate *>(data);
|
|
|
|
|
|
|
|
|
@ -77,7 +77,7 @@ static void qDBusRemoveTimeout(DBusTimeout *timeout, void *data)
|
|
|
|
|
Q_ASSERT(timeout);
|
|
|
|
|
Q_ASSERT(data);
|
|
|
|
|
|
|
|
|
|
// qDebug("removeTimeout");
|
|
|
|
|
// tqDebug("removeTimeout");
|
|
|
|
|
|
|
|
|
|
TQT_DBusConnectionPrivate *d = static_cast<TQT_DBusConnectionPrivate *>(data);
|
|
|
|
|
for (TQValueList<DBusTimeout*>::iterator it = d->pendingTimeouts.begin();
|
|
|
|
@ -107,7 +107,7 @@ static void qDBusToggleTimeout(DBusTimeout *timeout, void *data)
|
|
|
|
|
Q_ASSERT(timeout);
|
|
|
|
|
Q_ASSERT(data);
|
|
|
|
|
|
|
|
|
|
//qDebug("ToggleTimeout");
|
|
|
|
|
//tqDebug("ToggleTimeout");
|
|
|
|
|
|
|
|
|
|
qDBusRemoveTimeout(timeout, data);
|
|
|
|
|
qDBusAddTimeout(timeout, data);
|
|
|
|
@ -126,7 +126,7 @@ static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
|
|
|
|
|
TQT_DBusConnectionPrivate::Watcher watcher;
|
|
|
|
|
if (flags & DBUS_WATCH_READABLE) {
|
|
|
|
|
bool enabled = dbus_watch_get_enabled(watch);
|
|
|
|
|
//qDebug("addReadWatch %d %s", fd, (enabled ? "enabled" : "disabled"));
|
|
|
|
|
//tqDebug("addReadWatch %d %s", fd, (enabled ? "enabled" : "disabled"));
|
|
|
|
|
watcher.watch = watch;
|
|
|
|
|
if (tqApp) {
|
|
|
|
|
watcher.read = new TQSocketNotifier(fd, TQSocketNotifier::Read, d);
|
|
|
|
@ -136,7 +136,7 @@ static dbus_bool_t qDBusAddWatch(DBusWatch *watch, void *data)
|
|
|
|
|
}
|
|
|
|
|
if (flags & DBUS_WATCH_WRITABLE) {
|
|
|
|
|
bool enabled = dbus_watch_get_enabled(watch);
|
|
|
|
|
//qDebug("addWriteWatch %d %s", fd, (enabled ? "enabled" : "disabled"));
|
|
|
|
|
//tqDebug("addWriteWatch %d %s", fd, (enabled ? "enabled" : "disabled"));
|
|
|
|
|
watcher.watch = watch;
|
|
|
|
|
if (tqApp) {
|
|
|
|
|
watcher.write = new TQSocketNotifier(fd, TQSocketNotifier::Write, d);
|
|
|
|
@ -160,7 +160,7 @@ static void qDBusRemoveWatch(DBusWatch *watch, void *data)
|
|
|
|
|
Q_ASSERT(watch);
|
|
|
|
|
Q_ASSERT(data);
|
|
|
|
|
|
|
|
|
|
//qDebug("remove watch");
|
|
|
|
|
//tqDebug("remove watch");
|
|
|
|
|
|
|
|
|
|
TQT_DBusConnectionPrivate *d = static_cast<TQT_DBusConnectionPrivate *>(data);
|
|
|
|
|
int fd = dbus_watch_get_unix_fd(watch);
|
|
|
|
@ -202,7 +202,7 @@ static void qDBusToggleWatch(DBusWatch *watch, void *data)
|
|
|
|
|
Q_ASSERT(watch);
|
|
|
|
|
Q_ASSERT(data);
|
|
|
|
|
|
|
|
|
|
//qDebug("toggle watch");
|
|
|
|
|
//tqDebug("toggle watch");
|
|
|
|
|
|
|
|
|
|
TQT_DBusConnectionPrivate *d = static_cast<TQT_DBusConnectionPrivate *>(data);
|
|
|
|
|
int fd = dbus_watch_get_unix_fd(watch);
|
|
|
|
@ -217,7 +217,7 @@ static void qDBusToggleWatch(DBusWatch *watch, void *data)
|
|
|
|
|
bool enabled = dbus_watch_get_enabled(watch);
|
|
|
|
|
int flags = dbus_watch_get_flags(watch);
|
|
|
|
|
|
|
|
|
|
// qDebug("toggle watch %d to %d (write: %d, read: %d)",
|
|
|
|
|
// tqDebug("toggle watch %d to %d (write: %d, read: %d)",
|
|
|
|
|
// dbus_watch_get_unix_fd(watch), enabled,
|
|
|
|
|
// flags & DBUS_WATCH_WRITABLE, flags & DBUS_WATCH_READABLE);
|
|
|
|
|
|
|
|
|
@ -235,7 +235,7 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *c, void *data
|
|
|
|
|
{
|
|
|
|
|
Q_ASSERT(data); Q_ASSERT(server); Q_ASSERT(c);
|
|
|
|
|
|
|
|
|
|
qDebug("SERVER: GOT A NEW CONNECTION"); // TODO
|
|
|
|
|
tqDebug("SERVER: GOT A NEW CONNECTION"); // TODO
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static DBusHandlerResult qDBusSignalFilter(DBusConnection *connection,
|
|
|
|
@ -252,7 +252,7 @@ static DBusHandlerResult qDBusSignalFilter(DBusConnection *connection,
|
|
|
|
|
bool handled = false;
|
|
|
|
|
|
|
|
|
|
//TQT_DBusMessage amsg = TQT_DBusMessage::fromDBusMessage(message);
|
|
|
|
|
//qDebug() << "got message: " << dbus_message_get_type(message) << amsg;
|
|
|
|
|
//tqDebug() << "got message: " << dbus_message_get_type(message) << amsg;
|
|
|
|
|
|
|
|
|
|
if (msgType == DBUS_MESSAGE_TYPE_SIGNAL) {
|
|
|
|
|
handled = d->handleSignal(message);
|
|
|
|
@ -363,7 +363,7 @@ void TQT_DBusConnectionPrivate::socketRead(int fd)
|
|
|
|
|
for (WatcherList::const_iterator wit = list.begin(); wit != list.end(); ++wit) {
|
|
|
|
|
if ((*wit).read && (*wit).read->isEnabled()) {
|
|
|
|
|
if (!dbus_watch_handle((*wit).watch, DBUS_WATCH_READABLE))
|
|
|
|
|
qDebug("OUT OF MEM");
|
|
|
|
|
tqDebug("OUT OF MEM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -380,7 +380,7 @@ void TQT_DBusConnectionPrivate::socketWrite(int fd)
|
|
|
|
|
for (WatcherList::const_iterator wit = list.begin(); wit != list.end(); ++wit) {
|
|
|
|
|
if ((*wit).write && (*wit).write->isEnabled()) {
|
|
|
|
|
if (!dbus_watch_handle((*wit).watch, DBUS_WATCH_WRITABLE))
|
|
|
|
|
qDebug("OUT OF MEM");
|
|
|
|
|
tqDebug("OUT OF MEM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -388,7 +388,7 @@ void TQT_DBusConnectionPrivate::socketWrite(int fd)
|
|
|
|
|
|
|
|
|
|
void TQT_DBusConnectionPrivate::objectDestroyed(TQObject* object)
|
|
|
|
|
{
|
|
|
|
|
//qDebug("Object destroyed");
|
|
|
|
|
//tqDebug("Object destroyed");
|
|
|
|
|
for (PendingCallMap::iterator it = pendingCalls.begin(); it != pendingCalls.end();)
|
|
|
|
|
{
|
|
|
|
|
TQObject* receiver = (TQObject*) it.data()->receiver;
|
|
|
|
@ -547,17 +547,17 @@ void TQT_DBusConnectionPrivate::setConnection(DBusConnection *dbc)
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
qWarning("TQT_DBusConnectionPrivate::SetConnection: Unable to get unique name");
|
|
|
|
|
tqWarning("TQT_DBusConnectionPrivate::SetConnection: Unable to get unique name");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dbus_connection_add_filter(connection, qDBusSignalFilter, this, 0);
|
|
|
|
|
|
|
|
|
|
//qDebug("unique name: %s", service);
|
|
|
|
|
//tqDebug("unique name: %s", service);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void qDBusResultReceived(DBusPendingCall *pending, void *user_data)
|
|
|
|
|
{
|
|
|
|
|
//qDebug("Pending Call Result received");
|
|
|
|
|
//tqDebug("Pending Call Result received");
|
|
|
|
|
TQT_DBusConnectionPrivate* d = reinterpret_cast<TQT_DBusConnectionPrivate*>(user_data);
|
|
|
|
|
TQT_DBusConnectionPrivate::PendingCallMap::iterator it = d->pendingCalls.find(pending);
|
|
|
|
|
|
|
|
|
|