if (cd->shared_type != -1)
shared_connections[cd->shared_type] = NULL;
- if (cd->signal_dispatcher)
- ecore_event_handler_del(cd->signal_dispatcher);
if (cd->signal_handlers)
ecore_list_destroy(cd->signal_handlers);
static DBusHandlerResult
e_dbus_filter(DBusConnection *conn, DBusMessage *message, void *user_data)
{
+ E_DBus_Connection *cd = user_data;
DEBUG(3, "-----------------\nMessage!\n\n");
DEBUG(3, "type: %s\n", dbus_message_type_to_string(dbus_message_get_type(message)));
DEBUG(3, "error: %s\n", dbus_message_get_error_name(message));
break;
case DBUS_MESSAGE_TYPE_SIGNAL:
- ecore_event_add(E_DBUS_EVENT_SIGNAL, dbus_message_ref(message),
- e_dbus_message_free, NULL);
+ dbus_message_ref(message);
+
+ if (cd->signal_dispatcher)
+ cd->signal_dispatcher(cd, message);
+
+ ecore_event_add(E_DBUS_EVENT_SIGNAL, message, e_dbus_message_free, NULL);
/* don't need to handle signals, they're for everyone who wants them */
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
break;
dbus_connection_set_wakeup_main_function(cd->conn, cb_main_wakeup, cd, NULL);
dbus_connection_set_dispatch_status_function(cd->conn, cb_dispatch_status, cd, NULL);
- dbus_connection_add_filter(cd->conn, e_dbus_filter, NULL, NULL);
+ dbus_connection_add_filter(cd->conn, e_dbus_filter, cd, NULL);
cb_dispatch_status(cd->conn, dbus_connection_get_dispatch_status(cd->conn), cd);
if (--(conn->refcount) != 0) return;
dbus_connection_free_data_slot(&connection_slot);
- dbus_connection_remove_filter(conn->conn, e_dbus_filter, NULL);
+ dbus_connection_remove_filter(conn->conn, e_dbus_filter, conn);
dbus_connection_set_watch_functions (conn->conn,
NULL,
NULL,
unsigned char delete_me : 1;
};
-static int cb_signal_event(void *data, int type, void *event);
+static void cb_signal_dispatcher(E_DBus_Connection *conn, DBusMessage *msg);
/**
* Free a signal handler
conn->signal_handlers = ecore_list_new();
ecore_list_free_cb_set
(conn->signal_handlers, ECORE_FREE_CB(e_dbus_signal_handler_free));
- conn->signal_dispatcher = ecore_event_handler_add
- (E_DBUS_EVENT_SIGNAL, cb_signal_event, conn);
+ conn->signal_dispatcher = cb_signal_dispatcher;
}
/* if we have a sender, and it is not a unique name, we need to know the unique name to match since signals will have the name owner as ther sender. */
e_dbus_signal_handler_free(sh);
}
-static int
-cb_signal_event(void *data, int type, void *event)
+static void
+cb_signal_dispatcher(E_DBus_Connection *conn, DBusMessage *msg)
{
- E_DBus_Connection *conn = data;
- DBusMessage *msg = event;
E_DBus_Signal_Handler *sh;
ecore_list_first_goto(conn->signal_handlers);
sh->cb_signal(sh->data, msg);
}
-
- return 1;
}
void