dbus fetch all pending messages at once

This commit is contained in:
Sascha Kruse 2012-12-12 14:05:34 +01:00
parent 3af63f1ddc
commit 345a35fe9f

View File

@ -131,37 +131,36 @@ void dbus_poll(int timeout)
dbus_connection_read_write(dbus_conn, timeout); dbus_connection_read_write(dbus_conn, timeout);
dbus_msg = dbus_connection_pop_message(dbus_conn); dbus_msg = dbus_connection_pop_message(dbus_conn);
/* we don't have a new message */
if (dbus_msg == NULL) {
return;
}
if (dbus_message_is_method_call while (dbus_msg) {
(dbus_msg, "org.freedesktop.DBus.Introspectable", "Introspect")) { if (dbus_message_is_method_call
dbus_introspect(dbus_msg); (dbus_msg, "org.freedesktop.DBus.Introspectable", "Introspect")) {
} dbus_introspect(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg, if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications", "org.freedesktop.Notifications",
"Notify")) { "Notify")) {
notify(dbus_msg); notify(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"GetCapabilities")) {
getCapabilities(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"GetServerInformation")) {
getServerInformation(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"CloseNotification")) {
closeNotification(dbus_msg);
}
dbus_message_unref(dbus_msg);
dbus_msg = dbus_connection_pop_message(dbus_conn);
} }
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"GetCapabilities")) {
getCapabilities(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"GetServerInformation")) {
getServerInformation(dbus_msg);
}
if (dbus_message_is_method_call(dbus_msg,
"org.freedesktop.Notifications",
"CloseNotification")) {
closeNotification(dbus_msg);
}
dbus_message_unref(dbus_msg);
} }
void getCapabilities(DBusMessage * dmsg) void getCapabilities(DBusMessage * dmsg)