return NULL;
}
-static struct filter_data *filter_data_find(DBusConnection *connection,
- const char *name,
- const char *owner,
- const char *path,
- const char *interface,
- const char *member,
- const char *argument)
+static struct filter_data *filter_data_find(DBusConnection *connection)
{
GSList *current;
if (connection != data->connection)
continue;
- if (name && data->name &&
- g_str_equal(name, data->name) == FALSE)
- continue;
-
- if (owner && data->owner &&
- g_str_equal(owner, data->owner) == FALSE)
- continue;
-
- if (path && data->path &&
- g_str_equal(path, data->path) == FALSE)
- continue;
-
- if (interface && data->interface &&
- g_str_equal(interface, data->interface) == FALSE)
- continue;
-
- if (member && data->member &&
- g_str_equal(member, data->member) == FALSE)
- continue;
-
- if (argument && data->argument &&
- g_str_equal(argument, data->argument) == FALSE)
- continue;
-
return data;
}
struct filter_data *data;
const char *name = NULL, *owner = NULL;
- if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL, NULL) == NULL) {
+ if (filter_data_find(connection) == NULL) {
if (!dbus_connection_add_filter(connection,
message_filter, NULL, NULL)) {
error("dbus_connection_add_filter() failed");
listeners = g_slist_remove(listeners, data);
/* Remove filter if there are no listeners left for the connection */
- if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL,
- NULL) == NULL)
+ if (filter_data_find(connection) == NULL)
dbus_connection_remove_filter(connection, message_filter,
NULL);
g_slist_free(delete_listener);
/* Remove filter if there are no listeners left for the connection */
- if (filter_data_find(connection, NULL, NULL, NULL, NULL, NULL,
- NULL) == NULL)
+ if (filter_data_find(connection) == NULL)
dbus_connection_remove_filter(connection, message_filter,
NULL);
{
struct filter_data *data;
- while ((data = filter_data_find(connection, NULL, NULL, NULL, NULL,
- NULL, NULL))) {
+ while ((data = filter_data_find(connection))) {
listeners = g_slist_remove(listeners, data);
filter_data_call_and_free(data);
}